|
GRASS 8 Programmer's Manual 8.5.0(2026)-8d6ceba290
|
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. | |
| int | G_get_gisrc_mode (void) |
| Get info where variables are stored. | |
| void | G_init_env (void) |
| Initialize variables. | |
| void | G__read_mapset_env (void) |
| Force to read the mapset environment file VAR. | |
| void | G__read_gisrc_env (void) |
| Force to read the GISRC environment file. | |
| void | G__read_gisrc_path (void) |
| Read or read again the GISRC (session) environment variable. | |
| const char * | G_getenv (const char *name) |
| Get environment variable. | |
| const char * | G_getenv2 (const char *name, int loc) |
| Get variable from specific place. | |
| const char * | G_getenv_nofatal (const char *name) |
| Get environment variable. | |
| const char * | G_getenv_nofatal2 (const char *name, int loc) |
| Get environment variable from specific place. | |
| void | G_setenv (const char *name, const char *value) |
| Set environment variable (updates .gisrc). | |
| void | G_setenv2 (const char *name, const char *value, int loc) |
| Set environment variable from specific place (updates .gisrc). | |
| void | G_setenv_nogisrc (const char *name, const char *value) |
| Set environment name to value (doesn't update .gisrc). | |
| void | G_setenv_nogisrc2 (const char *name, const char *value, int loc) |
| Set environment name to value from specific place (doesn't update .gisrc). | |
| void | G_unsetenv (const char *name) |
| Remove name from environment. | |
| void | G_unsetenv2 (const char *name, int loc) |
| Remove name from environment from specific place. | |
| void | G__write_env (void) |
| Writes current environment to .gisrc. | |
| const char * | G_get_env_name (int n) |
| Get variable name for index n. | |
| void | G__read_env (void) |
| Initialize init array for G_VAR_GISRC. | |
| void | G_create_alt_env (void) |
| Set up alternative environment variables. | |
| void | G_switch_env (void) |
| Switch environments. | |
GIS library - environment routines.
(C) 2001-2026 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 | ) |
Initialize init array for G_VAR_GISRC.
Definition at line 561 of file env.c.
References G__read_env(), and st.
Referenced by G__read_env().
| 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 read before. Existing values will be overwritten, new values appended.
Definition at line 112 of file env.c.
References G__read_gisrc_env().
Referenced by G__read_gisrc_env().
| void G__read_gisrc_path | ( | void | ) |
Read or read again the GISRC (session) environment variable.
The GISRC environment variable will be read and its value stored, ignoring if it was read before.
Calls G_fatal_error when the GISRC variable is not set.
Definition at line 125 of file env.c.
References G__read_gisrc_path(), G_fatal_error(), and st.
Referenced by G__read_gisrc_path().
| 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 read before. Existing values will be overwritten, new values appended.
Definition at line 98 of file env.c.
References G__read_mapset_env().
Referenced by G__read_mapset_env().
| void G__write_env | ( | void | ) |
Writes current environment to .gisrc.
Definition at line 524 of file env.c.
References G__write_env(), and st.
Referenced by G__write_env().
| void G_create_alt_env | ( | void | ) |
Set up alternative environment variables.
Definition at line 569 of file env.c.
References G_create_alt_env(), NULL, and st.
Referenced by G_create_alt_env(), and G_make_mapset().
| const char * G_get_env_name | ( | int | n | ) |
Get variable name for index n.
For example:
| n | index of variable |
Definition at line 546 of file env.c.
References G_get_env_name(), NULL, and st.
Referenced by G_get_env_name().
| int G_get_gisrc_mode | ( | void | ) |
Get info where variables are stored.
Definition at line 73 of file env.c.
References G_get_gisrc_mode(), and st.
Referenced by G_get_gisrc_mode().
| 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 360 of file env.c.
References G_fatal_error(), G_getenv(), G_getenv_nofatal(), and NULL.
Referenced by G_getenv(), 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 386 of file env.c.
References G_fatal_error(), G_getenv2(), G_getenv_nofatal2(), and NULL.
Referenced by G_getenv2().
| const char * G_getenv_nofatal | ( | const char * | name | ) |
Get environment variable.
| name | variable name |
Definition at line 405 of file env.c.
References G_getenv_nofatal().
Referenced by G__mapset(), G_check_overwrite(), G_define_standard_option(), G_getenv(), G_getenv_nofatal(), G_init_debug(), and G_parser().
| 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 424 of file env.c.
References G_getenv_nofatal2().
Referenced by G_getenv2(), and G_getenv_nofatal2().
| void G_init_env | ( | void | ) |
Initialize variables.
Definition at line 83 of file env.c.
References G_init_env().
Referenced by G_init_all(), and G_init_env().
| void G_set_gisrc_mode | ( | int | mode | ) |
Set where to find/store variables.
Modes:
| mode | mode to find/store variables (G_GISRC_MODE_FILE by default) |
Definition at line 63 of file env.c.
References G_set_gisrc_mode(), and st.
Referenced by G_set_gisrc_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 |
Definition at line 442 of file env.c.
References G_setenv().
Referenced by G_setenv().
| 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) |
Definition at line 459 of file env.c.
References G_setenv2().
Referenced by G_setenv2().
| 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 472 of file env.c.
References G_setenv_nogisrc().
Referenced by G_check_overwrite(), G_make_location(), G_make_mapset(), and G_setenv_nogisrc().
| void G_setenv_nogisrc2 | ( | const char * | name, |
| const char * | value, | ||
| int | loc ) |
Set environment name to value from specific place (doesn't update .gisrc).
| name | variable name |
| value | variable value |
| loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
Definition at line 486 of file env.c.
References G_setenv_nogisrc2().
Referenced by G_setenv_nogisrc2().
| void G_switch_env | ( | void | ) |
Switch environments.
Definition at line 591 of file env.c.
References G_switch_env(), and st.
Referenced by G_make_mapset(), and G_switch_env().
| void G_unsetenv | ( | const char * | name | ) |
Remove name from environment.
Updates .gisrc
| name | variable name |
Definition at line 499 of file env.c.
References G_unsetenv().
Referenced by G_unsetenv().
| void G_unsetenv2 | ( | const char * | name, |
| int | loc ) |
Remove name from environment from specific place.
Updates .gisrc
| name | variable name |
| loc | location (G_VAR_GISRC, G_VAR_MAPSET) |
Definition at line 514 of file env.c.
References G_unsetenv2().
Referenced by G_unsetenv2().