GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
shutdown.c File Reference

DBMI Library (client) - shutdown database connection. More...

#include <stdlib.h>
#include <grass/dbmi.h>
#include <grass/spawn.h>
#include "macros.h"
Include dependency graph for shutdown.c:

Go to the source code of this file.


int db_shutdown_driver (dbDriver *driver)
 Closedown the driver, and free the driver structure. More...

Detailed Description

DBMI Library (client) - shutdown database connection.

(C) 1999-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Joel Jones (CERL/UIUC), Radim Blazek

Definition in file shutdown.c.

Function Documentation

int db_shutdown_driver ( dbDriver driver)

Closedown the driver, and free the driver structure.

Note: the management of the memory for the driver structure probably should be handled differently.

db_start_driver() could take a pointer to driver structure as an argument, instead of returning the pointer to allocated then there would be no hidden free required

driverpointer to dbDriver to be freed
0 on success
-1 on error

Definition at line 36 of file shutdown.c.

References db__set_protocol_fds(), db_free(), DB_PROC_SHUTDOWN_DRIVER, DB_START_PROCEDURE_CALL, db_unset_error_handler_driver(), fclose(), G_wait(), NULL, _db_driver::pid, _db_driver::recv, and _db_driver::send.

Referenced by db_close_database_shutdown_driver(), db_start_driver_open_database(), IL_check_at_points_2d(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_write_ascii().