GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
defs/dbmi.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void db_Cstring_to_lowercase (char *)
 Convert string to lowercase. More...
 
void db_Cstring_to_uppercase (char *)
 Convert string to lowercase. More...
 
int db_add_column (dbDriver *, dbString *, dbColumn *)
 Add column to table. More...
 
void db__add_cursor_to_driver_state (dbCursor *)
 Add cursor do driver state. More...
 
int db_alloc_cursor_column_flags (dbCursor *)
 Allocate columns' flags for cursor. More...
 
int db_alloc_cursor_table (dbCursor *, int)
 Allocate table for cursor. More...
 
int db_append_table_column (dbTable *, dbColumn *)
 Append a specific column to given table. More...
 
dbDirentdb_alloc_dirent_array (int)
 Allocate dirent array. More...
 
dbHandledb_alloc_handle_array (int)
 Allocate array of handles. More...
 
dbIndexdb_alloc_index_array (int)
 Allocate index array. More...
 
int db_alloc_index_columns (dbIndex *, int)
 Allocate index columns. More...
 
dbStringdb_alloc_string_array (int)
 Allocate dbString array. More...
 
dbTabledb_alloc_table (int)
 Allocate a table with a specific number of columns. More...
 
int db_append_string (dbString *, const char *)
 Append string to dbString. More...
 
void db_auto_print_errors (int)
 Toggles printing of DBMI error messages. More...
 
void db_auto_print_protocol_errors (int)
 Set auto print protocol error. More...
 
int db_bind_update (dbCursor *)
 ? More...
 
void * db_calloc (int, int)
 Allocate memory. More...
 
int db_CatValArray_alloc (dbCatValArray *, int)
 Allocate dbCatValArray. More...
 
int db_CatValArray_realloc (dbCatValArray *, int)
 Realloc dbCatValArray. More...
 
void db_CatValArray_free (dbCatValArray *)
 Free allocated dbCatValArray. More...
 
void db_CatValArray_init (dbCatValArray *)
 Initialize dbCatValArray. More...
 
void db_CatValArray_sort (dbCatValArray *)
 Sort key/value array by key. More...
 
int db_CatValArray_sort_by_value (dbCatValArray *)
 Sort key/value array by value. More...
 
int db_CatValArray_get_value (dbCatValArray *, int, dbCatVal **)
 Find value by key. More...
 
int db_CatValArray_get_value_int (dbCatValArray *, int, int *)
 Find value (integer) by key. More...
 
int db_CatValArray_get_value_double (dbCatValArray *, int, double *)
 Find value (double) by key. More...
 
void db_char_to_lowercase (char *)
 Convert character to lowercase. More...
 
void db_char_to_uppercase (char *)
 Convert character to uppercase. More...
 
void db_clear_error (void)
 Clear error status. More...
 
dbTabledb_clone_table (dbTable *)
 Make a new exact copy of an existing table. More...
 
void db__close_all_cursors (void)
 Close all cursors. More...
 
int db_close_cursor (dbCursor *)
 Close cursor. More...
 
int db_close_database (dbDriver *)
 Close database connection. More...
 
int db_close_database_shutdown_driver (dbDriver *)
 Close driver/database connection. More...
 
int db_column_sqltype (dbDriver *, const char *, const char *)
 Get column sqltype. More...
 
int db_column_Ctype (dbDriver *, const char *, const char *)
 Get column ctype. More...
 
int db_convert_Cstring_to_column_default_value (const char *, dbColumn *)
 ? More...
 
int db_convert_Cstring_to_column_value (const char *, dbColumn *)
 ? More...
 
int db_convert_Cstring_to_value (const char *, int, dbValue *)
 Convert string to value. More...
 
int db_convert_Cstring_to_value_datetime (const char *, int, dbValue *)
 Convert datetime string to value. More...
 
int db_convert_column_default_value_to_string (dbColumn *, dbString *)
 ? More...
 
int db_convert_column_value_to_string (dbColumn *, dbString *)
 ? More...
 
int db_convert_value_datetime_into_string (dbValue *, int, dbString *)
 Convert datetime value into string. More...
 
int db_convert_value_to_string (dbValue *, int, dbString *)
 Convert value to string. More...
 
dbColumndb_copy_column (dbColumn *, dbColumn *)
 Copy a db column from source to destination. More...
 
void db_copy_dbmscap_entry (dbDbmscap *, dbDbmscap *)
 Copy dbmscap entry. More...
 
int db_copy_string (dbString *, const dbString *)
 Copy dbString. More...
 
int db_table_to_sql (dbTable *, dbString *)
 Create SQL CREATE sring from table definition. More...
 
int db_copy_table (const char *, const char *, const char *, const char *, const char *, const char *)
 Copy a table. More...
 
int db_copy_table_where (const char *, const char *, const char *, const char *, const char *, const char *, const char *)
 Copy a table (by where statement) More...
 
int db_copy_table_select (const char *, const char *, const char *, const char *, const char *, const char *, const char *)
 Copy a table (by select statement) More...
 
int db_copy_table_by_ints (const char *, const char *, const char *, const char *, const char *, const char *, const char *, int *, int)
 Copy a table (by keys) More...
 
void db_copy_value (dbValue *, dbValue *)
 Copy value. More...
 
int db_create_database (dbDriver *, dbHandle *)
 Create database. More...
 
int db_create_index (dbDriver *, dbIndex *)
 Create index. More...
 
int db_create_index2 (dbDriver *, const char *, const char *)
 Create unique index. More...
 
int db_create_table (dbDriver *, dbTable *)
 Create table. More...
 
int db_d_add_column (void)
 Add column to table. More...
 
int db_d_bind_update (void)
 ADD. More...
 
const char * db_dbmscap_filename (void)
 Get dbmscap file name. More...
 
int db_d_close_cursor (void)
 Close cursor. More...
 
int db_d_close_database (void)
 Close database connection. More...
 
int db_d_create_database (void)
 Create database. More...
 
int db_d_create_index (void)
 Create index. More...
 
int db_d_create_table (void)
 Create table. More...
 
int db_d_delete (void)
 Delete record (?) More...
 
int db_d_delete_database (void)
 Delete database. More...
 
int db_d_describe_table (void)
 Describe table. More...
 
int db_d_drop_column (void)
 Drop column. More...
 
int db_d_drop_index (void)
 Drop index. More...
 
int db_d_drop_table (void)
 Drop table. More...
 
void db_debug (const char *)
 Print debug message. More...
 
void db_debug_off (void)
 Turn off debugging. More...
 
void db_debug_on (void)
 Turn on debugging. More...
 
int db_delete (dbCursor *)
 Delete record (?) More...
 
int db_delete_database (dbDriver *, dbHandle *)
 Delete database. More...
 
int db_delete_table (const char *, const char *, const char *)
 Delete table. More...
 
int db_describe_table (dbDriver *, dbString *, dbTable **)
 Describe table. More...
 
int db_d_execute_immediate (void)
 Execute SQL statements. More...
 
int db_d_begin_transaction (void)
 Begin transaction. More...
 
int db_d_commit_transaction (void)
 Commit transaction. More...
 
int db_d_fetch (void)
 Fetch data. More...
 
int db_d_find_database (void)
 Find database. More...
 
int db_d_get_num_rows (void)
 Get number of selected rows. More...
 
int db_d_grant_on_table (void)
 Grant privileges on table. More...
 
int db_d_insert (void)
 Insert new record into table. More...
 
void db_d_init_error (const char *)
 Init error message for DB driver. More...
 
