cstring · Section 3
cstring_insert
NAME
cstring_insert - insert a C string at a given position
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cstring.h> ccol_retval cstring_insert(cstr s, size_t pos, const char *str);
DESCRIPTION
This function inserts the null-terminated C string str at position pos of s, and the characters at positions >= pos move right to make room. A pos of 0 does the same as cstring_prepend(), and a pos equal to the length does the same as cstring_append().
PARAMETERS
s String to change pos Insertion position (0 ... length, inclusive) str C string to insert (must not be NULL)
RETURN VALUE
ccol_success - The insert succeeded ccol_invalid_args - str is NULL, or pos > length ccol_container_full - The result would overflow a size_t ccol_not_enough_memory - The reallocation failed
NOTES
Asserts if s is NULL