GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
d_openinsert.c
Go to the documentation of this file.
1
15
#include <grass/dbmi.h>
16
#include "
macros.h
"
17
#include "
dbstubs.h
"
18
25
int
db_d_open_insert_cursor
(
void
)
26
{
27
dbCursor *cursor;
28
dbTable *table;
29
int
stat;
30
dbToken token;
31
32
/* get the arg(s) */
33
DB_RECV_TABLE_DEFINITION
(&table);
34
35
/* create a cursor */
36
cursor = (dbCursor *)
db_malloc
(
sizeof
(dbCursor));
37
if
(cursor ==
NULL
)
38
return
db_get_error_code
();
39
token =
db_new_token
((dbAddress) cursor);
40
if
(token < 0)
41
return
db_get_error_code
();
42
db_init_cursor
(cursor);
43
db_set_cursor_table
(cursor, table);
44
45
/* call the procedure */
46
stat =
db_driver_open_insert_cursor
(cursor);
47
48
/* send the return code */
49
if
(stat != DB_OK) {
50
DB_SEND_FAILURE
();
51
return
DB_OK;
52
}
53
DB_SEND_SUCCESS
();
54
55
/* mark this as an insert cursor */
56
db_set_cursor_type_insert
(cursor);
57
58
/* add this cursor to the cursors managed by the driver state */
59
db__add_cursor_to_driver_state
(cursor);
60
61
/* results */
62
DB_SEND_TOKEN
(&token);
63
DB_SEND_INT
(cursor->type);
64
DB_SEND_INT
(cursor->mode);
65
return
DB_OK;
66
}
lib
db
dbmi_driver
d_openinsert.c
Generated on Sat Oct 5 2013 12:11:06 for GRASS Programmer's Manual by
1.8.4