d_rows.c

Go to the documentation of this file.
00001 #include <grass/dbmi.h>
00002 #include "macros.h"
00003 #include "dbstubs.h"
00004 
00011 int
00012 db_d_get_num_rows()
00013 {
00014     dbToken token;
00015     dbCursor *cursor;
00016     int nrows;
00017 
00018     /* get the arg(s) */
00019     DB_RECV_TOKEN(&token);
00020     cursor = (dbCursor *) db_find_token(token);
00021 
00022     /* call the procedure */
00023     nrows = db_driver_get_num_rows (cursor);
00024 
00025     /* send the return code */
00026     if ( nrows < 0 )
00027     {
00028         DB_SEND_FAILURE();
00029         return DB_OK;
00030     }
00031     DB_SEND_SUCCESS();
00032 
00033     /* results */
00034     DB_SEND_INT ( nrows );
00035     return DB_OK;
00036 }
00037 

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