GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
d_closedb.c
Go to the documentation of this file.
1 
15 #include <grass/dbmi.h>
16 #include "macros.h"
17 #include "dbstubs.h"
18 
26 {
27  int stat;
28 
29  /* no arg(s) */
30 
31  /* see if a database is open */
32  if (!db__test_database_open()) {
33  db_error("no database is open");
35  return DB_OK;
36  };
37  /* make sure all cursors are closed */
39 
40  /* call the procedure */
41  stat = db_driver_close_database();
42 
43  /* send the return code */
44  if (stat != DB_OK) {
46  return DB_OK;
47  }
49 
50  /* clear the driver state */
53 
54  /* no results */
55  return DB_OK;
56 }
void db__close_all_cursors(void)
Close all cursors.
Definition: driver_state.c:122
void db_error(const char *s)
int stat
Definition: g3dcolor.c:369
#define DB_SEND_FAILURE()
Definition: macros.h:9
void db__mark_database_closed(void)
Mark database as closed.
Definition: driver_state.c:67
int db__test_database_open(void)
Test database connection.
Definition: driver_state.c:46
#define DB_SEND_SUCCESS()
Definition: macros.h:7
int db_d_close_database(void)
Close database connection.
Definition: d_closedb.c:25
void db__init_driver_state(void)
Initialize driver state.
Definition: driver_state.c:25
int(* db_driver_close_database)()