GRASS Programmer's Manual  6.4.2(2012)
 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 }