25 #if defined(__GNUC__) && __GNUC__ >= 4 26 #pragma GCC visibility push(hidden) 29 extern const char tds_str_empty[1];
37 #if ENABLE_EXTRA_CHECKS 40 char *tds_dstr_buf(
DSTR * s);
41 size_t tds_dstr_len(
DSTR * s);
44 #define tds_dstr_init(s) \ 45 do { DSTR *_tds_s = (s); _tds_s->dstr_size = 0; _tds_s->dstr_s = (char*) tds_str_empty; } while(0) 48 #define tds_dstr_isempty(s) \ 50 #define tds_dstr_buf(s) \ 52 #define tds_dstr_len(s) \ 56 #define tds_dstr_cstr(s) \ 57 ((const char* ) tds_dstr_buf(s)) 74 #if defined(__GNUC__) && __GNUC__ >= 4 75 #pragma GCC visibility pop DSTR * tds_dstr_setlen(DSTR *s, unsigned int length)
limit length of string, MUST be <= current length
Definition: tdsstring.c:154
#define tds_dstr_init(s)
init a string with empty
Definition: tdsstring.h:44
DSTR * tds_dstr_copyn(DSTR *s, const char *src, unsigned int length)
Set string to a given buffer of characters.
Definition: tdsstring.c:86
void tds_dstr_free(DSTR *s)
free string
Definition: tdsstring.c:70
DSTR * tds_dstr_copy(DSTR *s, const char *src)
copy a string from another
Definition: tdsstring.c:137
DSTR * tds_dstr_set(DSTR *s, char *src)
set a string from another buffer.
Definition: tdsstring.c:116
#define tds_dstr_isempty(s)
test if string is empty
Definition: tdsstring.h:48
void tds_dstr_zero(DSTR *s)
clear all string filling with zeroes (mainly for security reason)
Definition: tdsstring.c:63
DSTR * tds_dstr_alloc(DSTR *s, unsigned int length)
allocate space for length char
Definition: tdsstring.c:174