GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
DBMI Library (base) - cursors management. More...
Go to the source code of this file.
Functions | |
void | db_init_cursor (dbCursor *cursor) |
Initialize dbCursor. More... | |
int | db_alloc_cursor_table (dbCursor *cursor, int ncols) |
Allocate table for cursor. More... | |
void | db_free_cursor (dbCursor *cursor) |
Free allocated dbCursor. More... | |
dbTable * | db_get_cursor_table (dbCursor *cursor) |
Get table allocated by cursor. More... | |
void | db_set_cursor_table (dbCursor *cursor, dbTable *table) |
Set table for given cursor. More... | |
dbToken | db_get_cursor_token (dbCursor *cursor) |
Get cursor token. More... | |
void | db_set_cursor_token (dbCursor *cursor, dbToken token) |
Set cursor token. More... | |
void | db_set_cursor_type_readonly (dbCursor *cursor) |
Set cursor to be read-only (select) More... | |
void | db_set_cursor_type_update (dbCursor *cursor) |
Set cursor to be writable (update) More... | |
void | db_set_cursor_type_insert (dbCursor *cursor) |
Set cursor to be writable (insert) More... | |
int | db_test_cursor_type_fetch (dbCursor *cursor) |
Check cursor type. More... | |
int | db_test_cursor_type_update (dbCursor *cursor) |
Check if cursor type is 'update'. More... | |
int | db_test_cursor_type_insert (dbCursor *cursor) |
Check if cursor type is 'insert'. More... | |
void | db_set_cursor_mode (dbCursor *cursor, int mode) |
Set cursor mode. More... | |
void | db_set_cursor_mode_scroll (dbCursor *cursor) |
Set 'scroll' cursor mode. More... | |
void | db_unset_cursor_mode_scroll (dbCursor *cursor) |
Unset 'scroll' cursor mode. More... | |
void | db_unset_cursor_mode (dbCursor *cursor) |
Unset cursor mode. More... | |
void | db_set_cursor_mode_insensitive (dbCursor *cursor) |
Set 'intensive' cursor mode. More... | |
void | db_unset_cursor_mode_insensitive (dbCursor *cursor) |
Unset 'intensive' cursor mode. More... | |
int | db_test_cursor_mode_scroll (dbCursor *cursor) |
Check if cursor mode is 'scroll'. More... | |
int | db_test_cursor_mode_insensitive (dbCursor *cursor) |
Check if cursor mode is 'intensive'. More... | |
int | db_alloc_cursor_column_flags (dbCursor *cursor) |
Allocate columns' flags for cursor. More... | |
void | db_free_cursor_column_flags (dbCursor *cursor) |
Free columns' flags of cursor. More... | |
void | db_set_cursor_column_for_update (dbCursor *cursor, int col) |
Set Column flag to 'update'. More... | |
void | db_unset_cursor_column_for_update (dbCursor *cursor, int col) |
Unset 'update' column flag. More... | |
int | db_test_cursor_column_for_update (dbCursor *cursor, int col) |
Check if column flag is 'update'. More... | |
int | db_test_cursor_any_column_for_update (dbCursor *cursor) |
Check if columns' flag is 'update'. More... | |
void | db_set_cursor_column_flag (dbCursor *cursor, int col) |
Set column's flag. More... | |
void | db_unset_cursor_column_flag (dbCursor *cursor, int col) |
Unset column's flag. More... | |
int | db_test_cursor_column_flag (dbCursor *cursor, int col) |
Checks column's flag. More... | |
int | db_get_cursor_number_of_columns (dbCursor *cursor) |
Get number of columns. More... | |
int | db_test_cursor_any_column_flag (dbCursor *cursor) |
Checks columns' flag. More... | |
DBMI Library (base) - cursors management.
(C) 1999-2009 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 cursor.c.
int db_alloc_cursor_column_flags | ( | dbCursor * | cursor | ) |
int db_alloc_cursor_table | ( | dbCursor * | cursor, |
int | ncols | ||
) |
void db_free_cursor | ( | dbCursor * | cursor | ) |
Free allocated dbCursor.
cursor | pointer 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().
void db_free_cursor_column_flags | ( | dbCursor * | cursor | ) |
Free columns' flags of cursor.
cursor | pointer to dbCursor |
Definition at line 295 of file cursor.c.
References _db_cursor::column_flags, db_free(), and NULL.
Referenced by db_free_cursor().
int db_get_cursor_number_of_columns | ( | dbCursor * | cursor | ) |
Get number of columns.
cursor | pointer to dbCursor |
Definition at line 394 of file cursor.c.
Referenced by db_bind_update().
Get table allocated by cursor.
cursor | pointer to dbCursor |
Definition at line 67 of file cursor.c.
References _db_cursor::table.
Referenced by db_open_insert_cursor().
Get cursor token.
cursor | pointer to dbCursor |
Definition at line 90 of file cursor.c.
References _db_cursor::token.
void db_init_cursor | ( | dbCursor * | cursor | ) |
Initialize dbCursor.
cursor | pointer 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().
void db_set_cursor_column_flag | ( | dbCursor * | cursor, |
int | col | ||
) |
Set column's flag.
cursor | pointer to dbCursor |
col | column 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().
void db_set_cursor_column_for_update | ( | dbCursor * | cursor, |
int | col | ||
) |
Set Column flag to 'update'.
cursor | pointer to dbCursor |
col | column index (starting with '0') |
Definition at line 308 of file cursor.c.
References db_set_cursor_column_flag().
void db_set_cursor_mode | ( | dbCursor * | cursor, |
int | mode | ||
) |
void db_set_cursor_mode_insensitive | ( | dbCursor * | cursor | ) |
Set 'intensive' cursor mode.
cursor | pointer to dbCursor |
Definition at line 227 of file cursor.c.
References DB_INSENSITIVE, and _db_cursor::mode.
void db_set_cursor_mode_scroll | ( | dbCursor * | cursor | ) |
Set 'scroll' cursor mode.
cursor | pointer to dbCursor |
Definition at line 197 of file cursor.c.
References DB_SCROLL, and _db_cursor::mode.
Set cursor token.
cursor | pointer to dbCursor |
token | pointer to dbToken |
Definition at line 101 of file cursor.c.
References _db_cursor::token.
void db_set_cursor_type_insert | ( | dbCursor * | cursor | ) |
Set cursor to be writable (insert)
cursor | pointer to dbCursor |
Definition at line 131 of file cursor.c.
References DB_INSERT, and _db_cursor::type.
void db_set_cursor_type_readonly | ( | dbCursor * | cursor | ) |
Set cursor to be read-only (select)
cursor | pointer to dbCursor |
Definition at line 111 of file cursor.c.
References DB_READONLY, and _db_cursor::type.
void db_set_cursor_type_update | ( | dbCursor * | cursor | ) |
Set cursor to be writable (update)
cursor | pointer to dbCursor |
Definition at line 121 of file cursor.c.
References DB_UPDATE, and _db_cursor::type.
int db_test_cursor_any_column_flag | ( | dbCursor * | cursor | ) |
Checks columns' flag.
Is any cursor column flag set?
cursor | pointer to dbCursor |
Definition at line 414 of file cursor.c.
Referenced by db_d_update(), and db_test_cursor_any_column_for_update().
int db_test_cursor_any_column_for_update | ( | dbCursor * | cursor | ) |
Check if columns' flag is 'update'.
cursor | pointer to dbCursor |
Definition at line 346 of file cursor.c.
References db_test_cursor_any_column_flag().
int db_test_cursor_column_flag | ( | dbCursor * | cursor, |
int | col | ||
) |
Checks column's flag.
cursor | pointer to dbCursor |
col | column index (starting with '0') |
Definition at line 384 of file cursor.c.
References _db_cursor::column_flags.
Referenced by db_test_cursor_column_for_update().
int db_test_cursor_column_for_update | ( | dbCursor * | cursor, |
int | col | ||
) |
Check if column flag is 'update'.
cursor | pointer to dbCursor |
col | column index (starting with '0') |
Definition at line 333 of file cursor.c.
References db_test_cursor_column_flag().
int db_test_cursor_mode_insensitive | ( | dbCursor * | cursor | ) |
Check if cursor mode is 'intensive'.
cursor | pointer to dbCursor |
Definition at line 263 of file cursor.c.
References DB_INSENSITIVE, and _db_cursor::mode.
int db_test_cursor_mode_scroll | ( | dbCursor * | cursor | ) |
Check if cursor mode is 'scroll'.
cursor | pointer to dbCursor |
Definition at line 250 of file cursor.c.
References DB_SCROLL, and _db_cursor::mode.
int db_test_cursor_type_fetch | ( | dbCursor * | cursor | ) |
Check cursor type.
cursor | pointer to dbCursor |
Definition at line 144 of file cursor.c.
References DB_INSERT, DB_READONLY, DB_UPDATE, and _db_cursor::type.
int db_test_cursor_type_insert | ( | dbCursor * | cursor | ) |
Check if cursor type is 'insert'.
cursor | pointer to dbCursor |
Definition at line 172 of file cursor.c.
References DB_INSERT, and _db_cursor::type.
Referenced by db_d_insert().
int db_test_cursor_type_update | ( | dbCursor * | cursor | ) |
Check if cursor type is 'update'.
cursor | pointer to dbCursor |
Definition at line 159 of file cursor.c.
References DB_UPDATE, and _db_cursor::type.
Referenced by db_d_delete(), and db_d_update().
void db_unset_cursor_column_flag | ( | dbCursor * | cursor, |
int | col | ||
) |
Unset column's flag.
cursor | pointer to dbCursor |
col | column 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().
void db_unset_cursor_column_for_update | ( | dbCursor * | cursor, |
int | col | ||
) |
Unset 'update' column flag.
cursor | pointer to dbCursor |
col | column index (starting with '0') |
Definition at line 319 of file cursor.c.
References db_unset_cursor_column_flag().
void db_unset_cursor_mode | ( | dbCursor * | cursor | ) |
Unset cursor mode.
cursor | pointer to dbCursor |
Definition at line 217 of file cursor.c.
References _db_cursor::mode.
void db_unset_cursor_mode_insensitive | ( | dbCursor * | cursor | ) |
Unset 'intensive' cursor mode.
cursor | pointer to dbCursor |
Definition at line 237 of file cursor.c.
References DB_INSENSITIVE, and _db_cursor::mode.
void db_unset_cursor_mode_scroll | ( | dbCursor * | cursor | ) |
Unset 'scroll' cursor mode.
cursor | pointer to dbCursor |
Definition at line 207 of file cursor.c.
References DB_SCROLL, and _db_cursor::mode.