GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
db/dbmi_base/default_name.c File Reference

DBMI Library (base) - default settings. More...

#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
Include dependency graph for db/dbmi_base/default_name.c:

Go to the source code of this file.

Functions

const char * db_get_default_driver_name (void)
 Get driver name from current DB connection settings. More...
 
const char * db_get_default_database_name (void)
 Get database name from current DB connection settings. More...
 
const char * db_get_default_schema_name (void)
 Get schema name from current DB connection settings. More...
 
const char * db_get_default_group_name (void)
 Get group name from current DB connection settings. More...
 
int db_set_default_connection (void)
 Sets up database connection settings using GRASS default from dbmi.h. More...
 

Detailed Description

DBMI Library (base) - default settings.

Temporal GIS Library (base) - default settings.

(C) 1999-2010 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.

Author
Joel Jones (CERL/UIUC)
Upgraded to GRASS 5.7 by Radim Blazek

(C) 2012-2014 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.

Author
Soeren Gebbert Code is based on the dbmi library written by Joel Jones (CERL/UIUC) and Radim Blazek

Definition in file db/dbmi_base/default_name.c.

Function Documentation

◆ db_get_default_database_name()

const char* db_get_default_database_name ( void  )

Get database name from current DB connection settings.

Returns
pointer to database name
NULL if not set

Definition at line 43 of file db/dbmi_base/default_name.c.

References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.

◆ db_get_default_driver_name()

const char* db_get_default_driver_name ( void  )

Get driver name from current DB connection settings.

Returns
pointer to driver name
NULL if not set

Definition at line 27 of file db/dbmi_base/default_name.c.

References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.

◆ db_get_default_group_name()

const char* db_get_default_group_name ( void  )

Get group name from current DB connection settings.

Returns
pointer to group name
NULL if not set

Definition at line 75 of file db/dbmi_base/default_name.c.

References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.

◆ db_get_default_schema_name()

const char* db_get_default_schema_name ( void  )

Get schema name from current DB connection settings.

Returns
pointer to schema name
NULL if not set

Definition at line 59 of file db/dbmi_base/default_name.c.

References G_getenv_nofatal2(), G_store(), G_VAR_MAPSET, and NULL.

◆ db_set_default_connection()

int db_set_default_connection ( void  )

Sets up database connection settings using GRASS default from dbmi.h.

This function ignores current DB connection settings and uses GRASS default settings instead.

Todo:
DB_OK on success, DB_* error code on fail
Returns
returns DB_OK

Definition at line 95 of file db/dbmi_base/default_name.c.

References _, _db_connection::databaseName, DB_DEFAULT_DRIVER, DB_OK, db_set_connection(), _db_connection::driverName, G_debug(), G_fatal_error(), G_location_path(), G_make_mapset_object_group(), G_mapset(), G_zero(), and GPATH_MAX.