GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
dbmi.h File Reference
#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   "sqlite"
 
#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   8192
 

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
 

Macro Definition Documentation

◆ DB_C_TYPE_DATETIME

#define DB_C_TYPE_DATETIME   4

◆ DB_C_TYPE_DOUBLE

#define DB_C_TYPE_DOUBLE   3

◆ DB_C_TYPE_INT

◆ DB_C_TYPE_STRING

#define DB_C_TYPE_STRING   1

◆ DB_CURRENT

#define DB_CURRENT   1

Definition at line 113 of file dbmi.h.

◆ DB_DATETIME_MASK

#define DB_DATETIME_MASK   0xFF00

Definition at line 104 of file dbmi.h.

Referenced by db_sqltype_name(), and db_sqltype_to_Ctype().

◆ DB_DAY

#define DB_DAY   0x1000

Definition at line 99 of file dbmi.h.

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

◆ DB_DEFAULT_DRIVER

#define DB_DEFAULT_DRIVER   "sqlite"

Definition at line 21 of file dbmi.h.

Referenced by db_set_default_connection().

◆ DB_DEFINED

#define DB_DEFINED   1

Definition at line 138 of file dbmi.h.

◆ DB_EOF

#define DB_EOF   -1

Definition at line 76 of file dbmi.h.

Referenced by db__recv_procnum().

◆ DB_FAILED

◆ DB_FIRST

#define DB_FIRST   4

Definition at line 116 of file dbmi.h.

◆ DB_FRACTION

#define DB_FRACTION   0x0100

◆ DB_GRANTED

◆ DB_GROUP

#define DB_GROUP   0x01

Definition at line 134 of file dbmi.h.

◆ DB_HOUR

#define DB_HOUR   0x0800

◆ DB_INSENSITIVE

#define DB_INSENSITIVE   4

◆ DB_INSERT

#define DB_INSERT   2

◆ DB_LAST

#define DB_LAST   5

Definition at line 117 of file dbmi.h.

◆ DB_MEMORY_ERR

#define DB_MEMORY_ERR   -1

Definition at line 74 of file dbmi.h.

Referenced by db_enlarge_string().

◆ DB_MINUTE

#define DB_MINUTE   0x0400

◆ DB_MONTH

#define DB_MONTH   0x2000

◆ DB_NEXT

#define DB_NEXT   2

Definition at line 114 of file dbmi.h.

◆ DB_NOPROC

#define DB_NOPROC   2

Definition at line 73 of file dbmi.h.

◆ DB_NOT_GRANTED

◆ DB_OK

#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_column_definition(), db__recv_datetime(), db__recv_double_array(), db__recv_float_array(), db__recv_handle(), db__recv_index_array(), db__recv_int(), db__recv_int_array(), db__recv_procnum(), db__recv_short(), db__recv_short_array(), db__recv_string(), db__recv_value(), db__send_column_definition(), db__send_datetime(), db__send_double_array(), db__send_failure(), 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_success(), db__send_value(), db__start_procedure_call(), db_add_column(), db_append_table_column(), db_begin_transaction(), db_bind_update(), db_CatValArray_alloc(), db_CatValArray_realloc(), db_close_cursor(), db_close_database(), db_close_database_shutdown_driver(), db_commit_transaction(), db_convert_Cstring_to_value_datetime(), db_create_database(), db_create_index(), db_d_add_column(), db_d_begin_transaction(), db_d_close_cursor(), db_d_close_database(), db_d_commit_transaction(), db_d_create_database(), db_d_create_index(), db_d_delete(), db_d_delete_database(), db_d_drop_column(), db_d_drop_index(), db_d_drop_table(), db_d_execute_immediate(), db_d_find_database(), db_d_get_num_rows(), db_d_grant_on_table(), db_d_insert(), db_d_list_indexes(), db_d_list_tables(), db_d_open_database(), db_d_update(), db_d_version(), db_delete(), db_delete_database(), db_delete_table(), db_drop_column(), db_drop_index(), db_drop_table(), db_enlarge_string(), db_execute_immediate(), db_find_database(), db_get_connection(), db_get_num_rows(), db_get_table_number_of_rows(), db_grant_on_table(), db_gversion(), db_insert(), db_isdir(), db_list_indexes(), db_list_tables(), db_open_database(), db_open_insert_cursor(), db_set_connection(), db_set_default_connection(), db_set_handle(), db_set_table_column(), db_start_driver_open_database(), db_update(), P_Create_Aux2_Table(), P_Create_Aux4_Table(), tgis_get_connection(), and tgis_set_connection().

◆ DB_PERM_R

#define DB_PERM_R   01

Definition at line 66 of file dbmi.h.

◆ DB_PERM_W

#define DB_PERM_W   02

Definition at line 67 of file dbmi.h.

◆ DB_PERM_X

#define DB_PERM_X   04

Definition at line 68 of file dbmi.h.

◆ DB_PREVIOUS

#define DB_PREVIOUS   3

Definition at line 115 of file dbmi.h.

◆ DB_PRIV_SELECT

