GRASS 8 Programmer's Manual 8.6.0dev(2026)-1878fdfec5
Loading...
Searching...
No Matches
c_finddb.c
Go to the documentation of this file.
1/*!
2 * \file db/dbmi_client/c_finddb.c
3 *
4 * \brief DBMI Library (client) - find database
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 <stdlib.h>
13#include <grass/dbmi.h>
14#include "macros.h"
15
16/*!
17 \brief Find database
18
19 \param driver db driver
20 \param handle handle info
21 \param[out] found if non-zero database found
22
23 \return DB_OK on success
24 \return DB_FAILED on failure
25 */
27{
28 int ret_code;
29 int stat;
31
32 /* start the procedure call */
35
36 /* send the arguments to the procedure */
37 DB_SEND_HANDLE(handle);
38
39 /* get the return code for the procedure call */
41
42 if (ret_code != DB_OK)
43 return ret_code; /* ret_code SHOULD == DB_FAILED */
44
45 /* get results */
47
48 stat = DB_OK;
49 if (*found) {
54 }
55 return stat;
56}
int db_find_database(dbDriver *driver, dbHandle *handle, int *found)
Find database.
Definition c_finddb.c:26
Main header of GRASS DataBase Management Interface.
#define DB_OK
Definition dbmi.h:69
#define DB_PROC_FIND_DATABASE
Definition dbmi.h:30
const char * db_get_handle_dbname(dbHandle *)
Get handle database name.
Definition handle.c:54
int db_set_handle(dbHandle *, const char *, const char *)
Set handle (database and schema name)
Definition handle.c:36
void db__set_protocol_fds(FILE *, FILE *)
?
void db_free_handle(dbHandle *)
Free dbHandle structure.
Definition handle.c:76
const char * db_get_handle_dbschema(dbHandle *)
Get handle schema name.
Definition handle.c:66
#define DB_RECV_INT(x)
Definition macros.h:87
#define DB_SEND_HANDLE(x)
Definition macros.h:126
#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