25 #include <freetds/pushvis.h>
27 extern const struct tds_dstr tds_str_empty;
28 #define DSTR_INITIALIZER ((struct tds_dstr*) &tds_str_empty)
36 #if ENABLE_EXTRA_CHECKS
39 char *tds_dstr_buf(
DSTR * s);
40 size_t tds_dstr_len(
DSTR * s);
43 #define tds_dstr_init(s) \
44 do { *(s) = DSTR_INITIALIZER; } while(0)
47 #define tds_dstr_isempty(s) \
48 ((*(s))->dstr_size == 0)
49 #define tds_dstr_buf(s) \
51 #define tds_dstr_len(s) \
55 #define tds_dstr_cstr(s) \
56 ((const char* ) tds_dstr_buf(s))
62 #define tds_dstr_empty(s) \
65 #if ENABLE_EXTRA_CHECKS && defined(__GNUC__) && __GNUC__ >= 4
66 #define TDS_WUR __attribute__ ((__warn_unused_result__))
82 #include <freetds/popvis.h>
void tds_dstr_zero(DSTR *s)
clear all string filling with zeroes (mainly for security reason)
Definition: tdsstring.c:56
DSTR * tds_dstr_set(DSTR *s, char *src)
set a string from another buffer.
Definition: tdsstring.c:108
DSTR * tds_dstr_alloc(DSTR *s, size_t length)
allocate space for length char
Definition: tdsstring.c:160
#define tds_dstr_init(s)
init a string with empty
Definition: string.h:43
DSTR * tds_dstr_copy(DSTR *s, const char *src)
copy a string from another
Definition: tdsstring.c:123
#define tds_dstr_isempty(s)
test if string is empty
Definition: string.h:47
Structure to hold a string.
Definition: tds.h:94
void tds_dstr_free(DSTR *s)
free string
Definition: tdsstring.c:63
DSTR * tds_dstr_setlen(DSTR *s, size_t length)
limit length of string, MUST be <= current length
Definition: tdsstring.c:140
DSTR * tds_dstr_copyn(DSTR *s, const char *src, size_t length)
Set string to a given buffer of characters.
Definition: tdsstring.c:78