GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
DBMI Library (base) - value management. More...
Go to the source code of this file.
Functions | |
int | db_test_value_isnull (dbValue *value) |
Check of value is null. More... | |
int | db_get_value_int (dbValue *value) |
Get integer value. More... | |
double | db_get_value_double (dbValue *value) |
Get double precision value. More... | |
double | db_get_value_as_double (dbValue *value, int ctype) |
Get value as double. More... | |
const char * | db_get_value_string (dbValue *value) |
Get string value. More... | |
int | db_get_value_year (dbValue *value) |
Get year value. More... | |
int | db_get_value_month (dbValue *value) |
Get month value. More... | |
int | db_get_value_day (dbValue *value) |
Get day value. More... | |
int | db_get_value_hour (dbValue *value) |
Get hour value. More... | |
int | db_get_value_minute (dbValue *value) |
Get minute value. More... | |
double | db_get_value_seconds (dbValue *value) |
Get seconds value. More... | |
void | db_set_value_null (dbValue *value) |
Set value to null. More... | |
void | db_set_value_not_null (dbValue *value) |
Set value to not null. More... | |
void | db_set_value_int (dbValue *value, int i) |
Set integer value. More... | |
void | db_set_value_double (dbValue *value, double d) |
Set double precision value. More... | |
int | db_set_value_string (dbValue *value, const char *s) |
Set string value. More... | |
void | db_set_value_year (dbValue *value, int year) |
Set year value. More... | |
void | db_set_value_month (dbValue *value, int month) |
Set month value. More... | |
void | db_set_value_day (dbValue *value, int day) |
Set day value. More... | |
void | db_set_value_hour (dbValue *value, int hour) |
Set hour value. More... | |
void | db_set_value_minute (dbValue *value, int minute) |
Set minute value. More... | |
void | db_set_value_seconds (dbValue *value, double seconds) |
Set seconds value. More... | |
int | db_test_value_datetime_current (dbValue *value) |
Check if datatime is current. More... | |
void | db_set_value_datetime_current (dbValue *value) |
Set datetime to current. More... | |
void | db_set_value_datetime_not_current (dbValue *value) |
Set value to non-current. More... | |
void | db_copy_value (dbValue *dst, dbValue *src) |
Copy value. More... | |
void | db_CatValArray_init (dbCatValArray *arr) |
Initialize dbCatValArray. More... | |
void | db_CatValArray_free (dbCatValArray *arr) |
Free allocated dbCatValArray. More... | |
int | db_CatValArray_alloc (dbCatValArray *arr, int n) |
Allocate dbCatValArray. More... | |
int | db_CatValArray_realloc (dbCatValArray *arr, int n) |
Realloc dbCatValArray. More... | |
DBMI Library (base) - value management.
(C) 1999-2009, 2011 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file value.c.
int db_CatValArray_alloc | ( | dbCatValArray * | arr, |
int | n | ||
) |
Allocate dbCatValArray.
arr | pointer to dbCatValArray |
n | number of items |
Definition at line 401 of file value.c.
References dbCatValArray::alloc, DB_OK, G_calloc, and dbCatValArray::value.
void db_CatValArray_free | ( | dbCatValArray * | arr | ) |
Free allocated dbCatValArray.
arr | pointer to dbCatValArray |
Definition at line 373 of file value.c.
References dbCatValArray::ctype, DB_C_TYPE_DATETIME, DB_C_TYPE_STRING, db_free(), db_free_string(), G_free(), dbCatValArray::n_values, dbCatVal::s, dbCatVal::t, dbCatVal::val, and dbCatValArray::value.
void db_CatValArray_init | ( | dbCatValArray * | arr | ) |
Initialize dbCatValArray.
arr | pointer to dbCatValArray to be initialized |
Definition at line 361 of file value.c.
References dbCatValArray::alloc, dbCatValArray::n_values, NULL, and dbCatValArray::value.
int db_CatValArray_realloc | ( | dbCatValArray * | arr, |
int | n | ||
) |
Realloc dbCatValArray.
arr | pointer to dbCatValArray |
n | number of items |
Definition at line 420 of file value.c.
References dbCatValArray::alloc, DB_OK, G_realloc, and dbCatValArray::value.
Copy value.
Copy value from src to destination
dst | destination dbValue |
src | source dbValue |
Definition at line 340 of file value.c.
References db_copy_string(), dst, and src.
Referenced by db_copy_column().
double db_get_value_as_double | ( | dbValue * | value, |
int | ctype | ||
) |
Get value as double.
For given value and C type of value returns double representation.
value | pointer to dbValue |
ctype | C data type |
Definition at line 65 of file value.c.
References DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_get_value_double(), db_get_value_int(), and db_get_value_string().
int db_get_value_day | ( | dbValue * | value | ) |
Get day value.
value | pointer to dbValue |
Definition at line 128 of file value.c.
References _db_date_time::day, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
double db_get_value_double | ( | dbValue * | value | ) |
Get double precision value.
value | pointer to dbValue |
Definition at line 50 of file value.c.
References _db_value::d.
Referenced by db_convert_value_to_string(), and db_get_value_as_double().
int db_get_value_hour | ( | dbValue * | value | ) |
Get hour value.
value | pointer to dbValue |
Definition at line 140 of file value.c.
References _db_date_time::hour, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
int db_get_value_int | ( | dbValue * | value | ) |
Get integer value.
value | pointer to dbValue |
Definition at line 38 of file value.c.
References _db_value::i.
Referenced by db_convert_value_to_string(), and db_get_value_as_double().
int db_get_value_minute | ( | dbValue * | value | ) |
Get minute value.
value | pointer to dbValue |
Definition at line 152 of file value.c.
References _db_date_time::minute, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
int db_get_value_month | ( | dbValue * | value | ) |
Get month value.
value | pointer to dbValue |
Definition at line 116 of file value.c.
References _db_date_time::month, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
double db_get_value_seconds | ( | dbValue * | value | ) |
Get seconds value.
value | pointer to dbValue |
Definition at line 164 of file value.c.
References _db_date_time::seconds, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
const char* db_get_value_string | ( | dbValue * | value | ) |
Get string value.
value | pointer to dbValue |
Definition at line 92 of file value.c.
References db_get_string(), and _db_value::s.
Referenced by db_convert_value_to_string(), and db_get_value_as_double().
int db_get_value_year | ( | dbValue * | value | ) |
Get year value.
value | pointer to dbValue |
Definition at line 104 of file value.c.
References _db_value::t, and _db_date_time::year.
Referenced by db_convert_value_datetime_into_string().
void db_set_value_datetime_current | ( | dbValue * | value | ) |
Set datetime to current.
value | pointer to dbValue |
Definition at line 315 of file value.c.
References _db_date_time::current, db_set_value_not_null(), and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
void db_set_value_datetime_not_current | ( | dbValue * | value | ) |
Set value to non-current.
value | pointer to dbValue |
Definition at line 326 of file value.c.
References _db_date_time::current, db_set_value_not_null(), and _db_value::t.
Referenced by db_set_value_day(), db_set_value_hour(), db_set_value_minute(), db_set_value_month(), db_set_value_seconds(), and db_set_value_year().
void db_set_value_day | ( | dbValue * | value, |
int | day | ||
) |
Set day value.
value | pointer to dbValue |
day | day value |
Definition at line 255 of file value.c.
References _db_date_time::day, db_set_value_datetime_not_current(), and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
void db_set_value_double | ( | dbValue * | value, |
double | d | ||
) |
void db_set_value_hour | ( | dbValue * | value, |
int | hour | ||
) |
Set hour value.
value | pointer to dbValue |
hour | hour value |
Definition at line 267 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::hour, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
void db_set_value_int | ( | dbValue * | value, |
int | i | ||
) |
Set integer value.
value | pointer to dbValue |
i | integer value |
Definition at line 195 of file value.c.
References db_set_value_not_null(), and _db_value::i.
void db_set_value_minute | ( | dbValue * | value, |
int | minute | ||
) |
Set minute value.
value | pointer to dbValue |
minute | minute value |
Definition at line 279 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::minute, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
void db_set_value_month | ( | dbValue * | value, |
int | month | ||
) |
Set month value.
value | pointer to dbValue |
month | month value |
Definition at line 243 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::month, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
void db_set_value_not_null | ( | dbValue * | value | ) |
Set value to not null.
value | pointer to dbValue |
Definition at line 184 of file value.c.
References _db_value::isNull.
Referenced by db_set_value_datetime_current(), db_set_value_datetime_not_current(), and db_set_value_int().
void db_set_value_null | ( | dbValue * | value | ) |
Set value to null.
value | pointer to dbValue |
Definition at line 174 of file value.c.
References _db_value::isNull.
void db_set_value_seconds | ( | dbValue * | value, |
double | seconds | ||
) |
Set seconds value.
value | pointer to dbValue |
seconds | seconds value |
Definition at line 291 of file value.c.
References db_set_value_datetime_not_current(), _db_date_time::seconds, and _db_value::t.
Referenced by db_convert_Cstring_to_value_datetime().
int db_set_value_string | ( | dbValue * | value, |
const char * | s | ||
) |
void db_set_value_year | ( | dbValue * | value, |
int | year | ||
) |
Set year value.
value | pointer to dbValue |
year | year value |
Definition at line 231 of file value.c.
References db_set_value_datetime_not_current(), _db_value::t, and _db_date_time::year.
Referenced by db_convert_Cstring_to_value_datetime().
int db_test_value_datetime_current | ( | dbValue * | value | ) |
Check if datatime is current.
value | pointer to dbValue |
Definition at line 305 of file value.c.
References _db_date_time::current, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
int db_test_value_isnull | ( | dbValue * | value | ) |
Check of value is null.
value | pointer to dbValue |
Definition at line 26 of file value.c.
References _db_value::isNull.
Referenced by db_convert_value_to_string().