GRASS Programmer's Manual  6.4.2(2012)
c_rows.c
Go to the documentation of this file.
00001 
00015 #include <grass/dbmi.h>
00016 #include "macros.h"
00017 
00026 int db_get_num_rows(dbCursor * cursor)
00027 {
00028     int nrows, ret_code;
00029 
00030     /* start the procedure call */
00031     db__set_protocol_fds(cursor->driver->send, cursor->driver->recv);
00032     DB_START_PROCEDURE_CALL(DB_PROC_ROWS);
00033 
00034     /* send the argument(s) to the procedure */
00035     DB_SEND_TOKEN(&cursor->token);
00036 
00037     /* get the return code for the procedure call */
00038     DB_RECV_RETURN_CODE(&ret_code);
00039 
00040     if (ret_code != DB_OK)
00041         return -1;
00042 
00043     /* get the results */
00044     DB_RECV_INT(&nrows);
00045 
00046     return nrows;
00047 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines