|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-1878fdfec5
|
DBMI Library (base) - value management. More...

Go to the source code of this file.
DBMI Library (base) - value management.
SPDX-FileCopyrightText: 1999-2009, 2011 GRASS Development Team SPDX-License-Identifier: GPL-2.0-or-later
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 399 of file value.c.
References DB_OK, and G_calloc.
Referenced by db_select_CatValArray(), and Vedit_bulk_labeling().
| void db_CatValArray_free | ( | dbCatValArray * | arr | ) |
Free allocated dbCatValArray.
| arr | pointer to dbCatValArray |
Definition at line 371 of file value.c.
References DB_C_TYPE_DATETIME, DB_C_TYPE_STRING, db_free(), db_free_string(), and G_free().
Referenced by IL_vector_input_data_2d(), NetA_get_node_costs(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), and Vedit_bulk_labeling().
| void db_CatValArray_init | ( | dbCatValArray * | arr | ) |
Initialize dbCatValArray.
| arr | pointer to dbCatValArray to be initialized |
Definition at line 359 of file value.c.
References NULL.
Referenced by IL_vector_input_data_2d(), NetA_get_node_costs(), Vect_net_build_graph(), and Vect_net_ttb_build_graph().
| int db_CatValArray_realloc | ( | dbCatValArray * | arr, |
| int | n | ||
| ) |
Realloc dbCatValArray.
| arr | pointer to dbCatValArray |
| n | number of items |
Copy value.
Copy value from src to destination
| dst | destination dbValue |
| src | source dbValue |
Definition at line 338 of file value.c.
References _db_date_time::current, _db_value::d, _db_date_time::day, db_copy_string(), _db_date_time::hour, _db_value::i, _db_value::isNull, _db_date_time::minute, _db_date_time::month, _db_string::nalloc, _db_value::s, _db_date_time::seconds, _db_value::t, and _db_date_time::year.
Referenced by db_copy_column(), and db_select_value().
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 63 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().
Get day value.
| value | pointer to dbValue |
Definition at line 126 of file value.c.
References _db_date_time::day, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Get double precision value.
| value | pointer to dbValue |
Definition at line 48 of file value.c.
References _db_value::d.
Referenced by db_convert_value_to_string(), db_get_value_as_double(), db_select_CatValArray(), db_select_int(), P_Aux_to_Vector(), and Vect_write_ascii().
Get hour value.
| value | pointer to dbValue |
Definition at line 138 of file value.c.
References _db_date_time::hour, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Get integer value.
| value | pointer to dbValue |
Definition at line 36 of file value.c.
References _db_value::i.
Referenced by db_convert_value_to_string(), db_get_value_as_double(), db_select_CatValArray(), db_select_int(), Gp_load_sites_thematic(), Gv_load_vect_thematic(), NetA_init_distinct(), NetA_init_timetable_from_db(), and Vect_write_ascii().
Get minute value.
| value | pointer to dbValue |
Definition at line 150 of file value.c.
References _db_date_time::minute, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Get month value.
| value | pointer to dbValue |
Definition at line 114 of file value.c.
References _db_date_time::month, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Get seconds value.
| value | pointer to dbValue |
Definition at line 162 of file value.c.
References _db_date_time::seconds, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Get string value.
| value | pointer to dbValue |
Definition at line 90 of file value.c.
References db_get_string(), and _db_value::s.
Referenced by db_convert_value_to_string(), db_get_value_as_double(), db_select_CatValArray(), db_select_int(), Gp_load_sites_thematic(), Gv_load_vect_thematic(), and Vect_write_ascii().
Get year value.
| value | pointer to dbValue |
Definition at line 102 of file value.c.
References _db_value::t, and _db_date_time::year.
Referenced by db_convert_value_datetime_into_string().
Set datetime to current.
| value | pointer to dbValue |
Definition at line 313 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().
Set value to non-current.
| value | pointer to dbValue |
Definition at line 324 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().
Set day value.
| value | pointer to dbValue |
| day | day value |
Definition at line 253 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().
Set double precision value.
| value | pointer to dbValue |
| d | double value |
Definition at line 205 of file value.c.
References _db_value::d, and db_set_value_not_null().
Referenced by db_convert_Cstring_to_value().
Set hour value.
| value | pointer to dbValue |
| hour | hour value |
Definition at line 265 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().
Set integer value.
| value | pointer to dbValue |
| i | integer value |
Definition at line 193 of file value.c.
References db_set_value_not_null(), and _db_value::i.
Referenced by db_convert_Cstring_to_value().
Set minute value.
| value | pointer to dbValue |
| minute | minute value |
Definition at line 277 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().
Set month value.
| value | pointer to dbValue |
| month | month value |
Definition at line 241 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().
Set value to not null.
| value | pointer to dbValue |
Definition at line 182 of file value.c.
References _db_value::isNull.
Referenced by db_set_value_datetime_current(), db_set_value_datetime_not_current(), db_set_value_double(), db_set_value_int(), and db_set_value_string().
Set value to null.
| value | pointer to dbValue |
Definition at line 172 of file value.c.
References _db_value::isNull.
Set seconds value.
| value | pointer to dbValue |
| seconds | seconds value |
Definition at line 289 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().
Set string value.
| value | pointer to dbValue |
| s | string value |
Definition at line 217 of file value.c.
References db_set_string(), db_set_value_not_null(), and _db_value::s.
Referenced by db_convert_Cstring_to_value().
Set year value.
| value | pointer to dbValue |
| year | year value |
Definition at line 229 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().
Check if datatime is current.
| value | pointer to dbValue |
Definition at line 303 of file value.c.
References _db_date_time::current, and _db_value::t.
Referenced by db_convert_value_datetime_into_string().
Check of value is null.
| value | pointer to dbValue |
Definition at line 24 of file value.c.
References _db_value::isNull.
Referenced by db_convert_value_to_string(), and Vect_write_ascii().