GRASS Programmer's Manual
6.4.2(2012)
|
00001 00015 #include <grass/dbmi.h> 00016 #include "macros.h" 00017 00027 int db_open_insert_cursor(dbDriver * driver, dbCursor * cursor) 00028 { 00029 int ret_code; 00030 00031 /* 00032 db_init_cursor (cursor); 00033 */ 00034 cursor->driver = driver; 00035 00036 /* start the procedure call */ 00037 db__set_protocol_fds(driver->send, driver->recv); 00038 DB_START_PROCEDURE_CALL(DB_PROC_OPEN_INSERT_CURSOR); 00039 00040 /* send the argument(s) to the procedure */ 00041 DB_SEND_TABLE_DEFINITION(db_get_cursor_table(cursor)); 00042 00043 /* get the return code for the procedure call */ 00044 DB_RECV_RETURN_CODE(&ret_code); 00045 00046 if (ret_code != DB_OK) 00047 return ret_code; /* ret_code SHOULD == DB_FAILED */ 00048 00049 /* get the results */ 00050 DB_RECV_TOKEN(&cursor->token); 00051 DB_RECV_INT(&cursor->type); 00052 DB_RECV_INT(&cursor->mode); 00053 return DB_OK; 00054 }