GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71817
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dbmi.h File Reference

Main header of GRASS DataBase Management Interface. More...

#include <stdio.h>
#include <grass/gis.h>
#include <grass/defs/dbmi.h>
Include dependency graph for dbmi.h:

Go to the source code of this file.

Data Structures

struct  _db_string
 
struct  _dbmscap
 
struct  _db_dirent
 
struct  _db_driver
 
struct  _db_handle
 
struct  _db_date_time
 
struct  _db_value
 
struct  _db_column
 
struct  _db_table
 
struct  _db_cursor
 
struct  _db_index
 
struct  _db_driver_state
 
struct  dbCatValI
 
struct  dbCatVal
 
struct  dbCatValArray
 
struct  _db_connection
 
struct  dbRclsRule
 

Macros

#define DB_VERSION   "0"
 
#define DB_DEFAULT_DRIVER   "dbf"
 
#define DB_PROC_VERSION   999
 
#define DB_PROC_CLOSE_DATABASE   101
 
#define DB_PROC_CREATE_DATABASE   102
 
#define DB_PROC_DELETE_DATABASE   103
 
#define DB_PROC_FIND_DATABASE   104
 
#define DB_PROC_LIST_DATABASES   105
 
#define DB_PROC_OPEN_DATABASE   106
 
#define DB_PROC_SHUTDOWN_DRIVER   107
 
#define DB_PROC_CLOSE_CURSOR   201
 
#define DB_PROC_DELETE   202
 
#define DB_PROC_FETCH   203
 
#define DB_PROC_INSERT   204
 
#define DB_PROC_OPEN_INSERT_CURSOR   205
 
#define DB_PROC_OPEN_SELECT_CURSOR   206
 
#define DB_PROC_OPEN_UPDATE_CURSOR   207
 
#define DB_PROC_UPDATE   208
 
#define DB_PROC_ROWS   209
 
#define DB_PROC_BIND_UPDATE   220
 
#define DB_PROC_BIND_INSERT   221
 
#define DB_PROC_EXECUTE_IMMEDIATE   301
 
#define DB_PROC_BEGIN_TRANSACTION   302
 
#define DB_PROC_COMMIT_TRANSACTION   303
 
#define DB_PROC_CREATE_TABLE   401
 
#define DB_PROC_DESCRIBE_TABLE   402
 
#define DB_PROC_DROP_TABLE   403
 
#define DB_PROC_LIST_TABLES   404
 
#define DB_PROC_ADD_COLUMN   405
 
#define DB_PROC_DROP_COLUMN   406
 
#define DB_PROC_GRANT_ON_TABLE   407
 
#define DB_PROC_CREATE_INDEX   701
 
#define DB_PROC_LIST_INDEXES   702
 
#define DB_PROC_DROP_INDEX   703
 
#define DB_PERM_R   01
 
#define DB_PERM_W   02
 
#define DB_PERM_X   04
 
#define DB_OK   0
 
#define DB_FAILED   1
 
#define DB_NOPROC   2
 
#define DB_MEMORY_ERR   -1
 
#define DB_PROTOCOL_ERR   -2
 
#define DB_EOF   -1
 
#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 /* length not defined */
 
#define DB_SQL_TYPE_SERIAL   21
 
#define DB_YEAR   0x4000
 
#define DB_MONTH   0x2000
 
#define DB_DAY   0x1000
 
#define DB_HOUR   0x0800
 
#define DB_MINUTE   0x0400
 
#define DB_SECOND   0x0200
 
#define DB_FRACTION   0x0100
 
#define DB_DATETIME_MASK   0xFF00
 
#define DB_C_TYPE_STRING   1
 
#define DB_C_TYPE_INT   2
 
#define DB_C_TYPE_DOUBLE   3
 
#define DB_C_TYPE_DATETIME   4
 
#define DB_CURRENT   1
 
#define DB_NEXT   2
 
#define DB_PREVIOUS   3
 
#define DB_FIRST   4
 
#define DB_LAST   5
 
#define DB_READONLY   1
 
#define DB_INSERT   2
 
#define DB_UPDATE   3
 
#define DB_SEQUENTIAL   0
 
#define DB_SCROLL   1
 
#define DB_INSENSITIVE   4
 
#define DB_GRANTED   1
 
#define DB_NOT_GRANTED   -1
 
#define DB_PRIV_SELECT   0x01
 
#define DB_GROUP   0x01
 
#define DB_PUBLIC   0x02
 
#define DB_DEFINED   1
 
#define DB_UNDEFINED   2
 
#define DB_SQL_MAX   4096
 

Typedefs

typedef void * dbAddress
 
typedef int dbToken
 
typedef struct _db_string dbString
 
