3 #include <grass/dbmi.h>
31 static int set_string(dbString * x,
char *
s,
int copy);
35 return set_string(x, (
char *)s, 1);
46 return set_string(x, s, 0);
59 return (
unsigned int)x->nalloc;
79 static int set_string(dbString * x,
char *
s,
int copy)
113 if (x->nalloc < len) {
116 x->string =
db_realloc((
void *)x->string, len);
117 if (x->string ==
NULL)
118 return DB_MEMORY_ERR;
160 for (i = 0; i <
n; i++)
179 a = (dbString *)
db_calloc(count,
sizeof(dbString));
181 for (i = 0; i <
count; i++)
225 char *ptra, *ptrb,
buf[2];
232 while ((ptra = strchr(ptrb,
'\'')) !=
NULL) {
233 for (; ptrb <= ptra; ptrb++) {
int db_enlarge_string(dbString *x, int len)
void db_zero_string(dbString *x)
int db_set_string_no_copy(dbString *x, char *s)
int db_copy_string(dbString *dst, dbString *src)
void * db_calloc(int n, int m)
int db_append_string(dbString *x, const char *s)
void db_double_quote_string(dbString *src)
void * db_realloc(void *s, int n)
void db_free_string_array(dbString *a, int n)
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
dbString * db_alloc_string_array(int count)
char * db_get_string(dbString *x)
void db_zero(void *s, int n)
int db_set_string(dbString *x, const char *s)
char * db_store(const char *s)
void db_free_string(dbString *x)
unsigned int db_sizeof_string(dbString *x)
void db_init_string(dbString *x)