diff --git a/documentation/srandard_library.md b/documentation/srandard_library.md index fe7e083..5f7cff2 100644 --- a/documentation/srandard_library.md +++ b/documentation/srandard_library.md @@ -1,6 +1,6 @@ # Standard Library -## `pub struct String` +### `pub struct String` Editable string value that can be printed and extended @@ -8,38 +8,38 @@ Has the following binops defined: - `String` + `*char` = `String` - `String` + `u64` = `String` -## `pub fn print(message: String)` +### `pub fn print(message: String)` Prints given `message` to the standard output -## `pub fn allocate(size: u64) -> *u8` +### `pub fn allocate(size: u64) -> *u8` Unsafely allocates `size` bytes of memory from the stack, and returns a pointer to it, which must be manually freed. -## `pub fn new_string() -> String` +### `pub fn new_string() -> String` Returns a new empty `String`-object, which must later be manually freed. -## `pub fn from_str(string: *char) -> String` +### `pub fn from_str(string: *char) -> String` Creates a new `String`-object containing initially data from the given string-literal which must be later freed. -## `pub fn set_char(string: &mut String, c: char, position: u64)` +### `pub fn set_char(string: &mut String, c: char, position: u64)` Edits given `string` by setting the character at index `position` to be `c`. -## `pub fn add_num_to_string(string: &mut String, num: u64)` +### `pub fn add_num_to_string(string: &mut String, num: u64)` Formats the given number into the end of the string. -## `pub fn concat_strings(destination: &mut String, source: String)` +### `pub fn concat_strings(destination: &mut String, source: String)` Concatenates `source` to the end of `destination`. -## `pub fn clamp(min: f32, max: f32, value: f32) -> f32` +### `pub fn clamp(min: f32, max: f32, value: f32) -> f32` Returns `value` as clamped between `min` and `max`. Equivalent to `max(min(value, max), min)` -## `pub fn abs(value: f32) -> f32` +### `pub fn abs(value: f32) -> f32` Returns the absolute value of `value`. \ No newline at end of file