21bool string_append_char(
string_t* self,
char character)
27bool string_append_cstring(
string_t* self,
const char* cstring,
size_t length)
39bool string_append_format(
string_t* self,
const char* format, ...)
44 va_start(args1, format);
45 va_copy(args2, args1);
46 length = vsnprintf(NULL, 0, format, args1);
50 string_reserve(self, length + 1);
51 self->
count += vsnprintf(
array_end(self), length + 1, format, args2);
void * array_end(const array_t *self)
One-past-the-end pointer of the array.
bool array_push_back_n(array_t *self, const void *elements, size_t count)
Adds count elements at the end of the array.
bool array_push_back(array_t *self, const void *element)
Adds one element at the end of the array.
Dynamic string implementation.
array_t string_t
A string is an array of char.
void * start
Underlying storage.
size_t count
Number of elements currently stored.