GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
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 294 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 393 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 356 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 307 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 226 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 196 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 413 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 345 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 383 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 332 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 262 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 249 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 171 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 158 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 368 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 318 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 216 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 236 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 206 of file cursor.c.
References DB_SCROLL, and _db_cursor::mode.