GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-112dd97adf
temporal/lib/connect.c File Reference

Temporal GIS Library - connect to TGIS DB. More...

#include <grass/temporal.h>
#include <grass/glocale.h>
Include dependency graph for temporal/lib/connect.c:

Go to the source code of this file.

Macros

#define DRIVER_NAME   0
 
#define DATABASE_NAME   1
 

Functions

char * tgis_get_driver_name (void)
 Get TGIS driver name. More...
 
char * tgis_get_database_name (void)
 Get TGIS database name. More...
 
int tgis_set_connection (dbConnection *connection)
 Set Temporal GIS DB connection settings. More...
 
int tgis_get_connection (dbConnection *connection)
 Get Temporal GIS DB connection settings. More...
 
char * tgis_get_mapset_driver_name (const char *mapset)
 Get TGIS driver name from a specific mapset. More...
 
char * tgis_get_mapset_database_name (const char *mapset)
 Get TGIS database name. More...
 

Detailed Description

Temporal GIS Library - connect to TGIS DB.

(C) 2012 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 temporal/lib/connect.c.

Macro Definition Documentation

◆ DATABASE_NAME

#define DATABASE_NAME   1

Definition at line 91 of file temporal/lib/connect.c.

◆ DRIVER_NAME

#define DRIVER_NAME   0

Definition at line 90 of file temporal/lib/connect.c.

Function Documentation

◆ tgis_get_connection()

int tgis_get_connection ( dbConnection connection)

Get Temporal GIS DB connection settings.

Parameters
[out]connectionpointer to dbConnection to be modified
Returns
DB_OK

Definition at line 78 of file temporal/lib/connect.c.

References _db_connection::databaseName, DB_OK, _db_connection::driverName, G_getenv_nofatal2(), G_VAR_MAPSET, and G_zero().

◆ tgis_get_database_name()

char* tgis_get_database_name ( void  )

Get TGIS database name.

Returns
pointer to TGIS database name
NULL if not set

Definition at line 41 of file temporal/lib/connect.c.

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

◆ tgis_get_driver_name()

char* tgis_get_driver_name ( void  )

Get TGIS driver name.

Returns
pointer to TGIS driver name
NULL if not set

Definition at line 25 of file temporal/lib/connect.c.

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

◆ tgis_get_mapset_database_name()

char* tgis_get_mapset_database_name ( const char *  mapset)

Get TGIS database name.

This function give a warning in case the mapset does not exists or it is not allowed to access the mapset. NULL is returned in this case..

Parameters
mapsetThe name of the mapset to receive the driver name from
Returns
pointer to TGIS database name
NULL if not set

Definition at line 168 of file temporal/lib/connect.c.

◆ tgis_get_mapset_driver_name()

char* tgis_get_mapset_driver_name ( const char *  mapset)

Get TGIS driver name from a specific mapset.

This function give a warning in case the mapset does not exists or it is not allowed to access the mapset. NULL is returned in this case.

Parameters
mapsetThe name of the mapset to receive the driver name from
Returns
pointer to TGIS driver name
NULL if not set

Definition at line 152 of file temporal/lib/connect.c.

◆ tgis_set_connection()

int tgis_set_connection ( dbConnection connection)

Set Temporal GIS DB connection settings.

This function sets environmental variables as TGISDB_DRIVER, TGISDB_DATABASE.

Parameters
connectionpointer to dbConnection with default settings
Returns
DB_OK

Definition at line 60 of file temporal/lib/connect.c.

References _db_connection::databaseName, DB_OK, _db_connection::driverName, G_setenv2(), and G_VAR_MAPSET.