Defines | |
#define | tds_dstr_cstr(s) ((*(s))->dstr_s) |
#define | tds_dstr_init(s) do { *(s) = (DSTR) &tds_str_empty; } while(0) |
init a string with empty | |
#define | tds_dstr_isempty(s) ((*(s))->dstr_s[0] == '\0') |
test if string is empty | |
#define | tds_dstr_len(s) strlen((*(s))->dstr_s) |
Functions | |
DSTR | tds_dstr_copy (DSTR *s, const char *src) |
copy a string from another | |
DSTR | tds_dstr_copyn (DSTR *s, const char *src, unsigned int length) |
Set string to a given buffer of characters. | |
void | tds_dstr_free (DSTR *s) |
free string | |
DSTR | tds_dstr_set (DSTR *s, char *src) |
set a string from another buffer. | |
void | tds_dstr_zero (DSTR *s) |
clear all string filling with zeroes (mainly for security reason) |
In this string are always valid (you don't have NULL pointer, only empty string)
|
copy a string from another
|
|
Set string to a given buffer of characters.
|
|
set a string from another buffer. The string will use the supplied buffer (it not copy the string), so it should be a pointer returned by malloc.
|