GRASS 8 Programmer's Manual 8.6.0dev(2026)-1878fdfec5
Loading...
Searching...
No Matches
c_fetch.c
Go to the documentation of this file.
1/*!
2 * \file db/dbmi_client/c_fetch.c
3 *
4 * \brief DBMI Library (client) - fetch data
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
15/*!
16 \brief Fetch data from open cursor
17
18 \param cursor pointer to dbCursor
19 \param position cursor position
20 \param[out] more get more (0 for no data to be fetched)
21
22 \return DB_OK on success
23 \return DB_FAILED on failure
24 */
25int db_fetch(dbCursor *cursor, int position, int *more)
26{
27 int ret_code;
28
29 /* start the procedure call */
30 db__set_protocol_fds(cursor->driver->send, cursor->driver->recv);
32
33 /* send the argument(s) to the procedure */
34 DB_SEND_TOKEN(&cursor->token);
35 DB_SEND_INT(position);
36
37 /* get the return code for the procedure call */
39
40 if (ret_code != DB_OK)
41 return ret_code; /* ret_code SHOULD == DB_FAILED */
42
43 /* get the results */
44 DB_RECV_INT(more);
45 if (*more) {
47 }
48 return DB_OK;
49}
int db_fetch(dbCursor *cursor, int position, int *more)
Fetch data from open cursor.
Definition c_fetch.c:25
Main header of GRASS DataBase Management Interface.
#define DB_PROC_FETCH
Definition dbmi.h:37
#define DB_OK
Definition dbmi.h:69
void db__set_protocol_fds(FILE *, FILE *)
?
#define DB_SEND_INT(x)
Definition macros.h:82
#define DB_RECV_TABLE_DATA(x)
Definition macros.h:153
#define DB_RECV_INT(x)
Definition macros.h:87
#define DB_START_PROCEDURE_CALL(x)
Definition macros.h:2
#define DB_RECV_RETURN_CODE(x)
Definition macros.h:7
#define DB_SEND_TOKEN(x)
Definition macros.h:214