16 #include <grass/dbmi.h>
20 static dbDriverState state;
27 db_zero((
void *)&state,
sizeof(state));
48 return state.open ? 1 : 0;
85 list = state.cursor_list;
86 for (i = 0; i < state.ncursors; i++)
91 if (i >= state.ncursors) {
94 (i + 1) *
sizeof(dbCursor *));
97 state.cursor_list = list;
98 state.ncursors = i + 1;
114 for (i = 0; i < state.ncursors; i++)
115 if (state.cursor_list[i] == cursor)
116 state.cursor_list[i] =
NULL;
126 for (i = 0; i < state.ncursors; i++)
127 if (state.cursor_list[i])
130 if (state.cursor_list)
134 state.cursor_list =
NULL;
void db__add_cursor_to_driver_state(dbCursor *cursor)
Add cursor do driver state.
int(* db_driver_close_cursor)()
void db__close_all_cursors(void)
Close all cursors.
void * db_realloc(void *s, int n)
void db__mark_database_closed(void)
Mark database as closed.
void db__mark_database_open(const char *dbname, const char *dbschema)
Mark database as opened.
int db__test_database_open(void)
Test database connection.
void db__drop_cursor_from_driver_state(dbCursor *cursor)
Drop cursor from driver state.
void db_zero(void *s, int n)
char * db_store(const char *s)
void db__init_driver_state(void)
Initialize driver state.
dbDriverState * db__get_driver_state(void)
Get driver state.