|
Gama C Library
Gama C API Documentation
|
Defines a dynamic string structure and provides utility functions for its manipulation. More...
Go to the source code of this file.
Data Structures | |
| struct | gmStr |
| Represents a dynamic, heap-allocated string. More... | |
Functions | |
| gmStr | gm_str () |
| Initializes an empty gmStr struct. | |
| int | gm_str_appendn (gmStr *s, size_t n, const char *txt) |
| Appends a specified number of characters from a C string to a gmStr. | |
| void | gm_str_clear (gmStr *str) |
| Frees the heap-allocated content of a gmStr and resets its length to 0. | |
Defines a dynamic string structure and provides utility functions for its manipulation.
This file offers a simple dynamic string (gmStr) implementation that can grow as needed, making it suitable for building strings without fixed-size buffer limitations.
| gmStr gm_str | ( | ) |
| int gm_str_appendn | ( | gmStr * | s, |
| size_t | n, | ||
| const char * | txt ) |
Appends a specified number of characters from a C string to a gmStr.
This function reallocates memory for the gmStr's content if necessary to accommodate the new characters.
| s | A pointer to the gmStr to append to. |
| n | The number of characters from txt to append. |
| txt | The null-terminated C string to append. |