26 if (not string_reserve(self, 1))
33bool string_reserve(
string_t* self,
size_t count)
51bool string_contains(
const string_t* self,
char character)
55 return memchr(self->
start, character, self->
count);
59bool is_char_in_cstring(
char character,
const char* cstring)
61 return strchr(cstring, character);
bool array_trim(array_t *self)
Resizes the underlying storage to fit exactly the current elements count.
bool array_reserve(array_t *self, size_t count)
Ensures the array has enough capacity to fit count new elements, reallocating if needed.
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.