GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72729
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

#define DATABASE_NAME   1

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

Referenced by tgis_get_mapset_database_name().

#define DRIVER_NAME   0

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

Referenced by tgis_get_mapset_driver_name().

Function Documentation

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 77 of file temporal/lib/connect.c.

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

char* tgis_get_database_name ( void  )

Get TGIS database name.

Returns
pointer to TGIS database name
NULL if not set

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

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

char* tgis_get_driver_name ( void  )

Get TGIS driver name.

Returns
pointer to TGIS driver name
NULL if not set

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

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

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 164 of file temporal/lib/connect.c.

References DATABASE_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 148 of file temporal/lib/connect.c.

References DRIVER_NAME.

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 59 of file temporal/lib/connect.c.

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

Referenced by tgis_set_default_connection().