Updated: October 28, 2024 |
Allocate a new shareable string
#include <sys/strm.h>
char* strm_string_alloc(size_t len, strm_string_t **handle)
This function allocates a new shareable string that can store len bytes, and stores a handle to this object in the variable pointed to by handle.
The caller must then write a null-terminated string into the buffer of the new shareable string before calling any of strm_string_clone(), strm_string_modify(), or strm_string_destroy(), and must not modify the buffer afterwards.
On success, a pointer to the first byte of the string buffer in the new shareable string. On failure, a null pointer.