c_fetch.c

Go to the documentation of this file.
00001 #include <grass/dbmi.h>
00002 #include "macros.h"
00003 
00010 int
00011 db_fetch (dbCursor *cursor, int position, int *more)
00012 {
00013     int ret_code;
00014 
00015 /* start the procedure call */
00016     db__set_protocol_fds (cursor->driver->send, cursor->driver->recv);
00017     DB_START_PROCEDURE_CALL(DB_PROC_FETCH);
00018 
00019 /* send the argument(s) to the procedure */
00020     DB_SEND_TOKEN (&cursor->token);
00021     DB_SEND_INT (position);
00022 
00023 /* get the return code for the procedure call */
00024     DB_RECV_RETURN_CODE(&ret_code);
00025 
00026     if (ret_code != DB_OK)
00027         return ret_code; /* ret_code SHOULD == DB_FAILED */
00028 
00029 /* get the results */
00030     DB_RECV_INT (more);
00031     if (*more)
00032     {
00033         DB_RECV_TABLE_DATA(cursor->table);
00034     }
00035     return DB_OK;
00036 }

Generated on Sun Apr 6 17:31:38 2008 for GRASS by  doxygen 1.5.5