1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-06-26 11:29:28 +00:00
millfork/docs/stdlib/string.md

31 lines
1.0 KiB
Markdown
Raw Normal View History

2019-07-15 12:21:50 +00:00
[< back to index](../doc_index.md)
2018-12-19 18:01:53 +00:00
## string
The `string` module automatically imports the `err` module.
#### `byte strzlen(pointer str)`
Calculates the length of a null-terminated string.
If the string is longer than 255 bytes, then the behaviour is undefined (might even crash).
#### `sbyte strzcmp(pointer str1, pointer str2)`
2019-06-05 09:46:06 +00:00
Compares two null-terminated strings. Returns 0 if equal, non-0 if not equal.
2018-12-19 18:01:53 +00:00
If any of the strings is longer than 255 bytes, then the behaviour is undefined (might even crash).
#### `void strzcopy(pointer dest, pointer src)`
Copies the source null-terminated string into the destination buffer.
If the source string is longer than 255 bytes, then the behaviour is undefined (might even crash).
#### `word strz2word(pointer str)`
Converts a null-terminated string to a number.
Sets `errno`.
2019-01-05 00:19:14 +00:00
#### `void strzappend(pointer buffer, pointer str)`
#### `void strzappendchar(pointer buffer, byte char)`
2019-06-05 09:46:06 +00:00
Modifies the given null-terminated buffer by appending a null-terminated string or a single character respectively.