2 #include <grass/dbmi.h>
12 cursor->driver =
NULL;
17 cursor->column_flags =
NULL;
29 if (cursor->table ==
NULL)
44 if (cursor->column_flags)
68 cursor->table = table;
90 cursor->token = token;
101 cursor->type = DB_READONLY;
112 cursor->type = DB_UPDATE;
123 cursor->type = DB_INSERT;
134 return (cursor->type == DB_READONLY || cursor->type == DB_UPDATE);
145 return (cursor->type == DB_UPDATE);
156 return (cursor->type == DB_INSERT);
178 cursor->mode |= DB_SCROLL;
189 cursor->mode &= ~DB_SCROLL;
211 cursor->mode |= DB_INSENSITIVE;
222 cursor->mode &= ~DB_INSENSITIVE;
233 return (cursor->mode & DB_SCROLL);
245 return (cursor->mode & DB_INSENSITIVE);
260 cursor->column_flags = (
short *)
db_calloc(ncols,
sizeof(
short));
261 if (cursor->column_flags ==
NULL)
263 for (col = 0; col < ncols; col++)
276 if (cursor->column_flags)
278 cursor->column_flags =
NULL;
333 if (cursor->column_flags)
334 cursor->column_flags[col] = 1;
345 if (cursor->column_flags)
346 cursor->column_flags[col] = 0;
357 return cursor->column_flags && cursor->column_flags[col] ? 1 : 0;
388 for (col = 0; col < ncols; col++)
int db_test_cursor_mode_scroll(dbCursor *cursor)
void db_unset_cursor_mode_insensitive(dbCursor *cursor)
void db_unset_cursor_column_for_update(dbCursor *cursor, int col)
void db_unset_cursor_mode_scroll(dbCursor *cursor)
dbTable * db_alloc_table(int ncols)
void * db_calloc(int n, int m)
void db_set_cursor_column_for_update(dbCursor *cursor, int col)
int db_test_cursor_column_flag(dbCursor *cursor, int col)
int db_test_cursor_mode_insensitive(dbCursor *cursor)
void db_set_cursor_type_readonly(dbCursor *cursor)
void db_set_cursor_type_update(dbCursor *cursor)
dbTable * db_get_cursor_table(dbCursor *cursor)
void db_init_cursor(dbCursor *cursor)
void db_set_cursor_type_insert(dbCursor *cursor)
dbToken db_get_cursor_token(dbCursor *cursor)
int db_get_error_code(void)
int db_get_table_number_of_columns(dbTable *table)
void db_set_cursor_column_flag(dbCursor *cursor, int col)
int db_alloc_cursor_column_flags(dbCursor *cursor)
void db_unset_cursor_column_flag(dbCursor *cursor, int col)
int db_test_cursor_any_column_for_update(dbCursor *cursor)
int db_test_cursor_type_insert(dbCursor *cursor)
void db_free_cursor_column_flags(dbCursor *cursor)
void db_set_cursor_mode(dbCursor *cursor, int mode)
void db_free_cursor(dbCursor *cursor)
int db_test_cursor_type_fetch(dbCursor *cursor)
void db_free_table(dbTable *table)
int db_get_cursor_number_of_columns(dbCursor *cursor)
void db_unset_cursor_mode(dbCursor *cursor)
void db_set_cursor_token(dbCursor *cursor, dbToken token)
void db_set_cursor_table(dbCursor *cursor, dbTable *table)
void db_set_cursor_mode_insensitive(dbCursor *cursor)
int db_alloc_cursor_table(dbCursor *cursor, int ncols)
int db_test_cursor_any_column_flag(dbCursor *cursor)
int db_test_cursor_type_update(dbCursor *cursor)
void db_set_cursor_mode_scroll(dbCursor *cursor)
int db_test_cursor_column_for_update(dbCursor *cursor, int col)