112#define string_append_literal(x, y) string_append_with_size(x, y, (sizeof y) - 1)
void string_clear(struct string *s)
Clears the contents of the string, making it empty.
void string_append_with_size(struct string *s, const char *following, size_t len_following)
Append a const char* to the string's content (size of following given).
void string_print(struct string *s)
Prints the string's content and internal data (pointers and sizes).
void string_append(struct string *s, const char *following)
Append a const char* to the string's content.
size_t string_len(struct string *s)
Returns the length of the string (excluding the final '\0').
int string_snprintf(struct string *s, const char *format,...)
Formats a string and stores the result in a dynamically allocated string struct.
void string_init(struct string *s)
Initializes a string structure with an empty string.
void string_deinit(struct string *s)
Frees (de-initializes) memory used by a string structure.
A dynamically allocated string structure.
Definition: string.h:15
size_t available_size
Definition: string.h:17
size_t used_size
Definition: string.h:18
char * start
Definition: string.h:16