squareball
0.2.0.43-8b14
A general-purpose library for C99
|
String object that grows automatically, as required by the content added to it. More...
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
Go to the source code of this file.
Data Structures | |
struct | sb_string_t |
Functions | |
sb_string_t * | sb_string_new (void) |
char * | sb_string_free (sb_string_t *str, bool free_str) |
sb_string_t * | sb_string_dup (sb_string_t *str) |
sb_string_t * | sb_string_append_len (sb_string_t *str, const char *suffix, size_t len) |
sb_string_t * | sb_string_append (sb_string_t *str, const char *suffix) |
sb_string_t * | sb_string_append_c (sb_string_t *str, char c) |
sb_string_t * | sb_string_append_printf (sb_string_t *str, const char *format,...) |
sb_string_t * | sb_string_append_escaped (sb_string_t *str, const char *suffix) |
String object that grows automatically, as required by the content added to it.
sb_string_t* sb_string_append | ( | sb_string_t * | str, |
const char * | suffix | ||
) |
Function that appends a nul-terminated suffix
to the string object.
str | The string object. |
suffix | The nul-terminated suffix to append to the string object. |
sb_string_t* sb_string_append_c | ( | sb_string_t * | str, |
char | c | ||
) |
Function that appends a character to the string object.
str | The string object. |
c | The character to append to the string object. |
sb_string_t* sb_string_append_escaped | ( | sb_string_t * | str, |
const char * | suffix | ||
) |
Function that appends a nul-terminated suffix
to string object, escaping the suffix before appending.
str | The string object. |
suffix | The nul-terminated suffix to append to the string object. |
sb_string_t* sb_string_append_len | ( | sb_string_t * | str, |
const char * | suffix, | ||
size_t | len | ||
) |
Function that appends len
bytes from suffix
to the string object.
str | The string object. |
suffix | The suffix to append to the string object. |
len | The number of bytes from suffix to append to the string object. |
sb_string_t* sb_string_append_printf | ( | sb_string_t * | str, |
const char * | format, | ||
... | |||
) |
Function that appends to an string object with a printf(3)-like interface.
str | The string object. |
format | A printf(3) format. |
... | One or more printf(3)-like parameters. |
sb_string_t* sb_string_dup | ( | sb_string_t * | str | ) |
Function that duplicates a string object.
str | The string object. |
str
. char* sb_string_free | ( | sb_string_t * | str, |
bool | free_str | ||
) |
Function that frees memory allocated for a string object. If free_str
is false
, it will only free the memory allocated for the object, and return the string stored on it.
str | The string object. |
free_str | Boolean that indicates if the memory allocated to internal string should be free'd. |
free_str
is false
, or NULL. sb_string_t* sb_string_new | ( | void | ) |