cstring · Section 3
cstring_new
NAME
cstring_new - create a string with default memory management (optimistic)
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cstring.h> cstr cstring_new(const char *initial);
DESCRIPTION
This is cstring_create_full() with the default malloc/free allocators and no error output. It is meant for call sites that treat a failed allocation as fatal and have no use for an error string.
PARAMETERS
initial Initial C string content, or NULL for an empty string
RETURN VALUE
A pointer to the new cstring on success NULL on failure, with no error detail
NOTES
The call is the same as cstring_create_full(initial, NULL, NULL). Use cstring_create() when you need an error string on failure.
SEE ALSO
cstring_create(3), cstring_create_full(3), cstring_destroy(3)