20#ifndef _tdsguard_d2McTbRS3vmVcq0ls4BzwH_
21#define _tdsguard_d2McTbRS3vmVcq0ls4BzwH_
23#include <freetds/macros.h>
24#include <freetds/bool.h>
26#include <freetds/pushvis.h>
50#define DSTR_INITIALIZER ((struct tds_dstr*) &tds_str_empty)
63 return (*s)->dstr_size == 0;
78static inline const char *
88 return (*s)->dstr_size;
92#define tds_dstr_empty(s) \
108#include <freetds/popvis.h>
DSTR * tds_dstr_setlen(DSTR *s, size_t length)
limit length of string, MUST be <= current length
Definition tdsstring.c:145
void tds_dstr_zero(DSTR *s)
clear all string filling with zeroes (mainly for security reason)
Definition tdsstring.c:55
static size_t tds_dstr_len(const DSTR *s)
Returns the length of the string in bytes.
Definition string.h:86
DSTR * tds_dstr_dup(DSTR *s, const DSTR *src)
Duplicate a string from another dynamic string.
Definition tdsstring.c:134
#define DSTR_INITIALIZER
Initializer, used to initialize string like in the following example.
Definition string.h:50
DSTR * tds_dstr_copyn(DSTR *s, const char *src, size_t length)
Set string to a given buffer of characters.
Definition tdsstring.c:77
const struct tds_dstr tds_str_empty
Internal representation for an empty string.
Definition tdsstring.c:45
DSTR * tds_dstr_alloc(DSTR *s, size_t length)
allocate space for length char
Definition tdsstring.c:165
static void tds_dstr_init(DSTR *s)
init a string with empty
Definition string.h:54
DSTR * tds_dstr_set(DSTR *s, char *src)
set a string from another buffer.
Definition tdsstring.c:107
static const char * tds_dstr_cstr(const DSTR *s)
Returns a C version (NUL terminated string) of dstr.
Definition string.h:79
void tds_dstr_free(DSTR *s)
free string
Definition tdsstring.c:62
DSTR * tds_dstr_copy(DSTR *s, const char *src)
copy a string from another
Definition tdsstring.c:122
static char * tds_dstr_buf(DSTR *s)
Returns a buffer to edit the string.
Definition string.h:72
static bool tds_dstr_isempty(const DSTR *s)
test if string is empty
Definition string.h:61
struct tds_dstr * DSTR
Structure to hold a string.
Structure to hold a string.
Definition string.h:37