void db_d_append_error (const char *,...) __attribute__((format(printf
 
void void db_d_report_error (void)
 Report error message for DB driver. More...
 
dbDirentdb_dirent (const char *, int *)
 Read directory and build an array of dbDirent's. More...
 
int db_d_list_databases (void)
 List databases. More...
 
int db_d_list_indexes (void)
 List indexes. More...
 
int db_d_list_tables (void)
 List available tables for given connection. More...
 
int db_d_open_database (void)
 Open database connection. More...
 
int db_d_open_insert_cursor (void)
 Open insert cursor. More...
 
int db_d_open_select_cursor (void)
 Open select cursor. More...
 
int db_d_open_update_cursor (void)
 Open update cursor. More...
 
void db_double_quote_string (dbString *)
 Replace each ' is replaced by ''. More...
 
int db_driver (int, char **)
 
int db_driver_mkdir (const char *, int, int)
 Create db directory. More...
 
int db_drop_column (dbDriver *, dbString *, dbString *)
 Drop column. More...
 
void db__drop_cursor_from_driver_state (dbCursor *)
 Drop cursor from driver state. More...
 
int db_drop_index (dbDriver *, dbString *)
 Drop index. More...
 
int db_drop_table (dbDriver *, dbString *)
 Drop table. More...
 
void db_drop_token (dbToken)
 Drop token. More...
 
int db_d_update (void)
 ? More...
 
int db_d_version (void)
 Get version info. More...
 
int db_enlarge_string (dbString *, int)
 Enlarge dbString. More...
 
void db_error (const char *)
 Report error message. More...
 
int db_execute_immediate (dbDriver *, dbString *)
 Execute SQL statements. More...
 
int db_begin_transaction (dbDriver *)
 Begin transaction. More...
 
int db_commit_transaction (dbDriver *)
 Commit transaction. More...
 
int db_fetch (dbCursor *, int, int *)
 Fetch data from open cursor. More...
 
int db_find_database (dbDriver *, dbHandle *, int *)
 Find database. More...
 
dbAddress db_find_token (dbToken)
 Find token. More...
 
void db_free (void *)
 Free allocated memory. More...
 
void db_free_column (dbColumn *)
 Frees column structure. More...
 
void db_free_cursor (dbCursor *)
 Free allocated dbCursor. More...
 
void db_free_cursor_column_flags (dbCursor *)
 Free columns' flags of cursor. More...
 
void db_free_dbmscap (dbDbmscap *)
 Free dbmscap. More...
 
void db_free_dirent_array (dbDirent *, int)
 Free dbDirent. More...
 
void db_free_handle (dbHandle *)
 Free dbHandle structure. More...
 
void db_free_handle_array (dbHandle *, int)
 Free array of handles. More...
 
void db_free_index (dbIndex *)
 Free allocated dbIndex. More...
 
void db_free_index_array (dbIndex *, int)
 Free index array. More...
 
void db_free_string (dbString *)
 Free allocated space for dbString. More...
 
void db_free_string_array (dbString *, int)
 Free allocated dbString array. More...
 
void db_free_table (dbTable *)
 Free the table. More...
 
int db_get_column (dbDriver *, const char *, const char *, dbColumn **)
 Get column structure by table and column name. More...
 
dbValuedb_get_column_default_value (dbColumn *)
 Returns column default value for given column structure. More...
 
const char * db_get_column_description (dbColumn *)
 Returns column description for given column. More...
 
int db_get_column_host_type (dbColumn *)
 Get column host type. More...
 
int db_get_column_length (dbColumn *)
 Get column's length. More...
 
const char * db_get_column_name (dbColumn *)
 Returns column name for given column. More...
 
int db_get_column_precision (dbColumn *)
 Get column precision. More...
 
int db_get_column_scale (dbColumn *)
 Get column scale. More...
 
int db_get_column_select_priv (dbColumn *)
 Get select privileges. More...
 
int db_get_column_sqltype (dbColumn *)
 Returns column sqltype for column. More...
 
int db_get_column_update_priv (dbColumn *)
 Get update privileges. More...
 
dbValuedb_get_column_value (dbColumn *)
 Returns column value for given column structure. More...
 
int db_get_connection (dbConnection *)
 Get default DB connection settings for the current mapset. More...
 
int db_get_cursor_number_of_columns (dbCursor *)
 Get number of columns. More...
 
dbTabledb_get_cursor_table (dbCursor *)
 Get table allocated by cursor. More...
 
dbToken db_get_cursor_token (dbCursor *)
 Get cursor token. More...
 
const char * db_get_default_driver_name (void)
 Get driver name from current DB connection settings. More...
 
const char * db_get_default_database_name (void)
 Get database name from current DB connection settings. More...
 
const char * db_get_default_schema_name (void)
 Get schema name from current DB connection settings. More...
 
const char * db_get_default_group_name (void)
 Get group name from current DB connection settings. More...
 
dbDriverStatedb__get_driver_state (void)
 Get driver state. More...
 
int db_get_error_code (void)
 Get error code. More...
 
const char * db_get_error_msg (void)
 Get error message. More...
 
const char * db_get_error_who (void)
 
const char * db_get_handle_dbname (dbHandle *)
 Get handle database name. More...
 
const char * db_get_handle_dbschema (dbHandle *)
 Get handle schema name. More...
 
const char * db_get_index_column_name (dbIndex *, int)
 Get column number. More...
 
const char * db_get_index_name (dbIndex *)
 Get index name. More...
 
int db_get_index_number_of_columns (dbIndex *)
 Get number of columns. More...
 
const char * db_get_index_table_name (dbIndex *)
 Get table name. More...
 
int db_get_num_rows (dbCursor *)
 Get number of selected rows. More...
 
char * db_get_string (const dbString *)
 Get string. More...
 
dbColumndb_get_table_column (dbTable *, int)
 Returns column structure for given table and column number. More...
 
dbColumndb_get_table_column_by_name (dbTable *, const char *)
 Returns column structure for given table and column name. More...
 
int db_get_table_delete_priv (dbTable *)
 Get table delete privileges. More...
 
const char * db_get_table_description (dbTable *)
 Get the description of the table. More...
 
int db_get_table_insert_priv (dbTable *)
 Get table insert privileges. More...
 
const char * db_get_table_name (dbTable *)
 Get the name of the table. More...
 
int db_get_table_number_of_columns (dbTable *)
 Return the number of columns of the table. More...
 
int db_get_table_number_of_rows (dbDriver *, dbString *)
 Get number of rows of table. More...
 
int db_get_table_select_priv (dbTable *)
 Get table select privileges. More...
 
int db_get_table_update_priv (dbTable *)
 Get table update privileges. More...
 
double db_get_value_as_double (dbValue *, int)
 Get value as double. More...
 
int db_get_value_day (dbValue *)
 Get day value. More...
 
double db_get_value_double (dbValue *)
 Get double precision value. More...
 
int db_get_value_hour (dbValue *)
 Get hour value. More...
 
int db_get_value_int (dbValue *)
 Get integer value. More...
 
int db_get_value_minute (dbValue *)
 Get minute value. More...
 
int db_get_value_month (dbValue *)
 Get month value. More...
 
double db_get_value_seconds (dbValue *)
 Get seconds value. More...
 
const char * db_get_value_string (dbValue *)
 Get string value. More...
 
int db_get_value_year (dbValue *)
 Get year value. More...
 
int db_grant_on_table (dbDriver *, const char *, int, int)
 Grant privileges on table. More...
 
int db_has_dbms (void)
 Check dbms. More...
 
void db_init_column (dbColumn *)
 Initialize dbColumn. More...
 
void db_init_cursor (dbCursor *)
 Initialize dbCursor. More...
 
void db__init_driver_state (void)
 Initialize driver state. More...
 
void db_init_handle (dbHandle *)
 Initialize handle (i.e database/schema) More...
 
void db_init_index (dbIndex *)
 Initialize dbIndex. More...
 
void db_init_string (dbString *)
 Initialize dbString. More...
 
void db_init_table (dbTable *)
 Initialize the table to zero. More...
 
int db_insert (dbCursor *)
 Insert new record into table. More...
 
void db_interval_range (int, int *, int *)
 Define range based on SQL data type. More...
 
int db_isdir (const char *)
 Test if path is a directory. More...
 
int db_legal_tablename (const char *)
 Check if output is legal table name. More...
 
int db_list_databases (dbDriver *, dbString *, int, dbHandle **, int *)
 List databases. More...
 
const char * db_list_drivers (void)
 Return comma separated list of existing DB drivers, used for driver parameter options. More...
 
int db_list_indexes (dbDriver *, dbString *, dbIndex **, int *)
 List indexes. More...
 
int db_list_tables (dbDriver *, dbString **, int *, int)
 List available tables for given connection. More...
 
void * db_malloc (int)
 Allocate memory. More...
 
void db__mark_database_closed (void)
 Mark database as closed. More...
 
void db__mark_database_open (const char *, const char *)
 Mark database as opened. More...
 
void db_memory_error (void)
 Report memory error. More...
 
dbToken db_new_token (dbAddress)
 Add new token. More...
 
int db_nocase_compare (const char *, const char *)
 Compare strings case-insensitive. More...
 
void db_noproc_error (int)
 Report no procedure error. More...
 
int db_open_database (dbDriver *, dbHandle *)
 Open database connection. More...
 
int db_open_insert_cursor (dbDriver *, dbCursor *)
 Open insert cursor. More...
 
int db_open_select_cursor (dbDriver *, dbString *, dbCursor *, int)
 Open select cursor. More...
 
int db_open_update_cursor (dbDriver *, dbString *_name, dbString *, dbCursor *, int)
 Open update cursor. More...
 
void db_print_column_definition (FILE *, dbColumn *)
 Print column definition info. More...
 
void db_print_error (void)
 Print error. More...
 
void db_print_index (FILE *, dbIndex *)
 Report index. More...
 
void db_print_table_definition (FILE *, dbTable *)
 Print table definition info. More...
 
void db_procedure_not_implemented (const char *)
 Report 'not implemented' error. More...
 
void db_protocol_error (void)
 Report protocol error. More...
 
dbDbmscapdb_read_dbmscap (void)
 Read dbmscap. More...
 
void * db_realloc (void *, int)
 Reallocate memory. More...
 
int db__recv_char (char *)
 ? More...
 
int db__recv_column_default_value (dbColumn *)
 Receive column default value. More...
 
int db__recv_column_definition (dbColumn *)
 Receive column definition. More...
 
int db__recv_column_value (dbColumn *)
 Receive column value. More...
 
int db__recv_datetime (dbDateTime *)
 Receive datetime. More...
 
int db__recv_double (double *)
 Receive double. More...
 
int db__recv_double_array (double **, int *)
 Receive double array. More...
 
int db__recv_float (float *)
 Receive float. More...
 
int db__recv_float_array (float **, int *)
 Receive float array. More...
 
int db__recv_handle (dbHandle *)
 Receive handle. More...
 
int db__recv_index (dbIndex *)
 Receive index. More...
 
int db__recv_index_array (dbIndex **, int *)
 Receive index array. More...
 
int db__recv_int (int *)
 Receive integer. More...
 
int db__recv_int_array (int **, int *)
 Receive integer array. More...
 
int db__recv_procnum (int *)
 ? (driver only) More...
 
int db__recv_return_code (int *)
 Receive return code. More...
 
int db__recv_short (short *)
 Receive short. More...
 
int db__recv_short_array (short **, int *)
 Receive short array. More...
 
int db__recv_string (dbString *)
 Reads a string from transport. More...
 
int db__recv_string_array (dbString **, int *)
 Receive string array. More...
 
int db__recv_table_data (dbTable *)
 Receive table data. More...
 
int db__recv_table_definition (dbTable **)
 Receive table definition. More...
 
int db__recv_token (dbToken *)
 Receive token. More...
 
int db__recv_value (dbValue *, int)
 Receive value. More...
 
int db__send_Cstring (const char *)
 Send C string. More...
 
int db__send_char (int)
 ? More...
 
int db__send_column_default_value (dbColumn *)
 Send column default value. More...
 
int db__send_column_definition (dbColumn *)
 Send column definition. More...
 
int db__send_column_value (dbColumn *)
 Send column value. More...
 
int db__send_datetime (dbDateTime *)
 Send datetime. More...
 
int db__send_double (double)
 Send double. More...
 
int db__send_double_array (const double *, int)
 Send double array. More...
 
int db__send_failure (void)
 Send failure code. More...
 
int db__send_float (float)
 Send float. More...
 
int db__send_float_array (const float *, int)
 Send float array. More...
 
int db__send_handle (dbHandle *)
 Send handle. More...
 
int db__send_index (dbIndex *)
 Send index. More...
 
int db__send_index_array (dbIndex *, int)
 Send index array. More...
 
int db__send_int (int)
 Send integer. More...
 
int db__send_int_array (const int *, int)
 Send integer array. More...
 
int db__send_procedure_not_implemented (int)
 ? More...
 
int db__send_procedure_ok (int)
 ? More...
 
int db__send_short (int)
 Send short. More...
 
int db__send_short_array (const short *, int)
 Send short array. More...
 
int db__send_string (dbString *)
 Send string. More...
 
int db__send_string_array (dbString *, int)
 Send string array. More...
 
int db__send_success (void)
 Send success code. More...
 
int db__send_table_data (dbTable *)
 Send table data. More...
 
int db__send_table_definition (dbTable *)
 Send table definition. More...
 
int db__send_token (dbToken *)
 Send token. More...
 
int db__send_value (dbValue *, int)
 Send value. More...
 
int db_select_CatValArray (dbDriver *, const char *, const char *, const char *, const char *, dbCatValArray *)
 Select pairs key/value to array, values are sorted by key (must be integer) More...
 
int db_select_int (dbDriver *, const char *, const char *, const char *, int **)
 Select array of ordered integers from table/column. More...
 
int db_select_value (dbDriver *, const char *, const char *, int, const char *, dbValue *)
 Select one (first) value from table/column for key/id. More...
 
int db_set_column_description (dbColumn *, const char *)
 Set column description. More...
 
void db_set_column_has_defined_default_value (dbColumn *)
 Set default value identificator. More...
 
void db_set_column_has_undefined_default_value (dbColumn *)
 Unset default value identificator. More...
 
void db_set_column_host_type (dbColumn *, int)
 Set column host data type. More...
 
void db_set_column_length (dbColumn *, int)
 Set column's length. More...
 
int db_set_column_name (dbColumn *, const char *)
 Set column name. More...
 
void db_set_column_null_allowed (dbColumn *)
 Set null value to be allowed. More...
 
void db_set_column_precision (dbColumn *, int)
 Set column precision. More...
 
void db_set_column_scale (dbColumn *, int)
 Set column scale. More...
 
void db_set_column_select_priv_granted (dbColumn *)
 Set select privileges to be granted. More...
 
void db_set_column_select_priv_not_granted (dbColumn *)
 Unset select privileges. More...
 
void db_set_column_sqltype (dbColumn *, int)
 Define column sqltype for column. More...
 
void db_set_column_update_priv_granted (dbColumn *)
 Set update privileges to be granted. More...
 
void db_set_column_update_priv_not_granted (dbColumn *)
 Unset update privileges. More...
 
void db_set_column_use_default_value (dbColumn *)
 Set default value to be used. More...
 
int db_set_connection (dbConnection *)
 Set default DB connection settings. More...
 
void db_set_cursor_column_flag (dbCursor *, int)
 Set column's flag. More...
 
void db_set_cursor_column_for_update (dbCursor *, int)
 Set Column flag to 'update'. More...
 
void db_set_cursor_mode (dbCursor *, int)
 Set cursor mode. More...
 
void db_set_cursor_mode_insensitive (dbCursor *)
 Set 'intensive' cursor mode. More...
 
void db_set_cursor_mode_scroll (dbCursor *)
 Set 'scroll' cursor mode. More...
 
void db_set_cursor_table (dbCursor *, dbTable *)
 Set table for given cursor. More...
 
void db_set_cursor_token (dbCursor *, dbToken)
 Set cursor token. More...
 
void db_set_cursor_type_insert (dbCursor *)
 Set cursor to be writable (insert) More...
 
void db_set_cursor_type_readonly (dbCursor *)
 Set cursor to be read-only (select) More...
 
void db_set_cursor_type_update (dbCursor *)
 Set cursor to be writable (update) More...
 
int db_set_default_connection (void)
 Sets up database connection settings using GRASS default from dbmi.h. More...
 
void db_set_error_who (const char *)
 Set 'who' for error messages. More...
 
int db_set_handle (dbHandle *, const char *, const char *)
 Set handle (database and schema name) More...
 
void db_set_error_handler_driver (dbDriver *)
 Define standard error handler for open database connection. More...
 
void db_unset_error_handler_driver (dbDriver *)
 Remove error handler before closing the driver. More...
 
int db_set_index_column_name (dbIndex *, int, const char *)
 Set column name. More...
 
int db_set_index_name (dbIndex *, const char *)
 Set index name. More...
 
int db_set_index_table_name (dbIndex *, const char *)
 Set table name. More...
 
int db_set_index_type_non_unique (dbIndex *)
 Set index type to non-unique. More...
 
int db_set_index_type_unique (dbIndex *)
 Set index type to unique. More...
 
void db__set_protocol_fds (FILE *, FILE *)
 ? More...
 
int db_set_string (dbString *, const char *)
 Inserts string to dbString (enlarge string) More...
 
int db_set_string_no_copy (dbString *, char *)
 Inserts string to dbString (overwrite current value) More...
 
int db_set_table_column (dbTable *, int, dbColumn *)
 Set a specific column for given table and column number. More...
 
void db_set_table_delete_priv_granted (dbTable *)
 Grant delete privileges for table. More...
 
void db_set_table_delete_priv_not_granted (dbTable *)
 Set delete privileges not granted for table. More...
 
int db_set_table_description (dbTable *, const char *)
 Set the description of the table. More...
 
void db_set_table_insert_priv_granted (dbTable *)
 Grant insert privileges for table. More...
 
void db_set_table_insert_priv_not_granted (dbTable *)
 Set insert privileges not granted for table. More...
 
int db_set_table_name (dbTable *, const char *)
 Set the name of the table. More...
 
void db_set_table_select_priv_granted (dbTable *)
 Grant selection privileges for all columns. More...
 
void db_set_table_select_priv_not_granted (dbTable *)
 Set selection privileges not granted for all columns. More...
 
void db_set_table_update_priv_granted (dbTable *)
 Grant update privileges for all columns. More...
 
void db_set_table_update_priv_not_granted (dbTable *)
 Set update privileges not granted for all columns. More...
 
void db_set_value_datetime_current (dbValue *)
 Set datetime to current. More...
 
void db_set_value_datetime_not_current (dbValue *)
 Set value to non-current. More...
 
void db_set_value_day (dbValue *, int)
 Set day value. More...
 
void db_set_value_double (dbValue *, double)
 Set double precision value. More...
 
void db_set_value_hour (dbValue *, int)
 Set hour value. More...
 
void db_set_value_int (dbValue *, int)
 Set integer value. More...
 
void db_set_value_minute (dbValue *, int)
 Set minute value. More...
 
void db_set_value_month (dbValue *, int)
 Set month value. More...
 
void db_set_value_not_null (dbValue *)
 Set value to not null. More...
 
void db_set_value_null (dbValue *)
 Set value to null. More...
 
void db_set_value_seconds (dbValue *, double)
 Set seconds value. More...
 
int db_set_value_string (dbValue *, const char *)
 Set string value. More...
 
void db_set_value_year (dbValue *, int)
 Set year value. More...
 
int db_shutdown_driver (dbDriver *)
 Closedown the driver, and free the driver structure. More...
 
const char * db_sqltype_name (int)
 Get SQL data type description. More...
 
int db_sqltype_to_Ctype (int)
 Get C data type based on given SQL data type. More...
 
dbDriverdb_start_driver (const char *)
 Initialize a new dbDriver for db transaction. More...
 
dbDriverdb_start_driver_open_database (const char *, const char *)
 Open driver/database connection. More...
 
int db__start_procedure_call (int)
 ? (client only) More...
 
char * db_store (const char *)
 Make a copy of string buffer. More...
 
void db_strip (char *)
 Strip given string. More...
 
void db_syserror (const char *)
 Report system error. More...
 
int db_table_exists (const char *, const char *, const char *)
 Check if table exists. More...
 
int db_test_column_has_default_value (dbColumn *)
 Check if column has defined default value. More...
 
int db_test_column_has_defined_default_value (dbColumn *)
 Check if column has defined default value. More...
 
int db_test_column_has_undefined_default_value (dbColumn *)
 Check if column has defined default value. More...
 
int db_test_column_null_allowed (dbColumn *)
 Checks if null value is allowed. More...
 
int db_test_column_use_default_value (dbColumn *)
 Checks if default value is used. More...
 
int db_test_cursor_any_column_flag (dbCursor *)
 Checks columns' flag. More...
 
int db_test_cursor_any_column_for_update (dbCursor *)
 Check if columns' flag is 'update'. More...
 
int db_test_cursor_column_flag (dbCursor *, int)
 Checks column's flag. More...
 
int db_test_cursor_column_for_update (dbCursor *, int)
 Check if column flag is 'update'. More...
 
int db_test_cursor_mode_insensitive (dbCursor *)
 Check if cursor mode is 'intensive'. More...
 
int db_test_cursor_mode_scroll (dbCursor *)
 Check if cursor mode is 'scroll'. More...
 
int db_test_cursor_type_fetch (dbCursor *)
 Check cursor type. More...
 
int db_test_cursor_type_insert (dbCursor *)
 Check if cursor type is 'insert'. More...
 
int db_test_cursor_type_update (dbCursor *)
 Check if cursor type is 'update'. More...
 
int db__test_database_open (void)
 Test database connection. More...
 
int db_test_index_type_unique (dbIndex *)
 Test if type is unique. More...
 
int db_test_value_datetime_current (dbValue *)
 Check if datatime is current. More...
 
int db_test_value_isnull (dbValue *)
 Check of value is null. More...
 
void db_unset_column_has_default_value (dbColumn *)
 Unset default value identificator. More...
 
void db_unset_column_null_allowed (dbColumn *)
 Unset null value to be allowed. More...
 
void db_unset_column_use_default_value (dbColumn *)
 Unset default value to be used. More...
 
void db_unset_cursor_column_flag (dbCursor *, int)
 Unset column's flag. More...
 
void db_unset_cursor_column_for_update (dbCursor *, int)
 Unset 'update' column flag. More...
 
void db_unset_cursor_mode (dbCursor *)
 Unset cursor mode. More...
 
void db_unset_cursor_mode_insensitive (dbCursor *)
 Unset 'intensive' cursor mode. More...
 
void db_unset_cursor_mode_scroll (dbCursor *)
 Unset 'scroll' cursor mode. More...
 
int db_update (dbCursor *)
 ? More...
 
int db_gversion (dbDriver *, dbString *, dbString *)
 Get version info. More...
 
const char * db_whoami (void)
 Who am i? More...
 
void db_zero (void *, int)
 Zero allocated space. More...
 
void db_zero_string (dbString *)
 Zero string. More...
 
unsigned int db_sizeof_string (const dbString *)
 Get string size. More...
 
int db_set_login (const char *, const char *, const char *, const char *)
 Set login parameters for driver/database. More...
 
int db_set_login2 (const char *, const char *, const char *, const char *, const char *, const char *, int)
 Set login parameters for driver/database. More...
 
int db_get_login (const char *, const char *, const char **, const char **)
 Get login parameters for driver/database. More...
 
int db_get_login2 (const char *, const char *, const char **, const char **, const char **, const char **)
 Get login parameters for driver/database. More...
 
int db_get_login_dump (FILE *)
 Print all connection settings to file. More...
 

Function Documentation

◆ db__add_cursor_to_driver_state()

void db__add_cursor_to_driver_state ( dbCursor cursor)

Add cursor do driver state.

Parameters
cursordb cursor to be added

Definition at line 79 of file driver_state.c.

References _db_driver_state::cursor_list, db_realloc(), list, _db_driver_state::ncursors, and NULL.

◆ db__close_all_cursors()

void db__close_all_cursors ( void  )

Close all cursors.

Definition at line 122 of file driver_state.c.

References _db_driver_state::cursor_list, db_driver_close_cursor, db_free(), _db_driver_state::ncursors, and NULL.

Referenced by db_d_close_database().

◆ db__drop_cursor_from_driver_state()

void db__drop_cursor_from_driver_state ( dbCursor cursor)

Drop cursor from driver state.

Parameters
cursordb cursor to be dropped

Definition at line 110 of file driver_state.c.

References _db_driver_state::cursor_list, _db_driver_state::ncursors, and NULL.

Referenced by db_d_close_cursor().

◆ db__get_driver_state()

dbDriverState* db__get_driver_state ( void  )

Get driver state.

Returns
pointer to dbDriverState

Definition at line 35 of file driver_state.c.

References state.

◆ db__init_driver_state()

void db__init_driver_state ( void  )

Initialize driver state.

Definition at line 25 of file driver_state.c.

References db_zero().

Referenced by db_d_close_database().

◆ db__mark_database_closed()

void db__mark_database_closed ( void  )

Mark database as closed.

Definition at line 67 of file driver_state.c.

References db_free(), _db_driver_state::dbname, _db_driver_state::dbschema, and _db_driver_state::open.

Referenced by db_d_close_database().

◆ db__mark_database_open()

void db__mark_database_open ( const char *  dbname,
const char *  dbschema 
)

Mark database as opened.

Parameters
dbnamedatabase name
dbschemadatabase schema name

Definition at line 57 of file driver_state.c.

References db_store(), _db_driver_state::dbname, _db_driver_state::dbschema, and _db_driver_state::open.

Referenced by db_d_open_database().

◆ db__recv_char()

int db__recv_char ( char *  d)

?

Parameters
d
Returns

Definition at line 45 of file xdrchar.c.

◆ db__recv_column_default_value()

int db__recv_column_default_value ( dbColumn column)

Receive column default value.

Parameters
columnpointer to dbColumn
Returns

Definition at line 120 of file xdrcolumn.c.

References db__recv_value(), db_get_column_default_value(), db_get_column_sqltype(), and db_sqltype_to_Ctype().

◆ db__recv_column_definition()

◆ db__recv_column_value()

int db__recv_column_value ( dbColumn column)

Receive column value.

Parameters
columnpointer to dbColumn
Returns

Definition at line 94 of file xdrcolumn.c.

References db__recv_value(), db_get_column_sqltype(), db_get_column_value(), and db_sqltype_to_Ctype().

◆ db__recv_datetime()

int db__recv_datetime ( dbDateTime t)

Receive datetime.

Parameters
tpointer to dbDateTime
Returns
DB_OK

Definition at line 47 of file xdrdatetime.c.

References _db_date_time::current, _db_date_time::day, DB_OK, DB_RECV_CHAR, DB_RECV_DOUBLE, DB_RECV_INT, _db_date_time::hour, _db_date_time::minute, _db_date_time::month, _db_date_time::seconds, and _db_date_time::year.

◆ db__recv_double()

int db__recv_double ( double *  d)

Receive double.

Parameters
d

Definition at line 42 of file xdrdouble.c.

◆ db__recv_double_array()

int db__recv_double_array ( double **  x,
int *  n 
)

Receive double array.

Returns an allocated array of doubles Caller is responsible for free()

Parameters
x
n
Returns

Definition at line 90 of file xdrdouble.c.

References count, and DB_OK.

◆ db__recv_float()

int db__recv_float ( float *  d)

Receive float.

Parameters
d
Returns

Definition at line 44 of file xdrfloat.c.

◆ db__recv_float_array()

int db__recv_float_array ( float **  x,
int *  n 
)

Receive float array.

Returns an allocated array of floats Caller is responsible for free()

Parameters
x
n
Returns

Definition at line 92 of file xdrfloat.c.

References count, and DB_OK.

◆ db__recv_handle()

int db__recv_handle ( dbHandle handle)

Receive handle.

Parameters
handle
Returns

Definition at line 40 of file xdrhandle.c.

References DB_OK, DB_RECV_STRING, _db_handle::dbName, and _db_handle::dbSchema.

◆ db__recv_index()

int db__recv_index ( dbIndex index)

Receive index.

Parameters
index
Returns

Definition at line 69 of file xdrindex.c.

◆ db__recv_index_array()

int db__recv_index_array ( dbIndex **  list,
int *  count 
)

Receive index array.

Parameters
list
count

Definition at line 96 of file xdrindex.c.

References count, db_alloc_index_array(), db_get_error_code(), DB_OK, DB_RECV_INDEX, DB_RECV_INT, and NULL.

◆ db__recv_int()

int db__recv_int ( int *  n)

Receive integer.

Parameters
n
Returns

Definition at line 44 of file xdrint.c.

References db__recv(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().

Referenced by db__recv_token().

◆ db__recv_int_array()

int db__recv_int_array ( int **  x,
int *  n 
)

Receive integer array.

Returns an allocated array of ints Caller is responsible for free()

Parameters
x
n
Returns

Definition at line 92 of file xdrint.c.

References count, and DB_OK.

◆ db__recv_procnum()

int db__recv_procnum ( int *  n)

? (driver only)

Parameters
n
Returns
DB_OK ok
DB_EOF eof from client

Definition at line 52 of file xdrprocedure.c.

References db__recv(), DB_EOF, and DB_OK.

◆ db__recv_return_code()

int db__recv_return_code ( int *  ret_code)

Receive return code.

Parameters
[out]ret_codereturn code
Returns
DB_OK on success

Definition at line 51 of file ret_codes.c.

◆ db__recv_short()

int db__recv_short ( short *  n)

Receive short.

Parameters
n
Returns

Definition at line 46 of file xdrshort.c.

References db__recv(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().

◆ db__recv_short_array()

int db__recv_short_array ( short **  x,
int *  n 
)

Receive short array.

Returns an allocated array of ints Caller is responsible for free()

Parameters
x
n
Returns

Definition at line 94 of file xdrshort.c.

References count, and DB_OK.

◆ db__recv_string()

int db__recv_string ( dbString x)

Reads a string from transport.

Note: caller MUST initialize x by calling db_init_string()

Parameters
x
Returns
DB_OK, DB_MEMORY_ERR, or DB_PROTOCOL_ERR
NULL if error

Definition at line 117 of file xdrstring.c.

References DB_OK.

◆ db__recv_string_array()

int db__recv_string_array ( dbString **  a,
int *  n 
)

Receive string array.

Parameters
a
n
Returns

Definition at line 46 of file xdrstring.c.

◆ db__recv_table_data()

int db__recv_table_data ( dbTable table)

Receive table data.

Parameters
table
Returns

Definition at line 101 of file xdrtable.c.

◆ db__recv_table_definition()

int db__recv_table_definition ( dbTable **  table)

Receive table definition.

Parameters
[out]table
Returns

Definition at line 51 of file xdrtable.c.

◆ db__recv_token()

int db__recv_token ( dbToken token)

Receive token.

Parameters
token
Returns

Definition at line 36 of file xdrtoken.c.

References db__recv_int().

◆ db__recv_value()

int db__recv_value ( dbValue value,
int  Ctype 
)

◆ db__send_char()

int db__send_char ( int  d)

?

Parameters
d
Returns

Definition at line 24 of file xdrchar.c.

◆ db__send_column_default_value()

int db__send_column_default_value ( dbColumn column)

Send column default value.

Parameters
columnpointer to dbColumn
Returns

Definition at line 107 of file xdrcolumn.c.

References db__send_value(), db_get_column_default_value(), db_get_column_sqltype(), and db_sqltype_to_Ctype().

◆ db__send_column_definition()

◆ db__send_column_value()

int db__send_column_value ( dbColumn column)

Send column value.

Parameters
columnpointer to dbColumn
Returns

Definition at line 81 of file xdrcolumn.c.

References db__send_value(), db_get_column_sqltype(), db_get_column_value(), and db_sqltype_to_Ctype().

◆ db__send_Cstring()

int db__send_Cstring ( const char *  s)

Send C string.

Parameters
s
Returns

Definition at line 150 of file xdrstring.c.

◆ db__send_datetime()

int db__send_datetime ( dbDateTime t)

◆ db__send_double()

int db__send_double ( double  d)

Send double.

Parameters
d
Returns

Definition at line 24 of file xdrdouble.c.

◆ db__send_double_array()

int db__send_double_array ( const double *  x,
int  n 
)

Send double array.

Parameters
x
n
Returns

Definition at line 63 of file xdrdouble.c.

References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().

◆ db__send_failure()

int db__send_failure ( void  )

Send failure code.

Returns
DB_OK

Definition at line 37 of file ret_codes.c.

References DB_FAILED, db_get_error_msg(), DB_OK, DB_SEND_C_STRING, and DB_SEND_INT.

◆ db__send_float()

int db__send_float ( float  d)

Send float.

Parameters
d
Returns

Definition at line 24 of file xdrfloat.c.

◆ db__send_float_array()

int db__send_float_array ( const float *  x,
int  n 
)

Send float array.

Parameters
x
n
Returns

Definition at line 65 of file xdrfloat.c.

References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().

◆ db__send_handle()

int db__send_handle ( dbHandle handle)

Send handle.

Parameters
handle
Returns

Definition at line 25 of file xdrhandle.c.

References DB_OK, DB_SEND_STRING, _db_handle::dbName, and _db_handle::dbSchema.

◆ db__send_index()

int db__send_index ( dbIndex index)

◆ db__send_index_array()

int db__send_index_array ( dbIndex list,
int  count 
)

Send index array.

Parameters
list
count
Returns

Definition at line 51 of file xdrindex.c.

References count, DB_OK, DB_SEND_INDEX, and DB_SEND_INT.

◆ db__send_int()

int db__send_int ( int  n)

Send integer.

Parameters
n
Returns

Definition at line 24 of file xdrint.c.

References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().

Referenced by db__send_procedure_not_implemented(), db__send_procedure_ok(), and db__send_token().

◆ db__send_int_array()

int db__send_int_array ( const int *  x,
int  n 
)

Send integer array.

Parameters
x
n
Returns

Definition at line 65 of file xdrint.c.

References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().

◆ db__send_procedure_not_implemented()

int db__send_procedure_not_implemented ( int  n)

?

Parameters
n
Returns

Definition at line 81 of file xdrprocedure.c.

References db__send_int().

◆ db__send_procedure_ok()

int db__send_procedure_ok ( int  n)

?

Parameters
n
Returns

Definition at line 69 of file xdrprocedure.c.

References db__send_int().

◆ db__send_short()

int db__send_short ( int  n)

Send short.

Parameters
n
Returns

Definition at line 25 of file xdrshort.c.

References DB_OK.

◆ db__send_short_array()

int db__send_short_array ( const short *  x,
int  n 
)

Send short array.

Parameters
x
n
Returns

Definition at line 67 of file xdrshort.c.

References db__send(), DB_OK, DB_PROTOCOL_ERR, and db_protocol_error().

◆ db__send_string()

int db__send_string ( dbString x)

Send string.

Parameters
x
Returns

Definition at line 86 of file xdrstring.c.

References DB_OK.

◆ db__send_string_array()

int db__send_string_array ( dbString a,
int  count 
)

Send string array.

Parameters
a
count
Returns

Definition at line 26 of file xdrstring.c.

◆ db__send_success()

int db__send_success ( void  )

Send success code.

Returns
DB_OK

Definition at line 26 of file ret_codes.c.

References DB_OK, and DB_SEND_INT.

◆ db__send_table_data()

int db__send_table_data ( dbTable table)

Send table data.

Parameters
table
Returns

Definition at line 81 of file xdrtable.c.

◆ db__send_table_definition()

int db__send_table_definition ( dbTable table)

Send table definition.

Parameters
tablepointer to dbTable
Returns

Definition at line 26 of file xdrtable.c.

◆ db__send_token()

int db__send_token ( dbToken token)

Send token.

Parameters
token
Returns

Definition at line 24 of file xdrtoken.c.

References db__send_int().

◆ db__send_value()

◆ db__set_protocol_fds()

◆ db__start_procedure_call()

int db__start_procedure_call ( int  procnum)

? (client only)

Parameters
procnum
Returns

Definition at line 25 of file xdrprocedure.c.

References db_noproc_error(), DB_OK, DB_PROTOCOL_ERR, db_protocol_error(), DB_RECV_INT, and DB_SEND_INT.

◆ db__test_database_open()

int db__test_database_open ( void  )

Test database connection.

Returns
1 opened
0 closed

Definition at line 46 of file driver_state.c.

References _db_driver_state::open.

Referenced by db_d_close_database(), and db_d_open_database().

◆ db_add_column()

int db_add_column ( dbDriver driver,
dbString tableName,
dbColumn column 
)

Add column to table.

Parameters
driverdb driver
tableNametable name
columnnew column description (dbColumn structure)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 28 of file c_add_col.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_ADD_COLUMN, DB_RECV_RETURN_CODE, DB_SEND_COLUMN_DEFINITION, DB_SEND_STRING, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_alloc_cursor_column_flags()

int db_alloc_cursor_column_flags ( dbCursor cursor)

Allocate columns' flags for cursor.

Parameters
cursorpointer to dbCursor
Returns
DB_OK on success
error code on failure

Definition at line 276 of file cursor.c.

◆ db_alloc_cursor_table()

int db_alloc_cursor_table ( dbCursor cursor,
int  ncols 
)

Allocate table for cursor.

Parameters
cursorpointer to dbCursor
ncolsnumber of column in table
Returns
DB_OK on success
error code on error

Definition at line 38 of file cursor.c.

◆ db_alloc_dirent_array()

dbDirent* db_alloc_dirent_array ( int  count)

Allocate dirent array.

Parameters
countnumber of entities in the array
Returns
pointer to dbDirent array
NULL on failure

Definition at line 172 of file dirent.c.

References count, db_calloc(), db_init_string(), name, and NULL.

◆ db_alloc_handle_array()

dbHandle* db_alloc_handle_array ( int  count)

Allocate array of handles.

Parameters
countnumber of handles in the array
Returns
pointer to first dbHandle in the array

Definition at line 109 of file handle.c.

References count, db_calloc(), and db_init_handle().

◆ db_alloc_index_array()

dbIndex* db_alloc_index_array ( int  count)

Allocate index array.

Parameters
countnumber of items
Returns
pointer to allocated dbIndex array

Definition at line 73 of file db/dbmi_base/index.c.

References count, db_calloc(), db_init_index(), and list.

Referenced by db__recv_index_array().

◆ db_alloc_index_columns()

int db_alloc_index_columns ( dbIndex index,
int  ncols 
)

Allocate index columns.

Parameters
indexpointer to dbIndex
ncolsnumber of columns to be allocated
Returns
DB_OK

Definition at line 56 of file db/dbmi_base/index.c.

Referenced by db_create_index2().

◆ db_alloc_string_array()

dbString* db_alloc_string_array ( int  count)

Allocate dbString array.

Parameters
countnumber of items to be allocated
Returns
pointer to 1st dbString in the array

Definition at line 181 of file string.c.

◆ db_alloc_table()

dbTable* db_alloc_table ( int  ncols)

Allocate a table with a specific number of columns.

Parameters
ncolsnumber of columns which should be allocated
Returns
allocated dbTable
NULL in case of an error

Definition at line 28 of file dbmi_base/table.c.

Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().

◆ db_append_string()

int db_append_string ( dbString x,
const char *  s 
)

Append string to dbString.

Parameters
xpointer to dbString
sstring to be appended
Returns
DB_OK on success
otherwise error code is returned

Definition at line 205 of file string.c.

Referenced by db_d_append_error(), db_d_report_error(), db_delete_table(), and P_Drop_Aux_Table().

◆ db_append_table_column()

int db_append_table_column ( dbTable table,
dbColumn column 
)

Append a specific column to given table.

Parameters
tablePointer to dbTable
columnPointer to a dbColumn to append. A copy of the column is stored, so the original column can be deleted.
Returns
DB_OK on success
DB_FAILURE on error

Definition at line 372 of file dbmi_base/table.c.

References _db_table::columns, db_copy_column(), DB_FAILED, DB_OK, db_realloc(), NULL, and _db_table::numColumns.

◆ db_auto_print_errors()

void db_auto_print_errors ( int  flag)

Toggles printing of DBMI error messages.

Parameters
flag?

Definition at line 249 of file db/dbmi_base/error.c.

◆ db_auto_print_protocol_errors()

void db_auto_print_protocol_errors ( int  flag)

Set auto print protocol error.

Parameters
flag?

Definition at line 260 of file db/dbmi_base/error.c.

◆ db_begin_transaction()

int db_begin_transaction ( dbDriver driver)

Begin transaction.

Parameters
driverdb driver
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 56 of file c_execute.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_BEGIN_TRANSACTION, DB_RECV_RETURN_CODE, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_bind_update()

int db_bind_update ( dbCursor cursor)

◆ db_calloc()

void* db_calloc ( int  n,
int  m 
)

Allocate memory.

On failure is called db_memory_error().

Parameters
nnumber of entities
mentity size
Returns
pointer to allocated memmory

Definition at line 69 of file db/dbmi_base/alloc.c.

Referenced by db_alloc_dirent_array(), db_alloc_handle_array(), and db_alloc_index_array().

◆ db_CatValArray_alloc()

int db_CatValArray_alloc ( dbCatValArray arr,
int  n 
)

Allocate dbCatValArray.

Todo:
return type void?
Parameters
arrpointer to dbCatValArray
nnumber of items
Returns
DB_OK

Definition at line 401 of file value.c.

References dbCatValArray::alloc, DB_OK, G_calloc, and dbCatValArray::value.

◆ db_CatValArray_free()

void db_CatValArray_free ( dbCatValArray arr)

◆ db_CatValArray_get_value()

int db_CatValArray_get_value ( dbCatValArray arr,
int  key,
dbCatVal **  cv 
)

Find value by key.

Parameters
arrdbCatValArray (key/value array)
keykey value
[out]cvdbCatVal structure (key/value) to store within
Returns
DB_OK on success
DB_FAILED on error

Definition at line 466 of file db/dbmi_client/select.c.

◆ db_CatValArray_get_value_double()

int db_CatValArray_get_value_double ( dbCatValArray arr,
int  key,
double *  val 
)

Find value (double) by key.

Parameters
arrdbCatValArray (key/value array)
keykey value
[out]valfound value (double)
Returns
DB_OK on success
DB_FAILED on error

Definition at line 518 of file db/dbmi_client/select.c.

◆ db_CatValArray_get_value_int()

int db_CatValArray_get_value_int ( dbCatValArray arr,
int  key,
int *  val 
)

Find value (integer) by key.

Parameters
arrdbCatValArray (key/value array)
keykey value
[out]valfound value (integer)
Returns
DB_OK on success
DB_FAILED on error

Definition at line 492 of file db/dbmi_client/select.c.

◆ db_CatValArray_init()

void db_CatValArray_init ( dbCatValArray arr)

Initialize dbCatValArray.

Parameters
arrpointer to dbCatValArray to be initialized

Definition at line 361 of file value.c.

References dbCatValArray::alloc, dbCatValArray::n_values, NULL, and dbCatValArray::value.

◆ db_CatValArray_realloc()

int db_CatValArray_realloc ( dbCatValArray arr,
int  n 
)

Realloc dbCatValArray.

Todo:
return code void?
Parameters
arrpointer to dbCatValArray
nnumber of items
Returns
DB_OK

Definition at line 420 of file value.c.

References dbCatValArray::alloc, DB_OK, G_realloc, and dbCatValArray::value.

◆ db_CatValArray_sort()

void db_CatValArray_sort ( dbCatValArray arr)

Sort key/value array by key.

Parameters
[in,out]arrdbCatValArray (key/value array)

Definition at line 417 of file db/dbmi_client/select.c.

References dbCatValArray::n_values, and dbCatValArray::value.

◆ db_CatValArray_sort_by_value()

int db_CatValArray_sort_by_value ( dbCatValArray arr)

Sort key/value array by value.

Parameters
[in,out]arrdbCatValArray (key/value array)
Returns
DB_OK on success
DB_FAILED on error

Definition at line 430 of file db/dbmi_client/select.c.

References dbCatValArray::ctype, DB_C_TYPE_INT, dbCatValArray::n_values, and dbCatValArray::value.

◆ db_char_to_lowercase()

void db_char_to_lowercase ( char *  s)

Convert character to lowercase.

Parameters
scharacter to be modified

Definition at line 22 of file case.c.

◆ db_char_to_uppercase()

void db_char_to_uppercase ( char *  s)

Convert character to uppercase.

Parameters
scharacter to be modified

Definition at line 33 of file case.c.

◆ db_clear_error()

void db_clear_error ( void  )

Clear error status.

Definition at line 171 of file db/dbmi_base/error.c.

◆ db_clone_table()

dbTable* db_clone_table ( dbTable src)

Make a new exact copy of an existing table.

New memory is allocated for the clone, the columns-content will be copied too.

Parameters
srcPointer to dbTable
Returns
A new alloacted clone of the given table on success
NULL on error

Definition at line 392 of file dbmi_base/table.c.

◆ db_close_cursor()

int db_close_cursor ( dbCursor cursor)

Close cursor.

Parameters
cursorcursor to be close
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 27 of file c_close_cur.c.

References db__set_protocol_fds(), db_free_cursor(), DB_OK, DB_PROC_CLOSE_CURSOR, DB_RECV_RETURN_CODE, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, and _db_cursor::token.

Referenced by db_get_table_number_of_rows().

◆ db_close_database()

int db_close_database ( dbDriver driver)

Close database connection.

Parameters
driverdb driver
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file c_closedb.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_CLOSE_DATABASE, DB_RECV_RETURN_CODE, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

Referenced by db_close_database_shutdown_driver().

◆ db_close_database_shutdown_driver()

int db_close_database_shutdown_driver ( dbDriver driver)

Close driver/database connection.

Parameters
driverdb driver
Returns
DB_OK or DB_FAILED

Definition at line 62 of file db.c.

References db_close_database(), DB_FAILED, DB_OK, db_shutdown_driver(), and G_debug().

Referenced by db_delete_table(), db_get_table_number_of_rows(), V1_close_ogr(), V1_close_pg(), and Vect_cats_set_constraint().

◆ db_column_Ctype()

int db_column_Ctype ( dbDriver driver,
const char *  tab,
const char *  col 
)

Get column ctype.

See db_sqltype_to_Ctype().

Supported types:

  • DB_C_TYPE_STRING
  • DB_C_TYPE_INT
  • DB_C_TYPE_DOUBLE
  • DB_C_TYPE_DATETIME
Parameters
driverDB driver
tabtable name
colcolumn name
Returns
column Ctype
-1 on error

Definition at line 99 of file dbmi_client/column.c.

◆ db_column_sqltype()

int db_column_sqltype ( dbDriver driver,
const char *  tab,
const char *  col 
)

Get column sqltype.

See db_sqltype_name().

Supported types:

  • DB_SQL_TYPE_UNKNOWN
  • DB_SQL_TYPE_CHARACTER
  • DB_SQL_TYPE_SMALLINT
  • DB_SQL_TYPE_INTEGER
  • DB_SQL_TYPE_REAL
  • DB_SQL_TYPE_DOUBLE_PRECISION
  • DB_SQL_TYPE_DECIMAL
  • DB_SQL_TYPE_NUMERIC
  • DB_SQL_TYPE_DATE
  • DB_SQL_TYPE_TIME
  • DB_SQL_TYPE_TIMESTAMP
  • DB_SQL_TYPE_INTERVAL
  • DB_SQL_TYPE_TEXT
  • DB_SQL_TYPE_SERIAL
Parameters
driverDB driver
tabtable name
colcolumn name
Returns
column sqltype
-1 on error

Definition at line 51 of file dbmi_client/column.c.

◆ db_commit_transaction()

int db_commit_transaction ( dbDriver driver)

Commit transaction.

Parameters
driverdb driver
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 82 of file c_execute.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_COMMIT_TRANSACTION, DB_RECV_RETURN_CODE, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_convert_column_default_value_to_string()

int db_convert_column_default_value_to_string ( dbColumn column,
dbString string 
)

?

Parameters
columnpointer to dbColumn
stringpointer to dbString
Returns
?

Definition at line 79 of file columnfmt.c.

References db_convert_value_to_string(), db_get_column_default_value(), and db_get_column_sqltype().

Referenced by db_print_column_definition().

◆ db_convert_column_value_to_string()

int db_convert_column_value_to_string ( dbColumn column,
dbString string 
)

?

Parameters
columnpointer to dbColumn
stringpointer to dbString
Returns
?

Definition at line 61 of file columnfmt.c.

References db_convert_value_to_string(), db_get_column_sqltype(), and db_get_column_value().

◆ db_convert_Cstring_to_column_default_value()

int db_convert_Cstring_to_column_default_value ( const char *  Cstring,
dbColumn column 
)

?

Parameters
Cstringstring buffer
columnpointer to dbColumn
Returns
?

Definition at line 43 of file columnfmt.c.

References db_convert_Cstring_to_value(), db_get_column_default_value(), and db_get_column_sqltype().

◆ db_convert_Cstring_to_column_value()

int db_convert_Cstring_to_column_value ( const char *  Cstring,
dbColumn column 
)

?

Parameters
Cstringstring buffer
columnpointer to dbColumn
Returns
?

Definition at line 25 of file columnfmt.c.

References db_convert_Cstring_to_value(), db_get_column_sqltype(), and db_get_column_value().

◆ db_convert_Cstring_to_value()

int db_convert_Cstring_to_value ( const char *  Cstring,
int  sqltype,
dbValue value 
)

Convert string to value.

Parameters
Cstringstring buffer
sqltypeSQL data type
[out]valuepointer to dbValue
Returns
DB_OK on success
DB_FAILED on error

Definition at line 31 of file valuefmt.c.

Referenced by db_convert_Cstring_to_column_default_value(), and db_convert_Cstring_to_column_value().

◆ db_convert_Cstring_to_value_datetime()

int db_convert_Cstring_to_value_datetime ( const char *  buf,
int  sqltype,
dbValue value 
)

Convert datetime string to value.

The format of buf must be as follows

  • buf == "CURRENT" in a case-insignificant fashion value is marked as current
  • sqltype == DB_SQL_TYPE_DATE "year*month*day"
  • sqltype == DB_SQL_TYPE_TIME "hour*minute*second"
  • sqltype == DB_SQL_TYPE_TIMESTAMP "year*month*day hour*minute*second"
  • otherwise the to and from markings in sqltype are used, where "*" represents any non-whitespace character
Parameters
bufinput string buffer
sqltypeSQL data type
[out]valuepointer to dbValue to be set
Returns
DB_OK

Definition at line 197 of file datetime.c.

References DB_DAY, DB_FRACTION, DB_HOUR, db_interval_range(), DB_MINUTE, DB_MONTH, db_nocase_compare(), DB_OK, DB_SECOND, db_set_value_datetime_current(), db_set_value_day(), db_set_value_hour(), db_set_value_minute(), db_set_value_month(), db_set_value_seconds(), db_set_value_year(), DB_SQL_TYPE_DATE, DB_SQL_TYPE_TIME, DB_SQL_TYPE_TIMESTAMP, and DB_YEAR.

◆ db_convert_value_datetime_into_string()

int db_convert_value_datetime_into_string ( dbValue value,
int  sqltype,
dbString string 
)

Convert datetime value into string.

Parameters
valuepointer to dbValue
sqltypeSQL data type
[out]stringpointer to dbString
Returns
DB_OK on success

Definition at line 31 of file datetime.c.

References db_get_value_day(), db_get_value_hour(), db_get_value_minute(), db_get_value_month(), db_get_value_seconds(), db_get_value_year(), db_interval_range(), DB_MONTH, db_set_string(), db_test_value_datetime_current(), and DB_YEAR.

Referenced by db_convert_value_to_string().

◆ db_convert_value_to_string()

int db_convert_value_to_string ( dbValue value,
int  sqltype,
dbString string 
)

Convert value to string.

Parameters
valuepointer to dbValue
sqltypeSQL data type
[out]stringpointer to dbString
Returns
DB_OK on success

Definition at line 67 of file valuefmt.c.

References _, DB_C_TYPE_DATETIME, DB_C_TYPE_DOUBLE, DB_C_TYPE_INT, DB_C_TYPE_STRING, db_convert_value_datetime_into_string(), db_error(), DB_FAILED, db_get_value_double(), db_get_value_int(), db_get_value_string(), db_set_string(), db_sqltype_to_Ctype(), db_test_value_isnull(), and G_trim_decimal().

Referenced by db_convert_column_default_value_to_string(), and db_convert_column_value_to_string().

◆ db_copy_column()

dbColumn* db_copy_column ( dbColumn dest,
dbColumn src 
)

Copy a db column from source to destination.

Parameters
srcThe column to copy from
destAn allocated column to copy to which will be initialized. In case dest is NULL a new column will be allocated and returned
Returns
The pointer of copied/allocated column

Definition at line 473 of file dbmi_base/column.c.

Referenced by db_append_table_column(), and db_set_table_column().

◆ db_copy_dbmscap_entry()

void db_copy_dbmscap_entry ( dbDbmscap dst,
dbDbmscap src 
)

Copy dbmscap entry.

Parameters
dstdestination
srcsource

Definition at line 81 of file dbmscap.c.

◆ db_copy_string()

int db_copy_string ( dbString dst,
const dbString src 
)

Copy dbString.

Parameters
dstdestination dbString
srcsource dbString
Returns
DB_OK on success
DB_ERR code on error

Definition at line 230 of file string.c.

◆ db_copy_table()

int db_copy_table ( const char *  from_drvname,
const char *  from_dbname,
const char *  from_tblname,
const char *  to_drvname,
const char *  to_dbname,
const char *  to_tblname 
)

Copy a table.

Parameters
from_drvnamename of driver from table is copied
from_dbnamename of database from table is copied
from_tblnamename of table to be copied
to_drvnamename of driver to - where table is copied to
to_dbnamename of database to - where table is copied to
to_tblnamename of copied table
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 446 of file copy_tab.c.

◆ db_copy_table_by_ints()

int db_copy_table_by_ints ( const char *  from_drvname,
const char *  from_dbname,
const char *  from_tblname,
const char *  to_drvname,
const char *  to_dbname,
const char *  to_tblname,
const char *  selcol,
int *  ivals,
int  nvals 
)

Copy a table (by keys)

Parameters
from_drvnamename of driver from table is copied
from_dbnamename of database from table is copied
from_tblnamename of table to be copied
to_drvnamename of driver to - where table is copied to
to_dbnamename of database to - where table is copied to
to_tblnamename of copied table
selcolname of column used to select records by values in ivals or NULL
ivalspointer to array of integer values or NULL
nvalsnumber of values in ivals
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 519 of file copy_tab.c.

◆ db_copy_table_select()

int db_copy_table_select ( const char *  from_drvname,
const char *  from_dbname,
const char *  from_tblname,
const char *  to_drvname,
const char *  to_dbname,
const char *  to_tblname,
const char *  select 
)

Copy a table (by select statement)

Parameters
from_drvnamename of driver from table is copied
from_dbnamename of database from table is copied
from_dbnamename of table to be copied
to_drvnamename of driver to - where table is copied to
to_dbnamename of database to - where table is copied to
to_tblnamename of copied table
selectfull select statement
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 493 of file copy_tab.c.

◆ db_copy_table_where()

int db_copy_table_where ( const char *  from_drvname,
const char *  from_dbname,
const char *  from_tblname,
const char *  to_drvname,
const char *  to_dbname,
const char *  to_tblname,
const char *  where 
)

Copy a table (by where statement)

Parameters
from_drvnamename of driver from table is copied
from_dbnamename of database from table is copied
from_tblnamename of table to be copied
to_drvnamename of driver to - where table is copied to
to_dbnamename of database to - where table is copied to
to_tblnamename of copied table
whereWHERE SQL condition (without where key word)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 469 of file copy_tab.c.

◆ db_copy_value()

void db_copy_value ( dbValue dst,
dbValue src 
)

Copy value.

Copy value from src to destination

Parameters
dstdestination dbValue
srcsource dbValue

Definition at line 340 of file value.c.

◆ db_create_database()

int db_create_database ( dbDriver driver,
dbHandle handle 
)

Create database.

Parameters
driverdb driver
handlehandle
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 27 of file c_createdb.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_CREATE_DATABASE, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_create_index()

int db_create_index ( dbDriver driver,
dbIndex index 
)

Create index.

Parameters
driverdb driver
indexindex info (pointer to dbIndex structure)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 28 of file c_create_idx.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_CREATE_INDEX, DB_RECV_RETURN_CODE, DB_RECV_STRING, DB_SEND_INDEX, DB_START_PROCEDURE_CALL, _db_index::indexName, _db_driver::recv, and _db_driver::send.

Referenced by db_create_index2().

◆ db_create_index2()

int db_create_index2 ( dbDriver driver,
const char *  table_name,
const char *  column_name 
)

Create unique index.

Parameters
driverdb driver
table_nametable name
column_namecolumn name (where to create index)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 61 of file c_create_idx.c.

References db_alloc_index_columns(), db_create_index(), db_free_index(), db_init_index(), db_set_index_column_name(), db_set_index_name(), db_set_index_table_name(), db_set_index_type_unique(), and NULL.

◆ db_create_table()

int db_create_table ( dbDriver driver,
dbTable table 
)

Create table.

Parameters
driverdb driver
tabletable description (pointer to dbTable structure)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 27 of file c_create_tab.c.

Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().

◆ db_Cstring_to_lowercase()

void db_Cstring_to_lowercase ( char *  s)

Convert string to lowercase.

Parameters
sstring buffer to be modified

Definition at line 44 of file case.c.

◆ db_Cstring_to_uppercase()

void db_Cstring_to_uppercase ( char *  s)

Convert string to lowercase.

Parameters
sstring buffer to be modified

Definition at line 55 of file case.c.

◆ db_d_add_column()

int db_d_add_column ( void  )

Add column to table.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_add_col.c.

◆ db_d_append_error()

void db_d_append_error ( const char *  ,
  ... 
)

◆ db_d_begin_transaction()

int db_d_begin_transaction ( void  )

Begin transaction.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 56 of file d_execute.c.

◆ db_d_bind_update()

int db_d_bind_update ( )

ADD.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 25 of file d_bindupdate.c.

◆ db_d_close_cursor()

int db_d_close_cursor ( void  )

Close cursor.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_close_cur.c.

◆ db_d_close_database()

int db_d_close_database ( void  )

Close database connection.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 25 of file d_closedb.c.

◆ db_d_commit_transaction()

int db_d_commit_transaction ( )

Commit transaction.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 80 of file d_execute.c.

◆ db_d_create_database()

int db_d_create_database ( void  )

Create database.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_createdb.c.

◆ db_d_create_index()

int db_d_create_index ( void  )

Create index.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_create_idx.c.

◆ db_d_create_table()

int db_d_create_table ( void  )

Create table.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_create_tab.c.

◆ db_d_delete()

int db_d_delete ( void  )

Delete record (?)

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 25 of file d_delete.c.

◆ db_d_delete_database()

int db_d_delete_database ( void  )

Delete database.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_deletedb.c.

◆ db_d_describe_table()

int db_d_describe_table ( void  )

Describe table.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_desc_table.c.

◆ db_d_drop_column()

int db_d_drop_column ( void  )

Drop column.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_drop_col.c.

◆ db_d_drop_index()

int db_d_drop_index ( void  )

Drop index.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_drop_index.c.

◆ db_d_drop_table()

int db_d_drop_table ( void  )

Drop table.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_drop_tab.c.

◆ db_d_execute_immediate()

int db_d_execute_immediate ( void  )

Execute SQL statements.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_execute.c.

◆ db_d_fetch()

int db_d_fetch ( void  )

Fetch data.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 28 of file d_fetch.c.

◆ db_d_find_database()

int db_d_find_database ( void  )

Find database.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_finddb.c.

◆ db_d_get_num_rows()

int db_d_get_num_rows ( void  )

Get number of selected rows.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 25 of file d_rows.c.

◆ db_d_grant_on_table()

int db_d_grant_on_table ( void  )

Grant privileges on table.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_priv.c.

◆ db_d_init_error()

void db_d_init_error ( const char *  name)

Init error message for DB driver.

Initialize prefix

Parameters
namedriver name (eg. "SQLite"))

Definition at line 47 of file d_error.c.

References db_init_string(), G_debug(), G_malloc, and init().

◆ db_d_insert()

int db_d_insert ( void  )

Insert new record into table.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 25 of file d_insert.c.

◆ db_d_list_databases()

int db_d_list_databases ( void  )

List databases.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_listdb.c.

◆ db_d_list_indexes()

int db_d_list_indexes ( void  )

List indexes.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_list_idx.c.

◆ db_d_list_tables()

int db_d_list_tables ( void  )

List available tables for given connection.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 25 of file d_list_tabs.c.

◆ db_d_open_database()

int db_d_open_database ( void  )

Open database connection.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_opendb.c.

◆ db_d_open_insert_cursor()

int db_d_open_insert_cursor ( void  )

Open insert cursor.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 25 of file d_openinsert.c.

◆ db_d_open_select_cursor()

int db_d_open_select_cursor ( void  )

Open select cursor.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_openselect.c.

◆ db_d_open_update_cursor()

int db_d_open_update_cursor ( void  )

Open update cursor.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file d_openupdate.c.

◆ db_d_report_error()

void void db_d_report_error ( void  )

Report error message for DB driver.

Definition at line 90 of file d_error.c.

References db_append_string(), db_error(), db_get_string(), and init().

◆ db_d_update()

int db_d_update ( void  )

?

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 25 of file d_update.c.

◆ db_d_version()

int db_d_version ( void  )

Get version info.

Returns
DB_OK on success
DB_FAILED on failure

Definition at line 24 of file d_version.c.

◆ db_dbmscap_filename()

const char* db_dbmscap_filename ( void  )

Get dbmscap file name.

Returns
pointer to string with file name

Definition at line 59 of file dbmscap.c.

Referenced by db_read_dbmscap().

◆ db_debug()

void db_debug ( const char *  s)

Print debug message.

Parameters
sdebug message

Definition at line 228 of file db/dbmi_base/error.c.

◆ db_debug_off()

void db_debug_off ( void  )

Turn off debugging.

Definition at line 218 of file db/dbmi_base/error.c.

◆ db_debug_on()

void db_debug_on ( void  )

Turn on debugging.

Definition at line 210 of file db/dbmi_base/error.c.

◆ db_delete()

int db_delete ( dbCursor cursor)

Delete record (?)

Parameters
cursordb cursor
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file c_delete.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_DELETE, DB_RECV_RETURN_CODE, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, and _db_cursor::token.

◆ db_delete_database()

int db_delete_database ( dbDriver driver,
dbHandle handle 
)

Delete database.

Parameters
driverdb driver
handlehandle info
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 27 of file c_deletedb.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_DELETE_DATABASE, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_delete_table()

int db_delete_table ( const char *  drvname,
const char *  dbname,
const char *  tblname 
)

Delete table.

Parameters
drvnamedriver name
dbnamedatabase name
tblnametable name
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 29 of file delete_tab.c.

References _, db_append_string(), db_close_database_shutdown_driver(), db_execute_immediate(), DB_FAILED, db_get_string(), db_init_string(), DB_OK, db_set_string(), db_start_driver_open_database(), driver, G_debug(), G_warning(), and NULL.

◆ db_describe_table()

int db_describe_table ( dbDriver driver,
dbString name,
dbTable **  table 
)

Describe table.

Parameters
driverdb driver
nametable name
[out]tablepointer to dbTable structure
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 28 of file c_desc_table.c.

◆ db_dirent()

dbDirent* db_dirent ( const char *  dirname,
int *  n 
)

Read directory and build an array of dbDirent's.

Append one entry with name = NULL to mark end of array

Parameters
dirnamedirectory name
[out]nnumber of entities
Returns
pointer to dbDirent
NULL on error

Definition at line 57 of file dirent.c.

References count.

◆ db_double_quote_string()

void db_double_quote_string ( dbString src)

Replace each ' is replaced by ''.

Parameters
srcpointer to dbString

Definition at line 240 of file string.c.

◆ db_driver()

int db_driver ( int  ,
char **   
)

◆ db_driver_mkdir()

int db_driver_mkdir ( const char *  path,
int  mode,
int  parentdirs 
)

Create db directory.

Parameters
pathfull path
modemode
parentdirsparent directories
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 38 of file d_mkdir.c.

◆ db_drop_column()

int db_drop_column ( dbDriver driver,
dbString tableName,
dbString columnName 
)

Drop column.

Parameters
driverdb driver
tableNametable name
columnNamecolumn name to be dropped
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 28 of file c_drop_col.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_DROP_COLUMN, DB_RECV_RETURN_CODE, DB_SEND_STRING, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_drop_index()

int db_drop_index ( dbDriver driver,
dbString name 
)

Drop index.

Parameters
driverdb driver
nameindex name
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 27 of file c_drop_index.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_DROP_INDEX, DB_RECV_RETURN_CODE, DB_SEND_STRING, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_drop_table()

int db_drop_table ( dbDriver driver,
dbString name 
)

Drop table.

Parameters
driverdb driver
nametable name to be dropped
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 28 of file c_drop_tab.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_DROP_TABLE, DB_RECV_RETURN_CODE, DB_SEND_STRING, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_drop_token()

void db_drop_token ( dbToken  token)

Drop token.

Parameters
tokenpointer to dbToken

Definition at line 42 of file db/dbmi_base/token.c.

References count, and NONE.

Referenced by db_d_close_cursor().

◆ db_enlarge_string()

int db_enlarge_string ( dbString x,
int  len 
)

Enlarge dbString.

Parameters
xpointer to dbString
lenrequested string size
Returns
DB_OK on success
DB_MEMORY_ERR on error

Definition at line 120 of file string.c.

References DB_MEMORY_ERR, DB_OK, db_realloc(), _db_string::nalloc, NULL, and _db_string::string.

◆ db_error()

◆ db_execute_immediate()

int db_execute_immediate ( dbDriver driver,
dbString SQLstatement 
)

Execute SQL statements.

Parameters
driverdb driver
SQLstatementSQL statement (alter, update, ...)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 27 of file c_execute.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_EXECUTE_IMMEDIATE, DB_RECV_RETURN_CODE, DB_SEND_STRING, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

Referenced by db_delete_table(), and P_Drop_Aux_Table().

◆ db_fetch()

int db_fetch ( dbCursor cursor,
int  position,
int *  more 
)

Fetch data from open cursor.

Parameters
cursorpointer to dbCursor
positioncursor position
[out]moreget more (0 for no data to be fetched)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 28 of file c_fetch.c.

◆ db_find_database()

int db_find_database ( dbDriver driver,
dbHandle handle,
int *  found 
)

Find database.

Parameters
driverdb driver
handlehandle info
[out]foundif non-zero database found
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 29 of file c_finddb.c.

References db__set_protocol_fds(), db_free_handle(), db_get_handle_dbname(), db_get_handle_dbschema(), DB_OK, DB_PROC_FIND_DATABASE, DB_RECV_HANDLE, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, db_set_handle(), DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_find_token()

dbAddress db_find_token ( dbToken  token)

Find token.

Parameters
tokenpointer to dbToken
Returns
dbAddress
NULL if no token found

Definition at line 30 of file db/dbmi_base/token.c.

References count, and NONE.

Referenced by db_d_close_cursor(), db_d_delete(), db_d_get_num_rows(), db_d_insert(), and db_d_update().

◆ db_free()

◆ db_free_column()

void db_free_column ( dbColumn column)

Frees column structure.

Parameters
columnpointer to dbColumn

Definition at line 454 of file dbmi_base/column.c.

References _db_column::columnName, db_free_string(), _db_column::defaultValue, _db_column::description, _db_value::s, and _db_column::value.

Referenced by db_d_add_column().

◆ db_free_cursor()

void db_free_cursor ( dbCursor cursor)

Free allocated dbCursor.

Parameters
cursorpointer to dbCursor

Definition at line 51 of file cursor.c.

References _db_cursor::column_flags, db_free_cursor_column_flags(), db_free_table(), db_init_cursor(), and _db_cursor::table.

Referenced by db_close_cursor(), and db_d_close_cursor().

◆ db_free_cursor_column_flags()

void db_free_cursor_column_flags ( dbCursor cursor)

Free columns' flags of cursor.

Parameters
cursorpointer to dbCursor

Definition at line 295 of file cursor.c.

References _db_cursor::column_flags, db_free(), and NULL.

Referenced by db_free_cursor().

◆ db_free_dbmscap()

void db_free_dbmscap ( dbDbmscap list)

Free dbmscap.

Parameters
listpointer to dbDbmscap

Definition at line 259 of file dbmscap.c.

◆ db_free_dirent_array()

void db_free_dirent_array ( dbDirent dirent,
int  count 
)

Free dbDirent.

Parameters
direntpointer to dbDirent
countnumber of entities in the array

Definition at line 123 of file dirent.c.

References count, db_free(), db_free_string(), and name.

◆ db_free_handle()

void db_free_handle ( dbHandle handle)

Free dbHandle structure.

Parameters
handlepointer to dbHandle

Definition at line 79 of file handle.c.

References db_free_string(), _db_handle::dbName, and _db_handle::dbSchema.

Referenced by db_d_create_database(), db_d_delete_database(), db_d_find_database(), db_d_open_database(), db_find_database(), and db_free_handle_array().

◆ db_free_handle_array()

void db_free_handle_array ( dbHandle handle,
int  count 
)

Free array of handles.

Parameters
handlepointer to first dbHandle in the array
countnumber of handles in the array

Definition at line 91 of file handle.c.

References count, db_free(), and db_free_handle().

◆ db_free_index()

void db_free_index ( dbIndex index)

Free allocated dbIndex.

Parameters
indexpointer to dbIndex to be freed

Definition at line 39 of file db/dbmi_base/index.c.

References _db_index::columnNames, db_free_string(), db_free_string_array(), db_init_index(), _db_index::indexName, _db_index::numColumns, and _db_index::tableName.

Referenced by db_create_index2(), db_d_create_index(), and db_free_index_array().

◆ db_free_index_array()

void db_free_index_array ( dbIndex list,
int  count 
)

Free index array.

Parameters
listdbIndex array
countnumber of items in the array

Definition at line 92 of file db/dbmi_base/index.c.

References count, db_free(), and db_free_index().

Referenced by db_d_list_indexes().

◆ db_free_string()

◆ db_free_string_array()

void db_free_string_array ( dbString a,
int  n 
)

Free allocated dbString array.

Parameters
apointer to 1st dbString in the array
nnumber of items in array

Definition at line 163 of file string.c.

Referenced by db_free_index().

◆ db_free_table()

void db_free_table ( dbTable table)

Free the table.

Parameters
tablepointer to dbTable

Definition at line 68 of file dbmi_base/table.c.

Referenced by db_free_cursor().

◆ db_get_column()

int db_get_column ( dbDriver Driver,
const char *  tname,
const char *  cname,
dbColumn **  Column 
)

Get column structure by table and column name.

Column is set to new dbColumn structure or NULL if column was not found

Parameters
DriverDB driver
tnametable name
cnamecolumn name
[out]Columncolumn structure to store within
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 124 of file dbmi_client/column.c.

◆ db_get_column_default_value()

dbValue* db_get_column_default_value ( dbColumn column)

Returns column default value for given column structure.

Parameters
columnpointer to dbColumn
Returns
pointer to dbValue

Definition at line 39 of file dbmi_base/column.c.

References _db_column::defaultValue.

Referenced by db__recv_column_default_value(), db__send_column_default_value(), db_convert_column_default_value_to_string(), and db_convert_Cstring_to_column_default_value().

◆ db_get_column_description()

const char* db_get_column_description ( dbColumn column)

Returns column description for given column.

Parameters
columnpointer to dbColumn
Returns
pointer to string with column's description

Definition at line 444 of file dbmi_base/column.c.

References db_get_string(), and _db_column::description.

Referenced by db_print_column_definition().

◆ db_get_column_host_type()

int db_get_column_host_type ( dbColumn column)

Get column host type.

Parameters
columnpointer to dbColumn
Returns
data type (see include/dbmi.h)

Definition at line 154 of file dbmi_base/column.c.

References _db_column::hostDataType.

◆ db_get_column_length()

int db_get_column_length ( dbColumn column)

Get column's length.

Parameters
columnpointer to dbColumn
Returns
length

Definition at line 303 of file dbmi_base/column.c.

References _db_column::dataLen.

Referenced by db_print_column_definition().

◆ db_get_column_name()

const char* db_get_column_name ( dbColumn column)

Returns column name for given column.

Parameters
columnpointer to dbColumn
Returns
pointer to string with column name

Definition at line 418 of file dbmi_base/column.c.

References _db_column::columnName, and db_get_string().

Referenced by db_print_column_definition().

◆ db_get_column_precision()

int db_get_column_precision ( dbColumn column)

Get column precision.

Parameters
columnpointer to dbColumn
Returns
precision

Definition at line 117 of file dbmi_base/column.c.

References _db_column::precision.

Referenced by db_print_column_definition().

◆ db_get_column_scale()

int db_get_column_scale ( dbColumn column)

Get column scale.

Parameters
columnpointer to dbColumn
Returns
scale

Definition at line 94 of file dbmi_base/column.c.

References _db_column::scale.

Referenced by db_print_column_definition().

◆ db_get_column_select_priv()

int db_get_column_select_priv ( dbColumn column)

Get select privileges.

Parameters
columnpointer to dbColumn
Returns
privileges

Definition at line 346 of file dbmi_base/column.c.

References _db_column::select.

◆ db_get_column_sqltype()

int db_get_column_sqltype ( dbColumn column)

Returns column sqltype for column.

The function db_sqltype_name() returns sqltype description.

Parameters
columnpointer to dbColumn
Returns
sql data type (see include/dbmi.h)

Definition at line 142 of file dbmi_base/column.c.

References _db_column::sqlDataType.

Referenced by db__recv_column_default_value(), db__recv_column_value(), db__send_column_default_value(), db__send_column_value(), db_convert_column_default_value_to_string(), db_convert_column_value_to_string(), db_convert_Cstring_to_column_default_value(), db_convert_Cstring_to_column_value(), and db_print_column_definition().

◆ db_get_column_update_priv()

int db_get_column_update_priv ( dbColumn column)

Get update privileges.

Parameters
columnpointer to dbColumn
Returns
privileges

Definition at line 378 of file dbmi_base/column.c.

References _db_column::update.

◆ db_get_column_value()

dbValue* db_get_column_value ( dbColumn column)

Returns column value for given column structure.

Parameters
columnpointer to dbColumn
Returns
pointer to dbValue

Definition at line 27 of file dbmi_base/column.c.

References _db_column::value.

Referenced by db__recv_column_value(), db__send_column_value(), db_convert_column_value_to_string(), and db_convert_Cstring_to_column_value().

◆ db_get_connection()

int db_get_connection ( dbConnection connection)

Get default DB connection settings for the current mapset.

Parameters
[out]connectionpointer to dbConnection to be modified
Returns
DB_OK
DB_FAILED

Definition at line 73 of file db/dbmi_base/connect.c.

References _db_connection::databaseName, DB_FAILED, db_get_login2(), DB_OK, _db_connection::driverName, G_getenv_nofatal2(), G_VAR_MAPSET, G_zero(), _db_connection::group, _db_connection::hostName, NULL, _db_connection::password, _db_connection::port, _db_connection::schemaName, and _db_connection::user.

◆ db_get_cursor_number_of_columns()

int db_get_cursor_number_of_columns ( dbCursor cursor)

Get number of columns.

Parameters
cursorpointer to dbCursor

Definition at line 394 of file cursor.c.

Referenced by db_bind_update().

◆ db_get_cursor_table()

dbTable* db_get_cursor_table ( dbCursor cursor)

Get table allocated by cursor.

Parameters
cursorpointer to dbCursor
Returns
pointer to dbTable

Definition at line 67 of file cursor.c.

References _db_cursor::table.

Referenced by db_open_insert_cursor().

◆ db_get_cursor_token()

dbToken db_get_cursor_token ( dbCursor cursor)

Get cursor token.

Parameters
cursorpointer to dbCursor
Returns
pointer to dbToken

Definition at line 90 of file cursor.c.

References _db_cursor::token.

◆ db_get_default_database_name()

const char* db_get_default_database_name ( void  )

Get database name from current DB connection settings.

Returns
pointer to database name
NULL if not set

Definition at line 43 of file db/dbmi_base/default_name.c.

References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.

◆ db_get_default_driver_name()

const char* db_get_default_driver_name ( void  )

Get driver name from current DB connection settings.

Returns
pointer to driver name
NULL if not set

Definition at line 27 of file db/dbmi_base/default_name.c.

References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.

◆ db_get_default_group_name()

const char* db_get_default_group_name ( void  )

Get group name from current DB connection settings.

Returns
pointer to group name
NULL if not set

Definition at line 75 of file db/dbmi_base/default_name.c.

References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.

◆ db_get_default_schema_name()

const char* db_get_default_schema_name ( void  )

Get schema name from current DB connection settings.

Returns
pointer to schema name
NULL if not set

Definition at line 59 of file db/dbmi_base/default_name.c.

References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.

◆ db_get_error_code()

int db_get_error_code ( void  )

Get error code.

Returns
DB_OK if not defined

Definition at line 126 of file db/dbmi_base/error.c.

Referenced by db__recv_index_array(), and db_set_index_column_name().

◆ db_get_error_msg()

const char* db_get_error_msg ( void  )

Get error message.

Returns
pointer to error message string

Definition at line 239 of file db/dbmi_base/error.c.

Referenced by db__send_failure().

◆ db_get_error_who()

const char* db_get_error_who ( void  )

brief Get 'who' string

Returns
pointer to string buffer
empty buffer if 'who' is not defined

Definition at line 59 of file db/dbmi_base/error.c.

◆ db_get_handle_dbname()

const char* db_get_handle_dbname ( dbHandle handle)

Get handle database name.

Parameters
handlepointer to dbHandle
Returns
pointer to string with database name

Definition at line 57 of file handle.c.

References db_get_string(), and _db_handle::dbName.

Referenced by db_d_open_database(), and db_find_database().

◆ db_get_handle_dbschema()

const char* db_get_handle_dbschema ( dbHandle handle)

Get handle schema name.

Parameters
handlepointer to dbHandle
Returns
pointer to string with schema name

Definition at line 69 of file handle.c.

References db_get_string(), and _db_handle::dbSchema.

Referenced by db_d_open_database(), and db_find_database().

◆ db_get_index_column_name()

const char* db_get_index_column_name ( dbIndex index,
int  column_num 
)

Get column number.

Parameters
indexpointer to dbIndex
column_numcolumn number
Returns
string buffer with name

Definition at line 194 of file db/dbmi_base/index.c.

References _, _db_index::columnNames, db_error(), db_get_string(), NULL, and _db_index::numColumns.

Referenced by db_print_index().

◆ db_get_index_name()

const char* db_get_index_name ( dbIndex index)

Get index name.

Parameters
indexpointer to dbIndex
Returns
string buffer with name

Definition at line 124 of file db/dbmi_base/index.c.

References db_get_string(), and _db_index::indexName.

Referenced by db_print_index().

◆ db_get_index_number_of_columns()

int db_get_index_number_of_columns ( dbIndex index)

Get number of columns.

Parameters
indexpointer to dbIndex
Returns
number of columns

Definition at line 162 of file db/dbmi_base/index.c.

References _db_index::numColumns.

Referenced by db_print_index().

◆ db_get_index_table_name()

const char* db_get_index_table_name ( dbIndex index)

Get table name.

Parameters
indexpointer to dbIndex
Returns
string buffer with name

Definition at line 150 of file db/dbmi_base/index.c.

References db_get_string(), and _db_index::tableName.

Referenced by db_print_index().

◆ db_get_login()

int db_get_login ( const char *  driver,
const char *  database,
const char **  user,
const char **  password 
)

Get login parameters for driver/database.

If driver/database is not found, output arguments are set to NULL.

Deprecated:
Use db_set_login2() instead.
Todo:
: GRASS 8: to be replaced by db_set_login2().
Parameters
driverdriver name
databasedatabase name (can be NULL)
[out]username
[out]passwordstring
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 357 of file login.c.

◆ db_get_login2()

int db_get_login2 ( const char *  driver,
const char *  database,
const char **  user,
const char **  password,
const char **  host,
const char **  port 
)

Get login parameters for driver/database.

If driver/database is not found, output arguments are set to NULL.

Parameters
driverdriver name
databasedatabase name (can be NULL)
[out]username
[out]passwordstring
[out]hostname
[out]port
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 379 of file login.c.

Referenced by db_get_connection().

◆ db_get_login_dump()

int db_get_login_dump ( FILE *  fd)

Print all connection settings to file.

Parameters
fdfile where to print settings
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 394 of file login.c.

References G_debug().

◆ db_get_num_rows()

int db_get_num_rows ( dbCursor cursor)

Get number of selected rows.

Parameters
cursordb select cursor
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file c_rows.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_ROWS, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, and _db_cursor::token.

Referenced by db_get_table_number_of_rows().

◆ db_get_string()

◆ db_get_table_column()

dbColumn* db_get_table_column ( dbTable table,
int  idx 
)

Returns column structure for given table and column number.

Parameters
tablepointer to dbTable
idxcolumn index (starting with '0')
Returns
pointer to dbColumn
NULL if not found

Definition at line 307 of file dbmi_base/table.c.

References _db_table::columns, NULL, and _db_table::numColumns.

Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().

◆ db_get_table_column_by_name()

dbColumn* db_get_table_column_by_name ( dbTable table,
const char *  name 
)

Returns column structure for given table and column name.

Parameters
tablepointer to dbTable
namethe name of the column
Returns
pointer to dbColumn
NULL if not found

Definition at line 323 of file dbmi_base/table.c.

◆ db_get_table_delete_priv()

int db_get_table_delete_priv ( dbTable table)

Get table delete privileges.

Parameters
tablepointer to dbTable
Returns
privileges

Definition at line 293 of file dbmi_base/table.c.

References _db_table::priv_delete.

◆ db_get_table_description()

const char* db_get_table_description ( dbTable table)

Get the description of the table.

Parameters
tablepointer to dbTable
Returns
description of the table

Definition at line 126 of file dbmi_base/table.c.

◆ db_get_table_insert_priv()

int db_get_table_insert_priv ( dbTable table)

Get table insert privileges.

Parameters
tablepointer to dbTable
Returns
prilileges

Definition at line 261 of file dbmi_base/table.c.

References _db_table::priv_insert.

◆ db_get_table_name()

const char* db_get_table_name ( dbTable table)

Get the name of the table.

Parameters
tablepointer to dbTable
Returns
name of the table

Definition at line 101 of file dbmi_base/table.c.

◆ db_get_table_number_of_columns()

int db_get_table_number_of_columns ( dbTable table)

Return the number of columns of the table.

Parameters
tablepointer to dbTable
Returns
number of columns

Definition at line 138 of file dbmi_base/table.c.

◆ db_get_table_number_of_rows()

int db_get_table_number_of_rows ( dbDriver driver,
dbString sql 
)

Get number of rows of table.

Parameters
driverdb driver
sqlSQL statement
Returns
number of records
-1

Definition at line 104 of file dbmi_client/table.c.

References _, db_close_cursor(), db_close_database_shutdown_driver(), db_get_num_rows(), db_get_string(), DB_OK, db_open_select_cursor(), DB_SEQUENTIAL, and G_warning().

◆ db_get_table_select_priv()

int db_get_table_select_priv ( dbTable table)

Get table select privileges.

Parameters
tablepointer to dbTable
Returns
privileges

Definition at line 197 of file dbmi_base/table.c.

◆ db_get_table_update_priv()

int db_get_table_update_priv ( dbTable table)

Get table update privileges.

Parameters
tablepointer to dbTable
Returns
privileges

Definition at line 229 of file dbmi_base/table.c.

◆ db_get_value_as_double()

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.

Parameters
valuepointer to dbValue
ctypeC data type
Returns
value

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().

◆ db_get_value_day()

int db_get_value_day ( dbValue value)

Get day value.

Parameters
valuepointer to dbValue
Returns
value

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().

◆ db_get_value_double()

double db_get_value_double ( dbValue value)

Get double precision value.

Parameters
valuepointer to dbValue
Returns
value

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().

◆ db_get_value_hour()

int db_get_value_hour ( dbValue value)

Get hour value.

Parameters
valuepointer to dbValue
Returns
value

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().

◆ db_get_value_int()

int db_get_value_int ( dbValue value)

Get integer value.

Parameters
valuepointer to dbValue
Returns
value

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().

◆ db_get_value_minute()

int db_get_value_minute ( dbValue value)

Get minute value.

Parameters
valuepointer to dbValue
Returns
value

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().

◆ db_get_value_month()

int db_get_value_month ( dbValue value)

Get month value.

Parameters
valuepointer to dbValue
Returns
value

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().

◆ db_get_value_seconds()

double db_get_value_seconds ( dbValue value)

Get seconds value.

Parameters
valuepointer to dbValue
Returns
value

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().

◆ db_get_value_string()

const char* db_get_value_string ( dbValue value)

Get string value.

Parameters
valuepointer to dbValue
Returns
value

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().

◆ db_get_value_year()

int db_get_value_year ( dbValue value)

Get year value.

Parameters
valuepointer to dbValue
Returns
value

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().

◆ db_grant_on_table()

int db_grant_on_table ( dbDriver driver,
const char *  tableName,
int  priv,
int  to 
)

Grant privileges on table.

Parameters
driverdb driver
tableNametable name
privprivileges DB_PRIV_SELECT
togrant to DB_GROUP | DB_PUBLIC
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 29 of file c_priv.c.

References db__set_protocol_fds(), db_free_string(), db_init_string(), DB_OK, DB_PROC_GRANT_ON_TABLE, DB_RECV_RETURN_CODE, DB_SEND_INT, DB_SEND_STRING, db_set_string(), DB_START_PROCEDURE_CALL, name, _db_driver::recv, and _db_driver::send.

◆ db_gversion()

int db_gversion ( dbDriver driver,
dbString client_version,
dbString driver_version 
)

Get version info.

Note: renamed from db_version to db_gversion to avoid name conflict with Berkeley DB etc.

Parameters
driverdb driver
[out]client_versionclient version
[out]driver_versiondriver version
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 31 of file c_version.c.

References db__set_protocol_fds(), db_init_string(), DB_OK, DB_PROC_VERSION, DB_RECV_RETURN_CODE, DB_RECV_STRING, db_set_string(), DB_START_PROCEDURE_CALL, DB_VERSION, _db_driver::recv, and _db_driver::send.

◆ db_has_dbms()

int db_has_dbms ( void  )

Check dbms.

Returns
1 if true
0 if false

Definition at line 70 of file dbmscap.c.

◆ db_init_column()

void db_init_column ( dbColumn column)

Initialize dbColumn.

Parameters
columnpointer to dbColumn to be initialized

Definition at line 388 of file dbmi_base/column.c.

References db_init_string(), and db_zero().

Referenced by db_d_add_column().

◆ db_init_cursor()

void db_init_cursor ( dbCursor cursor)

Initialize dbCursor.

Parameters
cursorpointer to dbCursor to be initialized

Definition at line 23 of file cursor.c.

References G_zero(), and _db_cursor::token.

Referenced by db_free_cursor().

◆ db_init_handle()

void db_init_handle ( dbHandle handle)

Initialize handle (i.e database/schema)

Parameters
handlepointer to dbHandle to be initialized

Definition at line 23 of file handle.c.

References db_init_string(), _db_handle::dbName, and _db_handle::dbSchema.

Referenced by db_alloc_handle_array(), db_d_create_database(), db_d_delete_database(), db_d_find_database(), db_d_open_database(), and db_start_driver_open_database().

◆ db_init_index()

void db_init_index ( dbIndex index)

Initialize dbIndex.

Parameters
indexpointer to dbIndex to be initialized

Definition at line 25 of file db/dbmi_base/index.c.

References _db_index::columnNames, db_init_string(), _db_index::indexName, NULL, _db_index::numColumns, _db_index::tableName, and _db_index::unique.

Referenced by db_alloc_index_array(), db_create_index2(), db_d_create_index(), and db_free_index().

◆ db_init_string()

◆ db_init_table()

void db_init_table ( dbTable table)

Initialize the table to zero.

Parameters
tablepointer to dbTable

Definition at line 56 of file dbmi_base/table.c.

◆ db_insert()

int db_insert ( dbCursor cursor)

Insert new record into table.

Parameters
cursordb cursor
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file c_insert.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_INSERT, DB_RECV_RETURN_CODE, DB_SEND_TABLE_DATA, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, _db_cursor::table, and _db_cursor::token.

◆ db_interval_range()

void db_interval_range ( int  sqltype,
int *  from,
int *  to 
)

Define range based on SQL data type.

Parameters
sqltypeSQL data type
[out]from
[out]to

Definition at line 24 of file interval.c.

References DB_DAY, DB_FRACTION, DB_HOUR, DB_MINUTE, DB_MONTH, DB_SECOND, DB_SQL_TYPE_DATE, DB_SQL_TYPE_TIME, and DB_YEAR.

Referenced by db_convert_Cstring_to_value_datetime(), db_convert_value_datetime_into_string(), and db_sqltype_name().

◆ db_isdir()

int db_isdir ( const char *  path)

Test if path is a directory.

Parameters
pathpathname
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 29 of file isdir.c.

References DB_FAILED, and DB_OK.

◆ db_legal_tablename()

int db_legal_tablename ( const char *  s)

Check if output is legal table name.

Rule: [A-Za-z][A-Za-z0-9_@]*

Parameters
stable name to be checked
Returns
1 OK
-1 if name does not start with letter A..Za..z or if name does not continue with A..Za..z0..9_@

Definition at line 31 of file legal_dbname.c.

◆ db_list_databases()

int db_list_databases ( dbDriver driver,
dbString path,
int  npaths,
dbHandle **  handles,
int *  count 
)

List databases.

Parameters
driverdb driver
pathdb path
npathsnumber of given paths
[out]handleshandle infos
[out]countnumber of handle infos
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 30 of file c_listdb.c.

◆ db_list_drivers()

const char* db_list_drivers ( void  )

Return comma separated list of existing DB drivers, used for driver parameter options.

Returns
list of db drivers

Definition at line 22 of file c_list_drivers.c.

References list.

◆ db_list_indexes()

int db_list_indexes ( dbDriver driver,
dbString table_name,
dbIndex **  list,
int *  count 
)

List indexes.

Parameters
driverdb driver
table_nametable name
[out]listlist of db indexes
[out]dbDrivernumber of items in the list
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 29 of file c_list_idx.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_LIST_INDEXES, DB_RECV_INDEX_ARRAY, DB_RECV_RETURN_CODE, DB_SEND_STRING, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_list_tables()

int db_list_tables ( dbDriver driver,
dbString **  names,
int *  count,
int  system 
)

List available tables for given connection.

Parameters
driverdb driver
[out]nameslist of table names
[out]countnumber of items in the list
system?
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 39 of file c_list_tabs.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_LIST_TABLES, DB_RECV_RETURN_CODE, DB_RECV_STRING_ARRAY, DB_SEND_INT, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

◆ db_malloc()

void* db_malloc ( int  n)

Allocate memory.

On failure is called db_memory_error().

Parameters
nnumber of bytes to be allocated
Returns
pointer to allocated memory

Definition at line 47 of file db/dbmi_base/alloc.c.

◆ db_memory_error()

void db_memory_error ( void  )

Report memory error.

Definition at line 134 of file db/dbmi_base/error.c.

References _, and db_error().

◆ db_new_token()

dbToken db_new_token ( dbAddress  address)

Add new token.

Parameters
addressdbAddress of token to be added
Returns
dbToken

Definition at line 55 of file db/dbmi_base/token.c.

References count, db_realloc(), list, NONE, and NULL.

◆ db_nocase_compare()

int db_nocase_compare ( const char *  a,
const char *  b 
)

Compare strings case-insensitive.

Parameters
a,bstring buffers to be compared
Returns
0 strings equal
1 otherwise

Definition at line 69 of file case.c.

Referenced by db_convert_Cstring_to_value_datetime().

◆ db_noproc_error()

void db_noproc_error ( int  procnum)

Report no procedure error.

Parameters
procnumprocedure number

Definition at line 159 of file db/dbmi_base/error.c.

References _, and db_error().

Referenced by db__start_procedure_call().

◆ db_open_database()

int db_open_database ( dbDriver driver,
dbHandle handle 
)

Open database connection.

Parameters
driverdb driver
handlehandle info (database and schema name)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 27 of file c_opendb.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_OPEN_DATABASE, DB_RECV_RETURN_CODE, DB_SEND_HANDLE, DB_START_PROCEDURE_CALL, _db_driver::recv, and _db_driver::send.

Referenced by db_start_driver_open_database().

◆ db_open_insert_cursor()

int db_open_insert_cursor ( dbDriver driver,
dbCursor cursor 
)

Open insert cursor.

Parameters
driverdb driver
cursorcursor to be opened
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 27 of file c_openinsert.c.

References db__set_protocol_fds(), db_get_cursor_table(), DB_OK, DB_PROC_OPEN_INSERT_CURSOR, DB_RECV_INT, DB_RECV_RETURN_CODE, DB_RECV_TOKEN, DB_SEND_TABLE_DEFINITION, DB_START_PROCEDURE_CALL, driver, _db_cursor::driver, _db_cursor::mode, _db_driver::recv, _db_driver::send, _db_cursor::token, and _db_cursor::type.

◆ db_open_select_cursor()

int db_open_select_cursor ( dbDriver driver,
dbString select,
dbCursor cursor,
int  mode 
)

Open select cursor.

Open modes:

  • DB_SEQUENTIAL

Data can be fetched by db_fetch().

Cursor should be closed by db_close_cursor().

Parameters
driverpointer to dbDriver
selectSQL select statement (pointer to dbString)
cursorpointer to dbCursor to be opened
modeopen mode
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 37 of file c_openselect.c.

Referenced by db_get_table_number_of_rows().

◆ db_open_update_cursor()

int db_open_update_cursor ( dbDriver driver,
dbString table_name,
dbString select,
dbCursor cursor,
int  mode 
)

Open update cursor.

Parameters
driverdb driver
table_nametable name
selectSQL update statement (?)
cursordb cursor to be opened
modeopen mode (?)
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 30 of file c_openupdate.c.

◆ db_print_column_definition()

void db_print_column_definition ( FILE *  fd,
dbColumn column 
)

◆ db_print_error()

void db_print_error ( void  )

Print error.

If not defined, the error message is printed to stderr.

Definition at line 183 of file db/dbmi_base/error.c.

◆ db_print_index()

void db_print_index ( FILE *  fd,
dbIndex index 
)

Report index.

Parameters
fdfile where to print index info
indexpointer to dbIndex

Definition at line 254 of file db/dbmi_base/index.c.

References db_get_index_column_name(), db_get_index_name(), db_get_index_number_of_columns(), db_get_index_table_name(), and db_test_index_type_unique().

◆ db_print_table_definition()

void db_print_table_definition ( FILE *  fd,
dbTable table 
)

Print table definition info.

Parameters
fdfile descriptor
tabletable info

Definition at line 26 of file printtab.c.

◆ db_procedure_not_implemented()

◆ db_protocol_error()

void db_protocol_error ( void  )

◆ db_read_dbmscap()

dbDbmscap* db_read_dbmscap ( void  )

Read dbmscap.

dbmscap file was used in grass5.0 but it is not used in grass5.7 until we find it necessary. All code for dbmscap file is commented here.

Instead of in dbmscap file db_read_dbmscap() searches for available dbmi drivers in /driver/db/

Returns
pointer to dbDbmscap

Definition at line 100 of file dbmscap.c.

References db_dbmscap_filename(), db_syserror(), and NULL.

◆ db_realloc()

void* db_realloc ( void *  s,
int  n 
)

Reallocate memory.

On failure is called db_memory_error().

Parameters
spointer to memory
nnumber of newly allocated bytes
Returns
pointer to allocated memmory

Definition at line 93 of file db/dbmi_base/alloc.c.

Referenced by db__add_cursor_to_driver_state(), db_append_table_column(), db_enlarge_string(), and db_new_token().

◆ db_select_CatValArray()

int db_select_CatValArray ( dbDriver driver,
const char *  tab,
const char *  key,
const char *  col,
const char *  where,
dbCatValArray cvarr 
)

Select pairs key/value to array, values are sorted by key (must be integer)

Parameters
driverDB driver
tabtable name
keykey column name
colvalue column name
[out]cvarrdbCatValArray to store within
Returns
number of selected values
-1 on error

Definition at line 268 of file db/dbmi_client/select.c.

◆ db_select_int()

int db_select_int ( dbDriver driver,
const char *  tab,
const char *  col,
const char *  where,
int **  pval 
)

Select array of ordered integers from table/column.

Parameters
driverDB driver
tabtable name
colcolumn name
wherewhere statement
[out]pvalarray of ordered integer values
Returns
number of selected values
-1 on error

Definition at line 103 of file db/dbmi_client/select.c.

Referenced by Vect_cats_set_constraint().

◆ db_select_value()

int db_select_value ( dbDriver driver,
const char *  tab,
const char *  key,
int  id,
const char *  col,
dbValue val 
)

Select one (first) value from table/column for key/id.

Parameters
driverDB driver
tabtable name
keykey column name
ididentifier in key column
colname of column to select the value from
[out]valdbValue to store within
Returns
number of selected values
-1 on error

Definition at line 204 of file db/dbmi_client/select.c.

◆ db_set_column_description()

int db_set_column_description ( dbColumn column,
const char *  description 
)

Set column description.

Parameters
columnpointer to dbColumn
descriptioncolumn's description
Returns
DB_OK on success
error code on failure

Definition at line 432 of file dbmi_base/column.c.

References db_set_string(), and _db_column::description.

◆ db_set_column_has_defined_default_value()

void db_set_column_has_defined_default_value ( dbColumn column)

Set default value identificator.

Parameters
columnpointer to dbColumn

Definition at line 164 of file dbmi_base/column.c.

References _db_column::hasDefaultValue.

◆ db_set_column_has_undefined_default_value()

void db_set_column_has_undefined_default_value ( dbColumn column)

Unset default value identificator.

Todo:
Replace by db_unset_column_has_default_value() ?
Parameters
columnpointer to dbColumn

Definition at line 176 of file dbmi_base/column.c.

References _db_column::hasDefaultValue.

◆ db_set_column_host_type()

void db_set_column_host_type ( dbColumn column,
int  type 
)

Set column host data type.

Parameters
columnpointer to dbColumn
typedata type

Definition at line 82 of file dbmi_base/column.c.

◆ db_set_column_length()

void db_set_column_length ( dbColumn column,
int  length 
)

Set column's length.

Parameters
columnpointer to dbColumn
lengthvalue

Definition at line 314 of file dbmi_base/column.c.

References _db_column::dataLen.

◆ db_set_column_name()

int db_set_column_name ( dbColumn column,
const char *  name 
)

Set column name.

Parameters
columnpointer to dbColumn
namecolumn name
Returns
DB_OK on success
error code on failure

Definition at line 406 of file dbmi_base/column.c.

References _db_column::columnName, and db_set_string().

Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().

◆ db_set_column_null_allowed()

void db_set_column_null_allowed ( dbColumn column)

Set null value to be allowed.

Parameters
columnpointer to dbColumn

Definition at line 268 of file dbmi_base/column.c.

References _db_column::nullAllowed.

◆ db_set_column_precision()

void db_set_column_precision ( dbColumn column,
int  precision 
)

Set column precision.

Parameters
columnpointer to dbColumn
precisionvalue

Definition at line 128 of file dbmi_base/column.c.

References _db_column::precision.

◆ db_set_column_scale()

void db_set_column_scale ( dbColumn column,
int  scale 
)

Set column scale.

Parameters
columnpointer to dbColumn
scalecolumn scale value

Definition at line 105 of file dbmi_base/column.c.

◆ db_set_column_select_priv_granted()

void db_set_column_select_priv_granted ( dbColumn column)

Set select privileges to be granted.

Parameters
columnpointer to dbColumn

Definition at line 324 of file dbmi_base/column.c.

References DB_GRANTED, and _db_column::select.

◆ db_set_column_select_priv_not_granted()

void db_set_column_select_priv_not_granted ( dbColumn column)

Unset select privileges.

Parameters
columnpointer to dbColumn

Definition at line 334 of file dbmi_base/column.c.

References DB_NOT_GRANTED, and _db_column::select.

◆ db_set_column_sqltype()

void db_set_column_sqltype ( dbColumn column,
int  sqltype 
)

Define column sqltype for column.

The function db_sqltype_name() returns sqltype description.

#define DB_SQL_TYPE_UNKNOWN 0
#define DB_SQL_TYPE_CHARACTER 1
#define DB_SQL_TYPE_SMALLINT 2
#define DB_SQL_TYPE_INTEGER 3
#define DB_SQL_TYPE_REAL 4
#define DB_SQL_TYPE_DOUBLE_PRECISION 6
#define DB_SQL_TYPE_DECIMAL 7
#define DB_SQL_TYPE_NUMERIC 8
#define DB_SQL_TYPE_DATE 9
#define DB_SQL_TYPE_TIME 10
#define DB_SQL_TYPE_TIMESTAMP 11
#define DB_SQL_TYPE_INTERVAL 12
#define DB_SQL_TYPE_TEXT 13
#define DB_SQL_TYPE_SERIAL 21
Parameters
columnpointer to dbColumn
sqltypeSQL data type (see list)

Definition at line 71 of file dbmi_base/column.c.

References _db_column::sqlDataType.

Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().

◆ db_set_column_update_priv_granted()

void db_set_column_update_priv_granted ( dbColumn column)

Set update privileges to be granted.

Parameters
columnpointer to dbColumn

Definition at line 356 of file dbmi_base/column.c.

References DB_GRANTED, and _db_column::update.

◆ db_set_column_update_priv_not_granted()

void db_set_column_update_priv_not_granted ( dbColumn column)

Unset update privileges.

Parameters
columnpointer to dbColumn

Definition at line 366 of file dbmi_base/column.c.

References DB_NOT_GRANTED, and _db_column::update.

◆ db_set_column_use_default_value()

void db_set_column_use_default_value ( dbColumn column)

Set default value to be used.

Parameters
columnpointer to dbColumn

Definition at line 235 of file dbmi_base/column.c.

References _db_column::useDefaultValue.

◆ db_set_connection()

int db_set_connection ( dbConnection connection)

Set default DB connection settings.

This function sets environmental variables as DB_DRIVER, DB_DATABASE, DB_SCHEMA, DB_GROUP.

Parameters
connectionpointer to dbConnection with default settings
Returns
DB_OK

Definition at line 28 of file db/dbmi_base/connect.c.

References _db_connection::databaseName, DB_OK, _db_connection::driverName, G_setenv2(), G_unsetenv2(), G_VAR_MAPSET, _db_connection::group, and _db_connection::schemaName.

Referenced by db_set_default_connection().

◆ db_set_cursor_column_flag()

void db_set_cursor_column_flag ( dbCursor cursor,
int  col 
)

Set column's flag.

Parameters
cursorpointer to dbCursor
colcolumn index (starting with '0')

Definition at line 357 of file cursor.c.

References _db_cursor::column_flags.

Referenced by db_set_cursor_column_for_update().

◆ db_set_cursor_column_for_update()

void db_set_cursor_column_for_update ( dbCursor cursor,
int  col 
)

Set Column flag to 'update'.

Parameters
cursorpointer to dbCursor
colcolumn index (starting with '0')

Definition at line 308 of file cursor.c.

References db_set_cursor_column_flag().

◆ db_set_cursor_mode()

void db_set_cursor_mode ( dbCursor cursor,
int  mode 
)

Set cursor mode.

Modes:

  • DB_SCROLL
  • DB_INSENSITIVE
Parameters
cursorpointer to dbCursor
modecursor mode

Definition at line 187 of file cursor.c.

◆ db_set_cursor_mode_insensitive()

void db_set_cursor_mode_insensitive ( dbCursor cursor)

Set 'intensive' cursor mode.

Parameters
cursorpointer to dbCursor

Definition at line 227 of file cursor.c.

References DB_INSENSITIVE, and _db_cursor::mode.

◆ db_set_cursor_mode_scroll()

void db_set_cursor_mode_scroll ( dbCursor cursor)

Set 'scroll' cursor mode.

Parameters
cursorpointer to dbCursor

Definition at line 197 of file cursor.c.

References DB_SCROLL, and _db_cursor::mode.

◆ db_set_cursor_table()

void db_set_cursor_table ( dbCursor cursor,
dbTable table 
)

Set table for given cursor.

Parameters
cursorpointer to dbCursor
tablepointer to dbTable

Definition at line 78 of file cursor.c.

◆ db_set_cursor_token()

void db_set_cursor_token ( dbCursor cursor,
dbToken  token 
)

Set cursor token.

Parameters
cursorpointer to dbCursor
tokenpointer to dbToken

Definition at line 101 of file cursor.c.

References _db_cursor::token.

◆ db_set_cursor_type_insert()

void db_set_cursor_type_insert ( dbCursor cursor)

Set cursor to be writable (insert)

Parameters
cursorpointer to dbCursor

Definition at line 131 of file cursor.c.

References DB_INSERT, and _db_cursor::type.

◆ db_set_cursor_type_readonly()

void db_set_cursor_type_readonly ( dbCursor cursor)

Set cursor to be read-only (select)

Parameters
cursorpointer to dbCursor

Definition at line 111 of file cursor.c.

References DB_READONLY, and _db_cursor::type.

◆ db_set_cursor_type_update()

void db_set_cursor_type_update ( dbCursor cursor)

Set cursor to be writable (update)

Parameters
cursorpointer to dbCursor

Definition at line 121 of file cursor.c.

References DB_UPDATE, and _db_cursor::type.

◆ db_set_default_connection()

int db_set_default_connection ( void  )

Sets up database connection settings using GRASS default from dbmi.h.

This function ignores current DB connection settings and uses GRASS default settings instead.

Todo:
DB_OK on success, DB_* error code on fail
Returns
returns DB_OK

Definition at line 95 of file db/dbmi_base/default_name.c.

References _, _db_connection::databaseName, DB_DEFAULT_DRIVER, DB_OK, db_set_connection(), _db_connection::driverName, G_debug(), G_fatal_error(), G_location_path(), G_make_mapset_object_group(), G_mapset(), G_zero(), and GPATH_MAX.

◆ db_set_error_handler_driver()

void db_set_error_handler_driver ( dbDriver driver)

Define standard error handler for open database connection.

This handler:

  • close database connection
  • shutdown db driver

Note: It's recommended to call this routine after db_start_driver_open_database().

Parameters
driverDB driver

Definition at line 38 of file db/dbmi_client/handler.c.

References G_add_error_handler().

◆ db_set_error_who()

void db_set_error_who ( const char *  me)

Set 'who' for error messages.

Parameters
memy name

Definition at line 46 of file db/dbmi_base/error.c.

◆ db_set_handle()

int db_set_handle ( dbHandle handle,
const char *  dbName,
const char *  dbSchema 
)

Set handle (database and schema name)

Parameters
handlepointer to dbHandle
dbNamedatabase name
dbSchemaschema name
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 39 of file handle.c.

References DB_OK, db_set_string(), _db_handle::dbName, and _db_handle::dbSchema.

Referenced by db_find_database(), and db_start_driver_open_database().

◆ db_set_index_column_name()

int db_set_index_column_name ( dbIndex index,
int  column_num,
const char *  name 
)

Set column name.

Parameters
indexpointer to dbIndex
column_numcolumn number
namename to be set
Returns
DB_OK on success
DB_FAILED on error

Definition at line 177 of file db/dbmi_base/index.c.

References _, _db_index::columnNames, db_error(), db_get_error_code(), db_set_string(), and _db_index::numColumns.

Referenced by db_create_index2().

◆ db_set_index_name()

int db_set_index_name ( dbIndex index,
const char *  name 
)

Set index name.

Parameters
indexpointer to dbIndex
namename to be set
Returns
DB_OK on success
DB_FAILED on error

Definition at line 112 of file db/dbmi_base/index.c.

References db_set_string(), and _db_index::indexName.

Referenced by db_create_index2().

◆ db_set_index_table_name()

int db_set_index_table_name ( dbIndex index,
const char *  name 
)

Set table name.

Parameters
indexpointer to dbIndex
namename to be set
Returns
DB_OK on success
DB_FAILED on error

Definition at line 138 of file db/dbmi_base/index.c.

References db_set_string(), and _db_index::tableName.

Referenced by db_create_index2().

◆ db_set_index_type_non_unique()

int db_set_index_type_non_unique ( dbIndex index)

Set index type to non-unique.

Todo:
return type void?
Parameters
indexpointer to dbIndex
Returns
0

Definition at line 228 of file db/dbmi_base/index.c.

References _db_index::unique.

◆ db_set_index_type_unique()

int db_set_index_type_unique ( dbIndex index)

Set index type to unique.

Todo:
return type void?
Parameters
indexpointer to dbIndex
Returns
0

Definition at line 212 of file db/dbmi_base/index.c.

References _db_index::unique.

Referenced by db_create_index2().

◆ db_set_login()

int db_set_login ( const char *  driver,
const char *  database,
const char *  user,
const char *  password 
)

Set login parameters for driver/database.

Deprecated:
Use db_set_login2() instead.
Todo:
: GRASS 8: to be replaced by db_set_login2().
Parameters
driverdriver name
databasedatabase name
useruser name
passwordpassword string
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 263 of file login.c.

◆ db_set_login2()

int db_set_login2 ( const char *  driver,
const char *  database,
const char *  user,
const char *  password,
const char *  host,
const char *  port,
int  overwrite 
)

Set login parameters for driver/database.

Parameters
driverdriver name
databasedatabase name
useruser name
passwordpassword string
hosthost name
port
overwriteTRUE to overwrite existing connections
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 284 of file login.c.

◆ db_set_string()

int db_set_string ( dbString x,
const char *  s 
)

Inserts string to dbString (enlarge string)

Parameters
[in,out]xpointer to dbString
sstring to be inserted
Returns
DB_OK on success
DB_MEMORY_ERR on error

Definition at line 41 of file string.c.

Referenced by db_convert_value_datetime_into_string(), db_convert_value_to_string(), db_delete_table(), db_grant_on_table(), db_gversion(), db_set_column_description(), db_set_column_name(), db_set_handle(), db_set_index_column_name(), db_set_index_name(), and db_set_index_table_name().

◆ db_set_string_no_copy()

int db_set_string_no_copy ( dbString x,
char *  s 
)

Inserts string to dbString (overwrite current value)

Parameters
[in,out]xpointer to dbString
sstring to be inserted
Returns
DB_OK on success
DB_MEMORY_ERR on error

Definition at line 55 of file string.c.

◆ db_set_table_column()

int db_set_table_column ( dbTable table,
int  idx,
dbColumn column 
)

Set a specific column for given table and column number.

Parameters
tablePointer to dbTable
idxColumn index (starting with '0'). The index must be in range.
columnPointer to a dbColumn to insert. A copy of the column stored, so the original column can be deleted.
Returns
DB_OK on success
DB_FAILURE on error

Definition at line 354 of file dbmi_base/table.c.

References _db_table::columns, db_copy_column(), DB_FAILED, DB_OK, and _db_table::numColumns.

◆ db_set_table_delete_priv_granted()

void db_set_table_delete_priv_granted ( dbTable table)

Grant delete privileges for table.

Parameters
tablepointer to dbTable

Definition at line 271 of file dbmi_base/table.c.

References DB_GRANTED, and _db_table::priv_delete.

◆ db_set_table_delete_priv_not_granted()

void db_set_table_delete_priv_not_granted ( dbTable table)

Set delete privileges not granted for table.

Parameters
tablepointer to dbTable

Definition at line 281 of file dbmi_base/table.c.

References DB_NOT_GRANTED, and _db_table::priv_delete.

◆ db_set_table_description()

int db_set_table_description ( dbTable table,
const char *  description 
)

Set the description of the table.

Parameters
tablepointer to dbTable
namedescription of the table
Returns
DB_OK

Definition at line 114 of file dbmi_base/table.c.

Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().

◆ db_set_table_insert_priv_granted()

void db_set_table_insert_priv_granted ( dbTable table)

Grant insert privileges for table.

Parameters
tablepointer to dbTable

Definition at line 239 of file dbmi_base/table.c.

References DB_GRANTED, and _db_table::priv_insert.

◆ db_set_table_insert_priv_not_granted()

void db_set_table_insert_priv_not_granted ( dbTable table)

Set insert privileges not granted for table.

Parameters
tablepointer to dbTable

Definition at line 249 of file dbmi_base/table.c.

References DB_NOT_GRANTED, and _db_table::priv_insert.

◆ db_set_table_name()

int db_set_table_name ( dbTable table,
const char *  name 
)

Set the name of the table.

Parameters
tablepointer to dbTable
nameThe name of the table
Returns
DB_OK on success

Definition at line 89 of file dbmi_base/table.c.

Referenced by P_Create_Aux2_Table(), and P_Create_Aux4_Table().

◆ db_set_table_select_priv_granted()

void db_set_table_select_priv_granted ( dbTable table)

Grant selection privileges for all columns.

Parameters
tablepointer to dbTable

Definition at line 175 of file dbmi_base/table.c.

◆ db_set_table_select_priv_not_granted()

void db_set_table_select_priv_not_granted ( dbTable table)

Set selection privileges not granted for all columns.

Parameters
tablepointer to dbTable

Definition at line 185 of file dbmi_base/table.c.

◆ db_set_table_update_priv_granted()

void db_set_table_update_priv_granted ( dbTable table)

Grant update privileges for all columns.

Parameters
tablepointer to dbTable

Definition at line 207 of file dbmi_base/table.c.

◆ db_set_table_update_priv_not_granted()

void db_set_table_update_priv_not_granted ( dbTable table)

Set update privileges not granted for all columns.

Parameters
tablepointer to dbTable

Definition at line 217 of file dbmi_base/table.c.

◆ db_set_value_datetime_current()

void db_set_value_datetime_current ( dbValue value)

Set datetime to current.

Parameters
valuepointer 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().

◆ db_set_value_datetime_not_current()

void db_set_value_datetime_not_current ( dbValue value)

Set value to non-current.

Parameters
valuepointer 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().

◆ db_set_value_day()

void db_set_value_day ( dbValue value,
int  day 
)

Set day value.

Parameters
valuepointer to dbValue
dayday 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().

◆ db_set_value_double()

void db_set_value_double ( dbValue value,
double  d 
)

Set double precision value.

Parameters
valuepointer to dbValue
ddouble value

Definition at line 207 of file value.c.

◆ db_set_value_hour()

void db_set_value_hour ( dbValue value,
int  hour 
)

Set hour value.

Parameters
valuepointer to dbValue
hourhour 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().

◆ db_set_value_int()

void db_set_value_int ( dbValue value,
int  i 
)

Set integer value.

Parameters
valuepointer to dbValue
iinteger value

Definition at line 195 of file value.c.

References db_set_value_not_null(), and _db_value::i.

◆ db_set_value_minute()

void db_set_value_minute ( dbValue value,
int  minute 
)

Set minute value.

Parameters
valuepointer to dbValue
minuteminute 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().

◆ db_set_value_month()

void db_set_value_month ( dbValue value,
int  month 
)

Set month value.

Parameters
valuepointer to dbValue
monthmonth 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().

◆ db_set_value_not_null()

void db_set_value_not_null ( dbValue value)

Set value to not null.

Parameters
valuepointer 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().

◆ db_set_value_null()

void db_set_value_null ( dbValue value)

Set value to null.

Parameters
valuepointer to dbValue

Definition at line 174 of file value.c.

References _db_value::isNull.

◆ db_set_value_seconds()

void db_set_value_seconds ( dbValue value,
double  seconds 
)

Set seconds value.

Parameters
valuepointer to dbValue
secondsseconds 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().

◆ db_set_value_string()

int db_set_value_string ( dbValue value,
const char *  s 
)

Set string value.

Parameters
valuepointer to dbValue
sstring value

Definition at line 219 of file value.c.

◆ db_set_value_year()

void db_set_value_year ( dbValue value,
int  year 
)

Set year value.

Parameters
valuepointer to dbValue
yearyear 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().

◆ db_shutdown_driver()

int db_shutdown_driver ( dbDriver driver)

Closedown the driver, and free the driver structure.

Note: the management of the memory for the driver structure probably should be handled differently.

db_start_driver() could take a pointer to driver structure as an argument, instead of returning the pointer to allocated then there would be no hidden free required

Parameters
driverpointer to dbDriver to be freed
Returns
0 on success
-1 on error

Definition at line 36 of file shutdown.c.

References db__set_protocol_fds(), db_free(), DB_PROC_SHUTDOWN_DRIVER, DB_START_PROCEDURE_CALL, db_unset_error_handler_driver(), G_wait(), NULL, _db_driver::pid, _db_driver::recv, and _db_driver::send.

Referenced by db_close_database_shutdown_driver(), and db_start_driver_open_database().

◆ db_sizeof_string()

unsigned int db_sizeof_string ( const dbString x)

Get string size.

Parameters
xpointer to dbString
Returns
string size

Definition at line 67 of file string.c.

References _db_string::nalloc.

◆ db_sqltype_name()

◆ db_sqltype_to_Ctype()

◆ db_start_driver()

dbDriver* db_start_driver ( const char *  name)

Initialize a new dbDriver for db transaction.

If name is NULL, the db name will be assigned connection.driverName.

Parameters
namedriver name
Returns
pointer to dbDriver structure
NULL on error

Definition at line 50 of file start.c.

References driver, and list.

Referenced by db_start_driver_open_database().

◆ db_start_driver_open_database()

dbDriver* db_start_driver_open_database ( const char *  drvname,
const char *  dbname 
)

Open driver/database connection.

Parameters
drvnamedriver name
dbnamedatabase name
Returns
pointer to dbDriver structure
NULL on failure

Definition at line 28 of file db.c.

References _, db_init_handle(), DB_OK, db_open_database(), db_set_handle(), db_shutdown_driver(), db_start_driver(), driver, G_debug(), G_warning(), and NULL.

Referenced by db_delete_table(), and Vect_cats_set_constraint().

◆ db_store()

char* db_store ( const char *  s)

Make a copy of string buffer.

Allocated string buffer should be freed by db_free().

Parameters
ssource string buffer
Returns
allocated string buffer

Definition at line 28 of file db/dbmi_base/alloc.c.

Referenced by db__mark_database_open().

◆ db_strip()

void db_strip ( char *  buf)

Strip given string.

'buf' is rewritten in place with leading and trailing white space removed.

Parameters
bufstring buffer

Definition at line 25 of file strip.c.

◆ db_syserror()

void db_syserror ( const char *  s)

Report system error.

Parameters
serror message

Definition at line 101 of file db/dbmi_base/error.c.

Referenced by db_read_dbmscap().

◆ db_table_exists()

int db_table_exists ( const char *  drvname,
const char *  dbname,
const char *  tabname 
)

Check if table exists.

Parameters
drvnamedriver name
dbnamedatabase name
tabnametable name
Returns
1 exist
0 doesn't exist
-1 error

Definition at line 32 of file dbmi_client/table.c.

References count, driver, and full.

◆ db_table_to_sql()

int db_table_to_sql ( dbTable table,
dbString sql 
)

Create SQL CREATE sring from table definition.

Parameters
tablepointer to dbTable
sqldbString to store the SQL CREATE string
Returns
DB_OK on success
DB_FAILED on error

Definition at line 424 of file dbmi_base/table.c.

◆ db_test_column_has_default_value()

int db_test_column_has_default_value ( dbColumn column)

Check if column has defined default value.

Parameters
columnpointer to dbColumn
Returns
1 if true
0 if false

Definition at line 199 of file dbmi_base/column.c.

References _db_column::hasDefaultValue.

Referenced by db_print_column_definition().

◆ db_test_column_has_defined_default_value()

int db_test_column_has_defined_default_value ( dbColumn column)

Check if column has defined default value.

Parameters
columnpointer to dbColumn
Returns
1 if true
0 if false

Definition at line 212 of file dbmi_base/column.c.

References _db_column::hasDefaultValue.

◆ db_test_column_has_undefined_default_value()

int db_test_column_has_undefined_default_value ( dbColumn column)

Check if column has defined default value.

Parameters
columnpointer to dbColumn
Returns
1 if false
0 if true

Definition at line 225 of file dbmi_base/column.c.

References _db_column::hasDefaultValue.

◆ db_test_column_null_allowed()

int db_test_column_null_allowed ( dbColumn column)

Checks if null value is allowed.

Parameters
columnpointer to dbColumn
Returns
1 if true
0 if false

Definition at line 291 of file dbmi_base/column.c.

References _db_column::nullAllowed.

Referenced by db_print_column_definition().

◆ db_test_column_use_default_value()

int db_test_column_use_default_value ( dbColumn column)

Checks if default value is used.

Parameters
columnpointer to dbColumn
Returns
1 if true
0 if false

Definition at line 258 of file dbmi_base/column.c.

References _db_column::useDefaultValue.

◆ db_test_cursor_any_column_flag()

int db_test_cursor_any_column_flag ( dbCursor cursor)

Checks columns' flag.

Is any cursor column flag set?

Parameters
cursorpointer to dbCursor
Returns
1 if true
0 if false

Definition at line 414 of file cursor.c.

Referenced by db_d_update(), and db_test_cursor_any_column_for_update().

◆ db_test_cursor_any_column_for_update()

int db_test_cursor_any_column_for_update ( dbCursor cursor)

Check if columns' flag is 'update'.

Parameters
cursorpointer to dbCursor
Returns
1 if true
0 if false

Definition at line 346 of file cursor.c.

References db_test_cursor_any_column_flag().

◆ db_test_cursor_column_flag()

int db_test_cursor_column_flag ( dbCursor cursor,
int  col 
)

Checks column's flag.

Parameters
cursorpointer to dbCursor
colcolumn index (starting with '0')
Returns
1 if flag is defined
0 otherwise

Definition at line 384 of file cursor.c.

References _db_cursor::column_flags.

Referenced by db_test_cursor_column_for_update().

◆ db_test_cursor_column_for_update()

int db_test_cursor_column_for_update ( dbCursor cursor,
int  col 
)

Check if column flag is 'update'.

Parameters
cursorpointer to dbCursor
colcolumn index (starting with '0')
Returns
1 if true
0 if false

Definition at line 333 of file cursor.c.

References db_test_cursor_column_flag().

◆ db_test_cursor_mode_insensitive()

int db_test_cursor_mode_insensitive ( dbCursor cursor)

Check if cursor mode is 'intensive'.

Parameters
cursorpointer to dbCursor
Returns
1 if true
0 if false

Definition at line 263 of file cursor.c.

References DB_INSENSITIVE, and _db_cursor::mode.

◆ db_test_cursor_mode_scroll()

int db_test_cursor_mode_scroll ( dbCursor cursor)

Check if cursor mode is 'scroll'.

Parameters
cursorpointer to dbCursor
Returns
1 if true
0 if false

Definition at line 250 of file cursor.c.

References DB_SCROLL, and _db_cursor::mode.

◆ db_test_cursor_type_fetch()

int db_test_cursor_type_fetch ( dbCursor cursor)

Check cursor type.

Parameters
cursorpointer to dbCursor
Returns
1 for known cursor type
0 for unknown cursor type

Definition at line 144 of file cursor.c.

References DB_INSERT, DB_READONLY, DB_UPDATE, and _db_cursor::type.

◆ db_test_cursor_type_insert()

int db_test_cursor_type_insert ( dbCursor cursor)

Check if cursor type is 'insert'.

Parameters
cursorpointer to dbCursor
Returns
1 if cursor type is 'insert'
0 otherwise

Definition at line 172 of file cursor.c.

References DB_INSERT, and _db_cursor::type.

Referenced by db_d_insert().

◆ db_test_cursor_type_update()

int db_test_cursor_type_update ( dbCursor cursor)

Check if cursor type is 'update'.

Parameters
cursorpointer to dbCursor
Returns
1 if cursor type is 'update'
0 otherwise

Definition at line 159 of file cursor.c.

References DB_UPDATE, and _db_cursor::type.

Referenced by db_d_delete(), and db_d_update().

◆ db_test_index_type_unique()

int db_test_index_type_unique ( dbIndex index)

Test if type is unique.

Parameters
indexpointer to dbIndex
Returns
non-zero if True
zero if False

Definition at line 243 of file db/dbmi_base/index.c.

References _db_index::unique.

Referenced by db_print_index().

◆ db_test_value_datetime_current()

int db_test_value_datetime_current ( dbValue value)

Check if datatime is current.

Parameters
valuepointer to dbValue
Returns
non-zero for true
zero for false

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().

◆ db_test_value_isnull()

int db_test_value_isnull ( dbValue value)

Check of value is null.

Parameters
valuepointer to dbValue
Returns
non-zero is null
zero is not null

Definition at line 26 of file value.c.

References _db_value::isNull.

Referenced by db_convert_value_to_string().

◆ db_unset_column_has_default_value()

void db_unset_column_has_default_value ( dbColumn column)

Unset default value identificator.

Parameters
columnpointer to dbColumn

Definition at line 186 of file dbmi_base/column.c.

References _db_column::hasDefaultValue.

◆ db_unset_column_null_allowed()

void db_unset_column_null_allowed ( dbColumn column)

Unset null value to be allowed.

Parameters
columnpointer to dbColumn

Definition at line 278 of file dbmi_base/column.c.

References _db_column::nullAllowed.

◆ db_unset_column_use_default_value()

void db_unset_column_use_default_value ( dbColumn column)

Unset default value to be used.

Parameters
columnpointer to dbColumn

Definition at line 245 of file dbmi_base/column.c.

References _db_column::useDefaultValue.

◆ db_unset_cursor_column_flag()

void db_unset_cursor_column_flag ( dbCursor cursor,
int  col 
)

Unset column's flag.

Parameters
cursorpointer to dbCursor
colcolumn index (starting with '0')

Definition at line 369 of file cursor.c.

References _db_cursor::column_flags.

Referenced by db_unset_cursor_column_for_update().

◆ db_unset_cursor_column_for_update()

void db_unset_cursor_column_for_update ( dbCursor cursor,
int  col 
)

Unset 'update' column flag.

Parameters
cursorpointer to dbCursor
colcolumn index (starting with '0')

Definition at line 319 of file cursor.c.

References db_unset_cursor_column_flag().

◆ db_unset_cursor_mode()

void db_unset_cursor_mode ( dbCursor cursor)

Unset cursor mode.

Parameters
cursorpointer to dbCursor

Definition at line 217 of file cursor.c.

References _db_cursor::mode.

◆ db_unset_cursor_mode_insensitive()

void db_unset_cursor_mode_insensitive ( dbCursor cursor)

Unset 'intensive' cursor mode.

Parameters
cursorpointer to dbCursor

Definition at line 237 of file cursor.c.

References DB_INSENSITIVE, and _db_cursor::mode.

◆ db_unset_cursor_mode_scroll()

void db_unset_cursor_mode_scroll ( dbCursor cursor)

Unset 'scroll' cursor mode.

Parameters
cursorpointer to dbCursor

Definition at line 207 of file cursor.c.

References DB_SCROLL, and _db_cursor::mode.

◆ db_unset_error_handler_driver()

void db_unset_error_handler_driver ( dbDriver driver)

Remove error handler before closing the driver.

Parameters
driverDB driver

Definition at line 48 of file db/dbmi_client/handler.c.

References G_remove_error_handler().

Referenced by db_shutdown_driver().

◆ db_update()

int db_update ( dbCursor cursor)

?

Parameters
cursordb cursor
Returns
DB_OK on success
DB_FAILED on failure

Definition at line 26 of file c_update.c.

References db__set_protocol_fds(), DB_OK, DB_PROC_UPDATE, DB_RECV_RETURN_CODE, DB_SEND_TABLE_DATA, DB_SEND_TOKEN, DB_START_PROCEDURE_CALL, _db_cursor::driver, _db_driver::recv, _db_driver::send, _db_cursor::table, and _db_cursor::token.

◆ db_whoami()

const char* db_whoami ( void  )

Who am i?

Check environmental variable LOGNAME

Returns
string buffer with logname

Definition at line 26 of file db/dbmi_base/whoami.c.

References G_store(), and getenv().

◆ db_zero()

void db_zero ( void *  s,
int  n 
)

Zero allocated space.

Parameters
spointer to memory
nnumber of bytes

Definition at line 23 of file db/dbmi_base/zero.c.

Referenced by db__init_driver_state(), db_init_column(), and db_zero_string().

◆ db_zero_string()

void db_zero_string ( dbString x)

Zero string.

Parameters
xpointer to dbString

Definition at line 79 of file string.c.

References db_get_string(), db_zero(), and _db_string::nalloc.