cstring · Section 3
cstring_copy
NAME
cstring_copy - create an independent copy of a string
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cstring.h> cstr cstring_copy(cstr s, char **err);
DESCRIPTION
This function allocates a new cstring with the same content as s. After the call the two strings are fully independent of each other.
PARAMETERS
s String to copy err Optional pointer to receive an error string on failure
RETURN VALUE
A new cstring on success NULL when an allocation fails; the details then go to *err when err is not NULL
NOTES
You must destroy the returned cstring once you are done with it Asserts if s is NULL