00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _tdsstring_h_
00021 #define _tdsstring_h_
00022
00023 static char rcsid_tdsstring_h[] = "$Id: tdsstring.h,v 1.10 2003/12/09 10:19:16 freddy77 Exp $";
00024 static void *no_unused_tdsstring_h_warn[] = { rcsid_tdsstring_h, no_unused_tdsstring_h_warn };
00025
00026 extern char tds_str_empty[];
00027
00028
00029
00034 #if ENABLE_EXTRA_CHECKS
00035 void tds_dstr_init(DSTR * s);
00036 int tds_dstr_isempty(DSTR * s);
00037 char *tds_dstr_cstr(DSTR * s);
00038 size_t tds_dstr_len(DSTR * s);
00039 #else
00040
00041 #define tds_dstr_init(s) \
00042 { *s = (DSTR) &tds_str_empty[0]; }
00043
00045 #define tds_dstr_isempty(s) \
00046 (**((char**)s) == '\0')
00047 #define tds_dstr_cstr(s) \
00048 (*(char**)s)
00049 #define tds_dstr_len(s) \
00050 strlen(*(char**)s)
00051 #endif
00052
00053 void tds_dstr_zero(DSTR * s);
00054 void tds_dstr_free(DSTR * s);
00055
00056 DSTR tds_dstr_copy(DSTR * s, const char *src);
00057 DSTR tds_dstr_copyn(DSTR * s, const char *src, unsigned int length);
00058 DSTR tds_dstr_set(DSTR * s, char *src);
00059
00062 #endif