#define DB_PRIV_SELECT   0x01

Definition at line 132 of file dbmi.h.

◆ DB_PROC_ADD_COLUMN

#define DB_PROC_ADD_COLUMN   405

Definition at line 57 of file dbmi.h.

Referenced by db_add_column().

◆ DB_PROC_BEGIN_TRANSACTION

#define DB_PROC_BEGIN_TRANSACTION   302

Definition at line 50 of file dbmi.h.

Referenced by db_begin_transaction().

◆ DB_PROC_BIND_INSERT

#define DB_PROC_BIND_INSERT   221

Definition at line 47 of file dbmi.h.

◆ DB_PROC_BIND_UPDATE

#define DB_PROC_BIND_UPDATE   220

Definition at line 46 of file dbmi.h.

Referenced by db_bind_update().

◆ DB_PROC_CLOSE_CURSOR

#define DB_PROC_CLOSE_CURSOR   201

Definition at line 37 of file dbmi.h.

Referenced by db_close_cursor().

◆ DB_PROC_CLOSE_DATABASE

#define DB_PROC_CLOSE_DATABASE   101

Definition at line 29 of file dbmi.h.

Referenced by db_close_database().

◆ DB_PROC_COMMIT_TRANSACTION

#define DB_PROC_COMMIT_TRANSACTION   303

Definition at line 51 of file dbmi.h.

Referenced by db_commit_transaction().

◆ DB_PROC_CREATE_DATABASE

#define DB_PROC_CREATE_DATABASE   102

Definition at line 30 of file dbmi.h.

Referenced by db_create_database().

◆ DB_PROC_CREATE_INDEX

#define DB_PROC_CREATE_INDEX   701

Definition at line 61 of file dbmi.h.

Referenced by db_create_index().

◆ DB_PROC_CREATE_TABLE

#define DB_PROC_CREATE_TABLE   401

Definition at line 53 of file dbmi.h.

◆ DB_PROC_DELETE

#define DB_PROC_DELETE   202

Definition at line 38 of file dbmi.h.

Referenced by db_delete().

◆ DB_PROC_DELETE_DATABASE

#define DB_PROC_DELETE_DATABASE   103

Definition at line 31 of file dbmi.h.

Referenced by db_delete_database().

◆ DB_PROC_DESCRIBE_TABLE

#define DB_PROC_DESCRIBE_TABLE   402

Definition at line 54 of file dbmi.h.

◆ DB_PROC_DROP_COLUMN

#define DB_PROC_DROP_COLUMN   406

Definition at line 58 of file dbmi.h.

Referenced by db_drop_column().

◆ DB_PROC_DROP_INDEX

#define DB_PROC_DROP_INDEX   703

Definition at line 63 of file dbmi.h.

Referenced by db_drop_index().

◆ DB_PROC_DROP_TABLE

#define DB_PROC_DROP_TABLE   403

Definition at line 55 of file dbmi.h.

Referenced by db_drop_table().

◆ DB_PROC_EXECUTE_IMMEDIATE

#define DB_PROC_EXECUTE_IMMEDIATE   301

Definition at line 49 of file dbmi.h.

Referenced by db_execute_immediate().

◆ DB_PROC_FETCH

#define DB_PROC_FETCH   203

Definition at line 39 of file dbmi.h.

◆ DB_PROC_FIND_DATABASE

#define DB_PROC_FIND_DATABASE   104

Definition at line 32 of file dbmi.h.

Referenced by db_find_database().

◆ DB_PROC_GRANT_ON_TABLE

#define DB_PROC_GRANT_ON_TABLE   407

Definition at line 59 of file dbmi.h.

Referenced by db_grant_on_table().

◆ DB_PROC_INSERT

#define DB_PROC_INSERT   204

Definition at line 40 of file dbmi.h.

Referenced by db_insert().

◆ DB_PROC_LIST_DATABASES

#define DB_PROC_LIST_DATABASES   105

Definition at line 33 of file dbmi.h.

◆ DB_PROC_LIST_INDEXES

#define DB_PROC_LIST_INDEXES   702

Definition at line 62 of file dbmi.h.

Referenced by db_list_indexes().

◆ DB_PROC_LIST_TABLES

#define DB_PROC_LIST_TABLES   404

Definition at line 56 of file dbmi.h.

Referenced by db_list_tables().

◆ DB_PROC_OPEN_DATABASE

#define DB_PROC_OPEN_DATABASE   106

Definition at line 34 of file dbmi.h.

Referenced by db_open_database().

◆ DB_PROC_OPEN_INSERT_CURSOR

#define DB_PROC_OPEN_INSERT_CURSOR   205

Definition at line 41 of file dbmi.h.

Referenced by db_open_insert_cursor().

◆ DB_PROC_OPEN_SELECT_CURSOR

#define DB_PROC_OPEN_SELECT_CURSOR   206

Definition at line 42 of file dbmi.h.

◆ DB_PROC_OPEN_UPDATE_CURSOR

#define DB_PROC_OPEN_UPDATE_CURSOR   207

