GRASS Programmer's Manual
6.4.1(2011)
|
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.
Defines | |
#define | ENV struct env |
Functions | |
void | G_set_gisrc_mode (int mode) |
Set where to find/store variables. | |
int | G_get_gisrc_mode (void) |
Get info where variables are stored. | |
char * | G_getenv (const char *name) |
Get environment variable. | |
char * | G_getenv2 (const char *name, int loc) |
Read variable from specific place. | |
char * | G__getenv (const char *name) |
Get environment variable. | |
char * | G__getenv2 (const char *name, int loc) |
Get environment variable from specific place. | |
int | G_setenv (const char *name, const char *value) |
Set environment variable. | |
int | G_setenv2 (const char *name, const char *value, int loc) |
Set environment variable from specific place. | |
int | G__setenv (const char *name, const char *value) |
Set environment name to value. | |
int | G__setenv2 (const char *name, const char *value, int loc) |
Set environment name to value from specific place. | |
int | G_unsetenv (const char *name) |
Remove name from environment. | |
int | G_unsetenv2 (const char *name, int loc) |
Remove name from environment from specific place. | |
int | G__write_env (void) |
Writes current environment to .gisrc. | |
char * | G__env_name (int n) |
Get variable name for index n. | |
int | G__read_env (void) |
Initialize init array for G_VAR_GISRC. | |
int | G__set_gisrc_file (const char *name) |
Sets filename for gisrc. | |
char * | G__get_gisrc_file (void) |
Get gisrc filename. | |
int | G__create_alt_env (void) |
Set up alternative environment variables. | |
int | G__switch_env (void) |
Switch environments. |
GIS library - environment routines.
(C) 2001-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.
Definition in file env.c.
#define ENV struct env |
Definition at line 25 of file env.c.
Referenced by G__switch_env().
int G__create_alt_env | ( | void | ) |
Set up alternative environment variables.
Definition at line 537 of file env.c.
References NULL.
Referenced by G__make_mapset().
char* G__env_name | ( | int | n | ) |
char* G__get_gisrc_file | ( | void | ) |
char* G__getenv | ( | const char * | name | ) |
Get environment variable.
name | variable name |
Definition at line 312 of file env.c.
Referenced by G__mapset(), G_check_overwrite(), G_debug(), and G_getenv().
char* G__getenv2 | ( | const char * | name, |
int | loc | ||
) |
Get environment variable from specific place.
name | variable name |
loc | location id |
Definition at line 331 of file env.c.
Referenced by G_getenv2().
int G__read_env | ( | void | ) |
int G__set_gisrc_file | ( | const char * | name | ) |
int G__setenv | ( | const char * | name, |
const char * | value | ||
) |
Set environment name to value.
name | variable name |
value | variable value |
Definition at line 388 of file env.c.
Referenced by G__make_location(), G__make_mapset(), and G_check_overwrite().
int G__setenv2 | ( | const char * | name, |
const char * | value, | ||
int | loc | ||
) |
int G__switch_env | ( | void | ) |
Switch environments.
Definition at line 561 of file env.c.
References ENV.
Referenced by G__make_mapset().
int G__write_env | ( | void | ) |
int G_get_gisrc_mode | ( | void | ) |
char* G_getenv | ( | const char * | name | ) |
Get environment variable.
Calls G_fatal_error() if name not set.
name | variable name |
Definition at line 267 of file env.c.
References G__getenv(), G_fatal_error(), and NULL.
Referenced by G_gisbase(), G_gisdbase(), G_gishelp(), and G_location().
char* G_getenv2 | ( | const char * | name, |
int | loc | ||
) |
Read variable from specific place.
Locations:
G_fatal_error() is called when variable is not found.
name | variable name |
loc | location id |
Definition at line 293 of file env.c.
References G__getenv2(), G_fatal_error(), and NULL.
void G_set_gisrc_mode | ( | int | mode | ) |
int G_setenv | ( | const char * | name, |
const char * | value | ||
) |
Set environment variable.
If value is NULL, becomes an G_unsetenv(). Updates .gisrc
name | variable name |
value | variable value |
int G_setenv2 | ( | const char * | name, |
const char * | value, | ||
int | loc | ||
) |
Set environment variable from specific place.
If value is NULL, becomes an G_unsetenv(). Updates .gisrc
name | variable name |
value | variable value |
loc | location id |
int G_unsetenv | ( | const char * | name | ) |
int G_unsetenv2 | ( | const char * | name, |
int | loc | ||
) |