cstring · Section 3
cstring_set
NAME
cstring_set - replace the entire content with a new C string
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cstring.h> ccol_retval cstring_set(cstr s, const char *str);
DESCRIPTION
This function throws away the current content of s and puts a copy of str in its place. It grows the buffer when it has to, but it never shrinks it.
PARAMETERS
s String to change str New content (must not be NULL)
RETURN VALUE
ccol_success - The set succeeded
ccol_invalid_args - str is NULL
ccol_container_full - str is too large to represent. No real
program gets this code, since such a str
would need the whole address space
ccol_not_enough_memory - The reallocation failed
NOTES
Asserts if s is NULL