Definition at line 43 of file dbmi.h.

◆ DB_PROC_ROWS

#define DB_PROC_ROWS   209

Definition at line 45 of file dbmi.h.

Referenced by db_get_num_rows().

◆ DB_PROC_SHUTDOWN_DRIVER

#define DB_PROC_SHUTDOWN_DRIVER   107

Definition at line 35 of file dbmi.h.

Referenced by db_shutdown_driver().

◆ DB_PROC_UPDATE

#define DB_PROC_UPDATE   208

Definition at line 44 of file dbmi.h.

Referenced by db_update().

◆ DB_PROC_VERSION

#define DB_PROC_VERSION   999

Definition at line 27 of file dbmi.h.

Referenced by db_gversion().

◆ DB_PROTOCOL_ERR

◆ DB_PUBLIC

#define DB_PUBLIC   0x02

Definition at line 135 of file dbmi.h.

◆ DB_READONLY

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

◆ DB_SCROLL

#define DB_SCROLL   1

◆ DB_SECOND

#define DB_SECOND   0x0200

◆ DB_SEQUENTIAL

#define DB_SEQUENTIAL   0

Definition at line 123 of file dbmi.h.

Referenced by db_get_table_number_of_rows().

◆ DB_SQL_MAX

◆ DB_SQL_TYPE_CHARACTER

#define DB_SQL_TYPE_CHARACTER   1

Definition at line 81 of file dbmi.h.

Referenced by db_sqltype_name().

◆ DB_SQL_TYPE_DATE

#define DB_SQL_TYPE_DATE   9

◆ DB_SQL_TYPE_DECIMAL

#define DB_SQL_TYPE_DECIMAL   7

Definition at line 86 of file dbmi.h.

Referenced by db_sqltype_name().

◆ DB_SQL_TYPE_DOUBLE_PRECISION

#define DB_SQL_TYPE_DOUBLE_PRECISION   6

Definition at line 85 of file dbmi.h.

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

◆ DB_SQL_TYPE_INTEGER

#define DB_SQL_TYPE_INTEGER   3

◆ DB_SQL_TYPE_INTERVAL

#define DB_SQL_TYPE_INTERVAL   12

Definition at line 91 of file dbmi.h.

Referenced by db_sqltype_name(), and db_sqltype_to_Ctype().

◆ DB_SQL_TYPE_NUMERIC

#define DB_SQL_TYPE_NUMERIC   8

Definition at line 87 of file dbmi.h.

Referenced by db_sqltype_name().

◆ DB_SQL_TYPE_REAL

#define DB_SQL_TYPE_REAL   4

◆ DB_SQL_TYPE_SERIAL

#define DB_SQL_TYPE_SERIAL   21

Definition at line 94 of file dbmi.h.

Referenced by db_sqltype_name(), and db_sqltype_to_Ctype().

◆ DB_SQL_TYPE_SMALLINT

#define DB_SQL_TYPE_SMALLINT   2

Definition at line 82 of file dbmi.h.

Referenced by db_sqltype_name(), and db_sqltype_to_Ctype().

◆ DB_SQL_TYPE_TEXT

#define DB_SQL_TYPE_TEXT   13 /* length not defined */

Definition at line 92 of file dbmi.h.

Referenced by db_sqltype_name().

◆ DB_SQL_TYPE_TIME

#define DB_SQL_TYPE_TIME   10

◆ DB_SQL_TYPE_TIMESTAMP

#define DB_SQL_TYPE_TIMESTAMP   11

◆ DB_SQL_TYPE_UNKNOWN

#define DB_SQL_TYPE_UNKNOWN   0

Definition at line 79 of file dbmi.h.

◆ DB_UNDEFINED

#define DB_UNDEFINED   2

Definition at line 139 of file dbmi.h.

◆ DB_UPDATE

#define DB_UPDATE   3

◆ DB_VERSION

#define DB_VERSION   "0"

Definition at line 18 of file dbmi.h.

Referenced by db_d_version(), and db_gversion().

◆ DB_YEAR

#define DB_YEAR   0x4000

Typedef Documentation

◆ dbAddress

typedef void* dbAddress

Definition at line 144 of file dbmi.h.

◆ dbColumn

typedef struct _db_column dbColumn

◆ dbConnection

typedef struct _db_connection dbConnection

◆ dbCursor

typedef struct _db_cursor dbCursor

◆ dbDateTime

typedef struct _db_date_time dbDateTime

◆ dbDbmscap

typedef struct _dbmscap dbDbmscap

◆ dbDirent

typedef struct _db_dirent dbDirent

◆ dbDriver

typedef struct _db_driver dbDriver

◆ dbDriverState

◆ dbHandle

typedef struct _db_handle dbHandle

◆ dbIndex

typedef struct _db_index dbIndex

◆ dbString

typedef struct _db_string dbString

◆ dbTable

typedef struct _db_table dbTable

◆ dbToken

typedef int dbToken

Definition at line 145 of file dbmi.h.

◆ dbValue

typedef struct _db_value dbValue