C Collections

cstring · Section 3

cstr_insert

cstr_insert - insert a C string at a position, and call ccol__fatal_err() on failure

C Collections (libccollections, -lccollections)

#include <ccollections/cstring.h>
 
cstr_insert(s, pos, str);

This macro calls cstring_insert(), and when that call gives anything
other than ccol_success it calls ccol__fatal_err().

s     cstr to change
pos   Insertion position (0 ... length, inclusive)
str   C string to insert (must not be NULL)

If you want to handle an error yourself, call cstring_insert() directly.

cstring_insert(3), cstr_append(3), cstr_prepend(3)