C Collections

cstring · Section 3

cstring_reset

cstring_reset - clear all characters and shrink capacity to minimum

C Collections (libccollections, -lccollections)

#include <ccollections/cstring.h>
 
void cstring_reset(cstr s);

This function sets the length to zero and then tries to shrink the buffer
back to the minimum capacity of 16 bytes. If that reallocation fails the
capacity stays as it was, but the length becomes zero either way.

s   String to reset

Asserts if s is NULL

cstring_set(3), cstring_is_empty(3)