typedef struct _dbmscap dbDbmscap
 
typedef struct _db_dirent dbDirent
 
typedef struct _db_driver dbDriver
 
typedef struct _db_handle dbHandle
 
typedef struct _db_date_time dbDateTime
 
typedef struct _db_value dbValue
 
typedef struct _db_column dbColumn
 
typedef struct _db_table dbTable
 
typedef struct _db_cursor dbCursor
 
typedef struct _db_index dbIndex
 
typedef struct _db_driver_state dbDriverState
 
typedef struct _db_connection dbConnection
 

Detailed Description

Main header of GRASS DataBase Management Interface.

(C) 1999-2009, 2011 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Definition in file dbmi.h.

Macro Definition Documentation

#define DB_CURRENT   1

Definition at line 113 of file dbmi.h.

#define DB_DATETIME_MASK   0xFF00

Definition at line 104 of file dbmi.h.

Referenced by db_sqltype_name(), and db_sqltype_to_Ctype().

#define DB_DAY   0x1000
#define DB_DEFAULT_DRIVER   "dbf"

Definition at line 23 of file dbmi.h.

Referenced by db_set_default_connection(), and Vect_default_field_info().

#define DB_DEFINED   1

Definition at line 138 of file dbmi.h.

#define DB_EOF   -1

Definition at line 76 of file dbmi.h.

Referenced by db__recv_procnum().

#define DB_FIRST   4

Definition at line 116 of file dbmi.h.

#define DB_FRACTION   0x0100
#define DB_GROUP   0x01

Definition at line 134 of file dbmi.h.

Referenced by Vect_copy_table_by_cats().

#define DB_HOUR   0x0800
#define DB_INSENSITIVE   4
#define DB_INSERT   2
#define DB_LAST   5

Definition at line 117 of file dbmi.h.

#define DB_MEMORY_ERR   -1

Definition at line 74 of file dbmi.h.

Referenced by db__recv_string_array(), db_enlarge_string(), and db_memory_error().

#define DB_MINUTE   0x0400
#define DB_MONTH   0x2000
#define DB_NOPROC   2

Definition at line 73 of file dbmi.h.

Referenced by db_noproc_error(), and db_procedure_not_implemented().

#define DB_OK   0

Definition at line 71 of file dbmi.h.

Referenced by db__driver_begin_transaction(), db__driver_commit_transaction(), db__driver_create_index(), db__driver_finish(), db__driver_grant_on_table(), db__driver_init(), db__recv_char(), db__recv_column_definition(), db__recv_datetime(), db__recv_double(), db__recv_double_array(), db__recv_float(), db__recv_float_array(), db__recv_handle(), db__recv_index(), db__recv_index_array(), db__recv_int(), db__recv_int_array(), db__recv_procnum(), db__recv_return_code(), db__recv_short(), db__recv_short_array(), db__recv_string(), db__recv_string_array(), db__recv_table_data(), db__recv_table_definition(), db__recv_value(), db__send_char(), db__send_column_definition(), db__send_datetime(), db__send_double(), db__send_double_array(), db__send_failure(), db__send_float(), db__send_float_array(), db__send_handle(), db__send_index(), db__send_index_array(), db__send_int(), db__send_int_array(), db__send_short(), db__send_short_array(), db__send_string(), db__send_string_array(), db__send_success(), db__send_table_data(), db__send_table_definition(), db__send_value(), db__start_procedure_call(), db_add_column(), db_alloc_cursor_column_flags(), db_alloc_cursor_table(), db_alloc_index_columns(), db_append_string(), db_append_table_column(), db_begin_transaction(), db_bind_update(), db_CatValArray_alloc(), db_CatValArray_get_value(), db_CatValArray_get_value_double(), db_CatValArray_get_value_int(), db_CatValArray_realloc(), db_CatValArray_sort_by_value(), db_clear_error(), db_close_cursor(), db_close_database(), db_close_database_shutdown_driver(), db_column_sqltype(), db_commit_transaction(), db_convert_Cstring_to_value(), db_convert_Cstring_to_value_datetime(), db_create_database(), db_create_index(), db_create_table(), db_d_add_column(), db_d_begin_transaction(), db_d_bind_update(), db_d_close_cursor(), db_d_close_database(), db_d_commit_transaction(), db_d_create_database(), db_d_create_index(), db_d_create_table(), db_d_delete(), db_d_delete_database(), db_d_describe_table(), db_d_drop_column(), db_d_drop_index(), db_d_drop_table(), db_d_execute_immediate(), db_d_fetch(), db_d_find_database(), db_d_get_num_rows(), db_d_grant_on_table(), db_d_insert(), db_d_list_databases(), db_d_list_indexes(), db_d_list_tables(), db_d_open_database(), db_d_open_insert_cursor(), db_d_open_select_cursor(), db_d_open_update_cursor(), db_d_update(), db_d_version(), db_delete(), db_delete_database(), db_delete_table(), db_describe_table(), db_dirent(), db_driver(), db_driver_mkdir(), db_drop_column(), db_drop_index(), db_drop_table(), db_enlarge_string(), db_execute_immediate(), db_fetch(), db_find_database(), db_get_column(), db_get_connection(), db_get_error_code(), db_get_login_dump(), db_get_num_rows(), db_get_table_number_of_rows(), db_grant_on_table(), db_gversion(), db_insert(), db_isdir(), db_legal_tablename(), db_list_databases(), db_list_indexes(), db_list_tables(), db_open_database(), db_open_insert_cursor(), db_open_select_cursor(), db_open_update_cursor(), db_select_CatValArray(), db_select_int(), db_select_value(), db_set_connection(), db_set_default_connection(), db_set_handle(), db_set_table_column(), db_start_driver(), db_start_driver_open_database(), db_table_exists(), db_table_to_sql(), db_update(), IL_check_at_points_2d(), IL_vector_input_data_2d(), NetA_get_node_costs(), NetA_init_distinct(), NetA_init_timetable_from_db(), P_Aux_to_Vector(), P_Create_Aux2_Table(), P_Create_Aux4_Table(), P_Sparse_Points(), tgis_get_connection(), tgis_set_connection(), tgis_set_default_connection(), V1_close_nat(), Vect_copy_table_by_cats(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), Vect_rename(), and Vect_write_ascii().

