2 #include <grass/dbmi.h>
12 return (value->isNull != 0);
52 case (DB_C_TYPE_STRING):
55 case (DB_C_TYPE_DOUBLE):
83 return (value->t.year);
94 return (value->t.month);
105 return (value->t.day);
116 return (value->t.hour);
127 return (value->t.minute);
138 return (value->t.seconds);
207 value->t.year = year;
219 value->t.month = month;
243 value->t.hour = hour;
255 value->t.minute = minute;
267 value->t.seconds = seconds;
279 return (value->t.current != 0);
290 value->t.current = 1;
302 value->t.current = 0;
315 dst->isNull = src->isNull;
318 if (src->s.nalloc > 0)
320 dst->t.current = src->t.current;
321 dst->t.year = src->t.year;
322 dst->t.month = src->t.month;
323 dst->t.day = src->t.day;
324 dst->t.hour = src->t.hour;
325 dst->t.minute = src->t.minute;
326 dst->t.seconds = src->t.seconds;
350 if (arr->ctype == DB_C_TYPE_STRING || arr->ctype == DB_C_TYPE_DATETIME) {
353 for (i = 0; i < arr->n_values; i++) {
354 if (arr->ctype == DB_C_TYPE_STRING && arr->value[i].val.s) {
357 if (arr->ctype == DB_C_TYPE_DATETIME && arr->value[i].val.t) {
374 arr->value = (dbCatVal *) G_calloc(n,
sizeof(dbCatVal));
389 arr->value = (dbCatVal *) G_realloc(arr->value, n *
sizeof(dbCatVal));
int db_test_value_isnull(dbValue *value)
int db_CatValArray_realloc(dbCatValArray *arr, int n)
void G_free(void *buf)
Free allocated memory.
void db_set_value_year(dbValue *value, int year)
int db_get_value_day(dbValue *value)
void db_set_value_int(dbValue *value, int i)
int db_get_value_month(dbValue *value)
void db_set_value_null(dbValue *value)
void db_set_value_month(dbValue *value, int month)
int db_test_value_datetime_current(dbValue *value)
int db_copy_string(dbString *dst, dbString *src)
int db_get_value_minute(dbValue *value)
void db_set_value_seconds(dbValue *value, double seconds)
void db_CatValArray_free(dbCatValArray *arr)
int db_CatValArray_alloc(dbCatValArray *arr, int n)
void db_set_value_double(dbValue *value, double d)
void db_set_value_day(dbValue *value, int day)
double db_get_value_double(dbValue *value)
double db_get_value_seconds(dbValue *value)
void db_set_value_minute(dbValue *value, int minute)
void db_set_value_not_null(dbValue *value)
void db_set_value_datetime_not_current(dbValue *value)
int db_get_value_hour(dbValue *value)
void db_CatValArray_init(dbCatValArray *arr)
int db_get_value_year(dbValue *value)
char * db_get_string(dbString *x)
int db_set_value_string(dbValue *value, const char *s)
int db_set_string(dbString *x, const char *s)
int db_get_value_int(dbValue *value)
double db_get_value_as_double(dbValue *value, int ctype)
void db_free_string(dbString *x)
void db_set_value_hour(dbValue *value, int hour)
void db_set_value_datetime_current(dbValue *value)
const char * db_get_value_string(dbValue *value)
void db_copy_value(dbValue *dst, dbValue *src)