GRASS 8 Programmer's Manual 8.6.0dev(2026)-55de52a352
Loading...
Searching...
No Matches
c_listdb.c
Go to the documentation of this file.
1/*!
2 * \file db/dbmi_client/c_listdb.c
3 *
4 * \brief DBMI Library (client) - list databases
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 List databases
17
18 \param driver db driver
19 \param path db path
20 \param npaths number of given paths
21 \param[out] handles handle infos
22 \param[out] count number of handle infos
23
24 \return DB_OK on success
25 \return DB_FAILED on failure
26 */
28 dbHandle **handles, int *count)
29{
30 int ret_code;
31 int i;
32 dbHandle *h;
33
34 /* start the procedure call */
37
38 /* arguments */
40
41 /* get the return code for the procedure call */
43
44 if (ret_code != DB_OK)
45 return ret_code; /* ret_code SHOULD == DB_FAILED */
46
47 /* results */
50 for (i = 0; i < *count; i++) {
51 DB_RECV_HANDLE(&h[i]);
52 }
53 *handles = h;
54
55 return DB_OK;
56}
int db_list_databases(dbDriver *driver, dbString *path, int npaths, dbHandle **handles, int *count)
List databases.
Definition c_listdb.c:27
Main header of GRASS DataBase Management Interface.
#define DB_OK
Definition dbmi.h:69
#define DB_PROC_LIST_DATABASES
Definition dbmi.h:31
dbHandle * db_alloc_handle_array(int)
Allocate array of handles.
Definition handle.c:106
void db__set_protocol_fds(FILE *, FILE *)
?
int count
#define DB_SEND_STRING_ARRAY(x, n)
Definition macros.h:29
#define DB_RECV_INT(x)
Definition macros.h:87
#define DB_START_PROCEDURE_CALL(x)
Definition macros.h:2
#define DB_RECV_HANDLE(x)
Definition macros.h:131
#define DB_RECV_RETURN_CODE(x)
Definition macros.h:7
Definition path.h:15