cstring · Section 3
cstr_init_mp
NAME
cstr_init_mp - initialise a declared cstr with custom memory management
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cstring.h> cstr_init_mp(s, initial, mprocs);
DESCRIPTION
This macro initialises the cstr variable s through cstring_create_full(), with the content and the memory management procedures you give. You must declare s first. If the creation fails, the macro calls ccol__fatal_err().
PARAMETERS
s cstr lvalue to initialise (you must declare it first); the macro
assigns it once, after the string is created
initial Initial content (C string or NULL for empty string)
mprocs Custom memory management procedures (ccol_memmgmt_procs *)
NOTES
A failed allocation ends in ccol__fatal_err()