Defines | |
#define | u_string_sprintf(s,) u_string_do_printf(s, 1, __VA_ARGS__ ) |
Set the string from sprintf-style arguments. | |
#define | u_string_aprintf(s,) u_string_do_printf(s, 0, __VA_ARGS__ ) |
Append a printf-style format string to the given string. | |
#define | u_string_ncat(s, buf, len) u_string_append(s, buf, len) |
Append at most len characterss to a string. | |
#define | u_string_cat(s, buf) u_string_append(s, buf, strlen(buf)) |
Append a char* to a string. | |
Functions | |
int | u_string_trim (u_string_t *s) |
Remove leading and trailing blanks. | |
int | u_string_set_length (u_string_t *s, size_t len) |
Set the length of a string (shortening it). | |
size_t | u_string_len (u_string_t *s) |
Return the string length. | |
const char * | u_string_c (u_string_t *s) |
Return the string value. | |
int | u_string_copy (u_string_t *dst, u_string_t *src) |
Copy the value of a string to another. | |
int | u_string_clear (u_string_t *s) |
Clear a string. | |
int | u_string_create (const char *buf, size_t len, u_string_t **ps) |
Create a new string. | |
int | u_string_free (u_string_t *s) |
Free a string. | |
int | u_string_set (u_string_t *s, const char *buf, size_t len) |
Set the value of a string. | |
int | u_string_reserve (u_string_t *s, size_t size) |
Enlarge the underlying memory block of the given buffer. | |
int | u_string_do_printf (u_string_t *s, int clear, const char *fmt,...) |
int | u_string_append (u_string_t *s, const char *buf, size_t len) |
Append a char* to a string. |
|
Append a printf-style format string to the given string.
|
|
Append a char* value to the given string.
|
|
Append a char* value to the given string.
|
|
Set a string from the sprintf-style arguments
|
|
Append a char* value to the given string.
Definition at line 307 of file str.c. References u_string_reserve(). Referenced by u_hmap_dbg(), u_hmap_pcy_dbg(), u_string_copy(), u_string_create(), and u_string_set(). |
|
Return the const char* value of the given string object. Such const char* value cannot be modified, realloc'd or free'd.
Definition at line 101 of file str.c. Referenced by u_hmap_dbg(), and u_hmap_pcy_dbg(). |
|
Totally erase the content of the given string.
Definition at line 131 of file str.c. Referenced by u_hmap_dbg(), u_hmap_pcy_dbg(), u_string_copy(), u_string_do_printf(), and u_string_set(). |
|
Copy src string to dst string.
Definition at line 116 of file str.c. References u_string_append(), and u_string_clear(). |
|
Create a new string object and save its pointer to *ps. If buf is not NULL (and len > 0) the string will be initialized with the content of buf.
Definition at line 157 of file str.c. References u_string_append(), and u_zalloc(). Referenced by u_hmap_dbg(), and u_hmap_pcy_dbg(). |
|
Release all resources and free the given string object.
Definition at line 186 of file str.c. Referenced by u_hmap_dbg(), and u_hmap_pcy_dbg(). |
|
Return the length of the given string.
Definition at line 86 of file str.c. Referenced by u_hmap_dbg(). |
|
Enlarge the buffer data block to (at least) size bytes.
Definition at line 225 of file str.c. References u_realloc(). Referenced by u_string_append(), and u_string_do_printf(). |
|
Set the value of s to buf.
Definition at line 209 of file str.c. References u_string_append(), and u_string_clear(). |
|
|
|
Remove leading and trailing blanks from the given string
Definition at line 41 of file str.c. References u_trim(). |