GRASS 8 Programmer's Manual 8.6.0dev(2026)-55de52a352
Loading...
Searching...
No Matches
db/dbmi_client/handler.c
Go to the documentation of this file.
1/*!
2 \file lib/db/dbmi_client/handler.c
3
4 \brief DBMI Library (client) - standard error handlers
5
6 SPDX-FileCopyrightText: 2013 GRASS Development Team
7 SPDX-License-Identifier: GPL-2.0-or-later
8
9 \author Martin Landa <landa.martin gmail.com>
10 */
11
12#include <grass/gis.h>
13#include <grass/dbmi.h>
14
15static void error_handler_driver(void *p)
16{
18
19 driver = (dbDriver *)p;
22}
23
24/*!
25 \brief Define standard error handler for open database connection
26
27 This handler:
28 - close database connection
29 - shutdown db driver
30
31 Note: It's recommended to call this routine after
32 db_start_driver_open_database().
33
34 \param driver DB driver
35 */
37{
38 G_add_error_handler(error_handler_driver, driver);
39}
40
41/*!
42 \brief Remove error handler before closing the driver
43
44 \param driver DB driver
45 */
void db_unset_error_handler_driver(dbDriver *driver)
Remove error handler before closing the driver.
void db_set_error_handler_driver(dbDriver *driver)
Define standard error handler for open database connection.
Main header of GRASS DataBase Management Interface.
int db_shutdown_driver(dbDriver *)
Closedown the driver, and free the driver structure.
Definition shutdown.c:33
int db_close_database(dbDriver *)
Close database connection.
Definition c_closedb.c:23
void G_remove_error_handler(void(*)(void *), void *)
Remove existing error handler.
Definition gis/handler.c:82
void G_add_error_handler(void(*)(void *), void *)
Add new error handler.
Definition gis/handler.c:68