#define DB_PERM_R   01

Definition at line 66 of file dbmi.h.

#define DB_PERM_W   02

Definition at line 67 of file dbmi.h.

#define DB_PERM_X   04

Definition at line 68 of file dbmi.h.

#define DB_PREVIOUS   3

Definition at line 115 of file dbmi.h.

#define DB_PRIV_SELECT   0x01

Definition at line 132 of file dbmi.h.

Referenced by Vect_copy_table_by_cats().

#define DB_PROC_ADD_COLUMN   405

Definition at line 57 of file dbmi.h.

Referenced by db_add_column().

#define DB_PROC_BEGIN_TRANSACTION   302

Definition at line 50 of file dbmi.h.

Referenced by db_begin_transaction().

#define DB_PROC_BIND_INSERT   221

Definition at line 47 of file dbmi.h.

#define DB_PROC_BIND_UPDATE   220

Definition at line 46 of file dbmi.h.

Referenced by db_bind_update().

#define DB_PROC_CLOSE_CURSOR   201

Definition at line 37 of file dbmi.h.

Referenced by db_close_cursor().

#define DB_PROC_CLOSE_DATABASE   101

Definition at line 29 of file dbmi.h.

Referenced by db_close_database().

#define DB_PROC_COMMIT_TRANSACTION   303

Definition at line 51 of file dbmi.h.

Referenced by db_commit_transaction().

#define DB_PROC_CREATE_DATABASE   102

Definition at line 30 of file dbmi.h.

Referenced by db_create_database().

#define DB_PROC_CREATE_INDEX   701

Definition at line 61 of file dbmi.h.

Referenced by db_create_index().

#define DB_PROC_CREATE_TABLE   401

Definition at line 53 of file dbmi.h.

Referenced by db_create_table().

#define DB_PROC_DELETE   202

Definition at line 38 of file dbmi.h.

Referenced by db_delete().

#define DB_PROC_DELETE_DATABASE   103

Definition at line 31 of file dbmi.h.

Referenced by db_delete_database().

#define DB_PROC_DESCRIBE_TABLE   402

Definition at line 54 of file dbmi.h.

Referenced by db_describe_table().

#define DB_PROC_DROP_COLUMN   406

Definition at line 58 of file dbmi.h.

Referenced by db_drop_column().

#define DB_PROC_DROP_INDEX   703

Definition at line 63 of file dbmi.h.

Referenced by db_drop_index().

#define DB_PROC_DROP_TABLE   403

Definition at line 55 of file dbmi.h.

Referenced by db_drop_table().

#define DB_PROC_EXECUTE_IMMEDIATE   301

Definition at line 49 of file dbmi.h.

Referenced by db_execute_immediate().

#define DB_PROC_FETCH   203

Definition at line 39 of file dbmi.h.

Referenced by db_fetch().

#define DB_PROC_FIND_DATABASE   104

Definition at line 32 of file dbmi.h.

Referenced by db_find_database().

#define DB_PROC_GRANT_ON_TABLE   407

Definition at line 59 of file dbmi.h.

Referenced by db_grant_on_table().

#define DB_PROC_INSERT   204

