GRASS GIS 7 Programmer's Manual
7.0.3(2016)-r00000
|
GIS library - environment routines. More...
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Go to the source code of this file.
Functions | |
void | G_set_gisrc_mode (int mode) |
Set where to find/store variables. More... | |
int | G_get_gisrc_mode (void) |
Get info where variables are stored. More... | |
void | G_init_env (void) |
Initialize variables. More... | |
void | G__read_mapset_env (void) |
Force to read the mapset environment file VAR. More... | |
void | G__read_gisrc_env (void) |
Force to read the GISRC environment file. More... | |
const char * | G_getenv (const char *name) |
Get environment variable. More... | |
const char * | G_getenv2 (const char *name, int loc) |
Get variable from specific place. More... | |
const char * | G_getenv_nofatal (const char *name) |
Get environment variable. More... | |
const char * | G_getenv_nofatal2 (const char *name, int loc) |
Get environment variable from specific place. More... | |
void | G_setenv (const char *name, const char *value) |
Set environment variable (updates .gisrc) More... | |
void | G_setenv2 (const char *name, const char *value, int loc) |
Set environment variable from specific place (updates .gisrc) More... | |
void | G_setenv_nogisrc (const char *name, const char *value) |
Set environment name to value (doesn't update .gisrc) More... | |
void | G_setenv_nogisrc2 (const char *name, const char *value, int loc) |
Set environment name to value from specific place (doesn't update .gisrc) More... | |
void | G_unsetenv (const char *name) |
Remove name from environment. More... | |
void | G_unsetenv2 (const char *name, int loc) |
Remove name from environment from specific place. More... | |
void | G__write_env (void) |
Writes current environment to .gisrc. More... | |
const char * | G_get_env_name (int n) |
Get variable name for index n. More... | |
void | G__read_env (void) |
Initialize init array for G_VAR_GISRC. More... | |
void | G_create_alt_env (void) |
Set up alternative environment variables. More... | |
void | G_switch_env (void) |
Switch environments. More... | |
GIS library - environment routines.
(C) 2001-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.
Definition in file env.c.
void G__read_env | ( | void | ) |
void G__read_gisrc_env | ( | void | ) |
Force to read the GISRC environment file.
The GISRC file will be read into memory, ignoring if it was readed before. Existing values will be overwritten, new values appended.
Definition at line 112 of file env.c.
References b, G_fatal_error(), G_free(), G_getl2(), G_initialize_done(), G_is_initialized(), G_location_path(), G_mapset(), G_store(), G_strip(), name, and NULL.
void G__read_mapset_env | ( | void | ) |
Force to read the mapset environment file VAR.
The mapset specific VAR file of the mapset set with G_setenv() will be read into memory, ignoring if it was readed before. Existing values will be overwritten, new values appended.
void G__write_env | ( | void | ) |
void G_create_alt_env | ( | void | ) |
Set up alternative environment variables.
Definition at line 544 of file env.c.
Referenced by G_make_mapset().
const char* G_get_env_name | ( | int | n | ) |
int G_get_gisrc_mode | ( | void | ) |
const char* G_getenv | ( | const char * | name | ) |
Get environment variable.
G_fatal_error() is called when variable is not found.
name | variable name |
Definition at line 336 of file env.c.
References G_fatal_error(), G_getenv_nofatal(), and NULL.
Referenced by G_gisbase(), G_gisdbase(), and G_location().
const char* G_getenv2 | ( | const char * | name, |
int | loc | ||
) |
Get variable from specific place.
Locations:
G_fatal_error() is called when variable is not found.
name | variable name |
loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
Definition at line 362 of file env.c.
References G_fatal_error(), G_getenv_nofatal2(), and NULL.
const char* G_getenv_nofatal | ( | const char * | name | ) |
Get environment variable.
name | variable name |
Definition at line 381 of file env.c.
Referenced by G__mapset(), G_check_overwrite(), G_get_overwrite(), G_getenv(), and G_init_debug().
const char* G_getenv_nofatal2 | ( | const char * | name, |
int | loc | ||
) |
Get environment variable from specific place.
name | variable name |
loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
Definition at line 400 of file env.c.
Referenced by G_getenv2().
void G_init_env | ( | void | ) |
void G_set_gisrc_mode | ( | int | mode | ) |
void G_setenv | ( | const char * | name, |
const char * | value | ||
) |
Set environment variable (updates .gisrc)
If value is NULL, becomes an G_unsetenv().
name | variable name |
value | variable value |
void G_setenv2 | ( | const char * | name, |
const char * | value, | ||
int | loc | ||
) |
Set environment variable from specific place (updates .gisrc)
If value is NULL, becomes an G_unsetenv().
name | variable name |
value | variable value |
loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
void G_setenv_nogisrc | ( | const char * | name, |
const char * | value | ||
) |
Set environment name to value (doesn't update .gisrc)
name | variable name |
value | variable value |
Definition at line 448 of file env.c.
Referenced by G_check_overwrite(), G_make_location(), and G_make_mapset().
void G_setenv_nogisrc2 | ( | const char * | name, |
const char * | value, | ||
int | loc | ||
) |
void G_switch_env | ( | void | ) |
void G_unsetenv | ( | const char * | name | ) |