dynamic_string.h v0.2.2
A modern, efficient, single-file string library for C
|
Basic string creation, retention, and release functions. More...
Functions | |
DS_DEF ds_string | ds_new (const char *text) |
Create a new string from a C string. | |
DS_DEF ds_string | ds_create_length (const char *text, size_t length) |
Create a string from a buffer with explicit length. | |
DS_DEF ds_string | ds_retain (ds_string str) |
Increment reference count and return shared handle. | |
DS_DEF void | ds_release (ds_string *str) |
Decrement reference count and free memory if last reference. | |
Basic string creation, retention, and release functions.
Create a string from a buffer with explicit length.
text | Source buffer (may contain embedded nulls) |
length | Number of bytes to copy from buffer |
Create a new string from a C string.
text | Null-terminated C string to copy (must not be NULL) |
Decrement reference count and free memory if last reference.
str | Pointer to string handle to release (may be NULL) |