Definition at line 40 of file dbmi.h.

Referenced by db_insert().

#define DB_PROC_LIST_DATABASES   105

Definition at line 33 of file dbmi.h.

Referenced by db_list_databases().

#define DB_PROC_LIST_INDEXES   702

Definition at line 62 of file dbmi.h.

Referenced by db_list_indexes().

#define DB_PROC_LIST_TABLES   404

Definition at line 56 of file dbmi.h.

Referenced by db_list_tables().

#define DB_PROC_OPEN_DATABASE   106

Definition at line 34 of file dbmi.h.

Referenced by db_open_database().

#define DB_PROC_OPEN_INSERT_CURSOR   205

Definition at line 41 of file dbmi.h.

Referenced by db_open_insert_cursor().

#define DB_PROC_OPEN_SELECT_CURSOR   206

Definition at line 42 of file dbmi.h.

Referenced by db_open_select_cursor().

#define DB_PROC_OPEN_UPDATE_CURSOR   207

Definition at line 43 of file dbmi.h.

Referenced by db_open_update_cursor().

#define DB_PROC_ROWS   209

Definition at line 45 of file dbmi.h.

Referenced by db_get_num_rows().

#define DB_PROC_SHUTDOWN_DRIVER   107

Definition at line 35 of file dbmi.h.

Referenced by db_driver(), and db_shutdown_driver().

#define DB_PROC_UPDATE   208

Definition at line 44 of file dbmi.h.

Referenced by db_update().

#define DB_PROC_VERSION   999

Definition at line 27 of file dbmi.h.

Referenced by db_gversion().

#define DB_PUBLIC   0x02

Definition at line 135 of file dbmi.h.

Referenced by Vect_copy_table_by_cats().

#define DB_READONLY   1

Definition at line 120 of file dbmi.h.

Referenced by db_set_cursor_type_readonly(), and db_test_cursor_type_fetch().

#define DB_SCROLL   1
#define DB_SECOND   0x0200
#define DB_SQL_TYPE_CHARACTER   1

Definition at line 81 of file dbmi.h.

Referenced by db_sqltype_name(), and db_table_to_sql().

#define DB_SQL_TYPE_DECIMAL   7

Definition at line 86 of file dbmi.h.

Referenced by db_sqltype_name(), and db_table_to_sql().

#define DB_SQL_TYPE_DOUBLE_PRECISION   6

Definition at line 85 of file dbmi.h.

Referenced by db_sqltype_name(), db_sqltype_to_Ctype(), db_table_to_sql(), and P_Create_Aux4_Table().

#define DB_SQL_TYPE_INTEGER   3
#define DB_SQL_TYPE_INTERVAL   12

Definition at line 91 of file dbmi.h.

Referenced by db_sqltype_name(), db_sqltype_to_Ctype(), and db_table_to_sql().

#define DB_SQL_TYPE_NUMERIC   8

Definition at line 87 of file dbmi.h.

Referenced by db_sqltype_name(), and db_table_to_sql().

#define DB_SQL_TYPE_REAL   4
#define DB_SQL_TYPE_SERIAL   21

Definition at line 94 of file dbmi.h.

Referenced by db_sqltype_name(), and db_sqltype_to_Ctype().

#define DB_SQL_TYPE_SMALLINT   2

Definition at line 82 of file dbmi.h.

Referenced by db_sqltype_name(), db_sqltype_to_Ctype(), and db_table_to_sql().

#define DB_SQL_TYPE_TEXT   13 /* length not defined */

Definition at line 92 of file dbmi.h.

Referenced by db_sqltype_name(), and db_table_to_sql().

#define DB_SQL_TYPE_TIMESTAMP   11
#define DB_SQL_TYPE_UNKNOWN   0

Definition at line 79 of file dbmi.h.

#define DB_UNDEFINED   2

Definition at line 139 of file dbmi.h.

#define DB_UPDATE   3
#define DB_VERSION   "0"

Definition at line 18 of file dbmi.h.

Referenced by db_d_version(), and db_gversion().

#define DB_YEAR   0x4000

Typedef Documentation

typedef void* dbAddress

Definition at line 144 of file dbmi.h.

typedef struct _db_column dbColumn
typedef struct _db_connection dbConnection
typedef struct _db_cursor dbCursor
typedef struct _db_date_time dbDateTime
typedef struct _dbmscap dbDbmscap
typedef struct _db_dirent dbDirent
typedef struct _db_driver dbDriver
typedef struct _db_handle dbHandle
typedef struct _db_index dbIndex
typedef struct _db_string dbString
typedef struct _db_table dbTable
typedef int dbToken

Definition at line 145 of file dbmi.h.

typedef struct _db_value dbValue