GRASS 8 Programmer's Manual 8.6.0dev(2026)-55de52a352
Loading...
Searching...
No Matches
d_closedb.c
Go to the documentation of this file.
1/*!
2 * \file db/dbmi_driver/d_closedb.c
3 *
4 * \brief DBMI Library (driver) - close database connection
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 Close database connection
18
19 \return DB_OK on success
20 \return DB_FAILED on failure
21 */
23{
24 int stat;
25
26 /* no arg(s) */
27
28 /* see if a database is open */
30 db_error("no database is open");
32 return DB_OK;
33 };
34 /* make sure all cursors are closed */
36
37 /* call the procedure */
39
40 /* send the return code */
41 if (stat != DB_OK) {
43 return DB_OK;
44 }
46
47 /* clear the driver state */
50
51 /* no results */
52 return DB_OK;
53}
int db_d_close_database(void)
Close database connection.
Definition d_closedb.c:22
Main header of GRASS DataBase Management Interface.
#define DB_OK
Definition dbmi.h:69
int(* db_driver_close_database)(void)
void db__close_all_cursors(void)
Close all cursors.
int db__test_database_open(void)
Test database connection.
void db__init_driver_state(void)
Initialize driver state.
void db__mark_database_closed(void)
Mark database as closed.
void db_error(const char *)
Report error message.
#define DB_SEND_SUCCESS()
Definition macros.h:13
#define DB_SEND_FAILURE()
Definition macros.h:18