GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
d_rows.c
Go to the documentation of this file.
1 
15 #include <grass/dbmi.h>
16 #include "macros.h"
17 #include "dbstubs.h"
18 
26 {
27  dbToken token;
28  dbCursor *cursor;
29  int nrows;
30 
31  /* get the arg(s) */
32  DB_RECV_TOKEN(&token);
33  cursor = (dbCursor *) db_find_token(token);
34 
35  /* call the procedure */
36  nrows = db_driver_get_num_rows(cursor);
37 
38  /* send the return code */
39  if (nrows < 0) {
41  return DB_OK;
42  }
44 
45  /* results */
46  DB_SEND_INT(nrows);
47  return DB_OK;
48 }
dbAddress db_find_token(dbToken token)
#define DB_SEND_INT(x)
Definition: macros.h:37
#define DB_RECV_TOKEN(x)
Definition: macros.h:99
int db_d_get_num_rows(void)
Get number of selected rows.
Definition: d_rows.c:25
#define DB_SEND_FAILURE()
Definition: macros.h:9
int(* db_driver_get_num_rows)()
#define DB_SEND_SUCCESS()
Definition: macros.h:7