C Collections

cstring · Section 3

cstr_copy

cstr_copy - create an independent copy of a string

C Collections (libccollections, -lccollections)

#include <ccollections/cstring.h>
 
cstr_copy(s, err);

This macro forwards its arguments to cstring_copy(), which allocates a
new cstring with the same content as s.

s     cstr to copy
err   Optional pointer to receive an error string on failure

New cstr on success, NULL on failure

You must destroy the cstring that this macro returns

cstring_copy(3), cstr_substring(3)