GRASS Programmer's Manual  6.4.2(2012)
 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 }