GRASS 8 Programmer's Manual
8.6.0dev(2026)-8843f13794
Loading...
Searching...
No Matches
d_rows.c
Go to the documentation of this file.
1
/*!
2
* \file db/dbmi_driver/d_rows.c
3
*
4
* \brief DBMI Library (driver) - get number of records
5
*
6
* SPDX-FileCopyrightText: 1999-2008 GRASS Development Team
7
* SPDX-License-Identifier: GPL-2.0-or-later
8
*
9
* \author Joel Jones (CERL/UIUC), Radim Blazek
10
*/
11
12
#include <
grass/dbmi.h
>
13
#include "
macros.h
"
14
#include "
dbstubs.h
"
15
16
/*!
17
\brief Get number of selected rows
18
19
\return DB_OK on success
20
\return DB_FAILED on failure
21
*/
22
int
db_d_get_num_rows
(
void
)
23
{
24
dbToken
token;
25
dbCursor
*
cursor
;
26
int
nrows;
27
28
/* get the arg(s) */
29
DB_RECV_TOKEN
(&token);
30
cursor
= (
dbCursor
*)
db_find_token
(token);
31
32
/* call the procedure */
33
nrows =
db_driver_get_num_rows
(
cursor
);
34
35
/* send the return code */
36
if
(nrows < 0) {
37
DB_SEND_FAILURE
();
38
return
DB_OK
;
39
}
40
DB_SEND_SUCCESS
();
41
42
/* results */
43
DB_SEND_INT
(nrows);
44
return
DB_OK
;
45
}
AMI_STREAM
Definition
ami_stream.h:153
db_d_get_num_rows
int db_d_get_num_rows(void)
Get number of selected rows.
Definition
d_rows.c:22
dbmi.h
Main header of GRASS DataBase Management Interface.
dbToken
int dbToken
Definition
dbmi.h:143
DB_OK
#define DB_OK
Definition
dbmi.h:69
dbstubs.h
db_driver_get_num_rows
int(* db_driver_get_num_rows)(dbCursor *)
db_find_token
dbAddress db_find_token(dbToken)
Find token.
Definition
db/dbmi_base/token.c:27
macros.h
DB_SEND_INT
#define DB_SEND_INT(x)
Definition
macros.h:82
DB_SEND_SUCCESS
#define DB_SEND_SUCCESS()
Definition
macros.h:13
DB_RECV_TOKEN
#define DB_RECV_TOKEN(x)
Definition
macros.h:219
DB_SEND_FAILURE
#define DB_SEND_FAILURE()
Definition
macros.h:18
_db_cursor
Definition
dbmi.h:219
lib
db
dbmi_driver
d_rows.c
Generated on Tue Sep 15 2026 06:57:38 for GRASS 8 Programmer's Manual by
1.9.8