GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
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.
Macros | |
#define | ENV struct env |
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... | |
char * | G_getenv (const char *name) |
Get environment variable. More... | |
char * | G_getenv2 (const char *name, int loc) |
Read variable from specific place. More... | |
char * | G__getenv (const char *name) |
Get environment variable. More... | |
char * | G__getenv2 (const char *name, int loc) |
Get environment variable from specific place. More... | |
int | G_setenv (const char *name, const char *value) |
Set environment variable. More... | |
int | G_setenv2 (const char *name, const char *value, int loc) |
Set environment variable from specific place. More... | |
int | G__setenv (const char *name, const char *value) |
Set environment name to value. More... | |
int | G__setenv2 (const char *name, const char *value, int loc) |
Set environment name to value from specific place. More... | |
int | G_unsetenv (const char *name) |
Remove name from environment. More... | |
int | G_unsetenv2 (const char *name, int loc) |
Remove name from environment from specific place. More... | |
int | G__write_env (void) |
Writes current environment to .gisrc. More... | |
char * | G__env_name (int n) |
Get variable name for index n. More... | |
int | G__read_env (void) |
Initialize init array for G_VAR_GISRC. More... | |
int | G__set_gisrc_file (const char *name) |
Sets filename for gisrc. More... | |
char * | G__get_gisrc_file (void) |
Get gisrc filename. More... | |
int | G__create_alt_env (void) |
Set up alternative environment variables. More... | |
int | G__switch_env (void) |
Switch environments. More... | |
Variables | |
ENV | |
char * | name |
char * | value |
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 | ) |
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.
References getenv().
Referenced by db_start_driver(), dig_angle_next_line(), dig_build_area_with_line(), dig_file_load(), F_generate(), G__mapset(), G_check_overwrite(), G_debug(), G_getenv(), main(), submit(), and Vect_select_areas_by_box().
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.
References getenv().
Referenced by db_get_connection(), db_get_default_database_name(), db_get_default_driver_name(), db_get_default_group_name(), db_get_default_schema_name(), G_getenv2(), and Vect_default_field_info().
int G__read_env | ( | void | ) |
Initialize init array for G_VAR_GISRC.
\return | 0 |
Definition at line 495 of file env.c.
References init().
Referenced by F_generate().
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 db_driver(), G__make_location(), G__make_mapset(), G_check_overwrite(), main(), and make_location().
int G__switch_env | ( | void | ) |
int G__write_env | ( | void | ) |
int G_get_gisrc_mode | ( | void | ) |
Get info where variables are stored.
\return | mode |
Definition at line 71 of file env.c.
Referenced by db_start_driver().
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(), NULL, and value.
Referenced by db_driver(), G_gisbase(), G_gisdbase(), G_gishelp(), G_location(), and main().
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(), NULL, and value.
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 59 of file env.c.
References tools::mode.
Referenced by db_driver().
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 |
Definition at line 352 of file env.c.
Referenced by submit().
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 |
Definition at line 372 of file env.c.
Referenced by db_set_connection().
int G_unsetenv | ( | const char * | name | ) |
char* value |
Definition at line 30 of file env.c.
Referenced by db__copy_table(), db_convert_column_default_value_to_string(), db_convert_column_value_to_string(), db_convert_Cstring_to_column_default_value(), db_convert_Cstring_to_column_value(), db_select_CatValArray(), db_select_int(), db_select_value(), dglHeapInsertMax(), dglHeapInsertMin(), F_generate(), G3d_getDouble(), G3d_getFloat(), G3d_initDefaults(), G3d_putDouble(), G3d_putFloat(), G3d_retile(), G__read_Cell_head_array(), G_fread_key_value(), G_getenv(), G_getenv2(), G_parse_color_rule(), G_sites_open_old(), N_get_array_2d_c_value(), N_get_array_2d_d_value(), N_get_array_2d_f_value(), N_put_array_2d_value(), N_put_array_3d_value(), NetA_get_node_costs(), NetA_init_distinct(), NetA_init_timetable_from_db(), Nviz_set_attr(), Nviz_set_light_ambient(), Nviz_set_light_bright(), slice_calc(), slice_get_value(), submit(), Vect_set_varray_from_cat_list(), Vect_set_varray_from_db(), and Vedit_bulk_labeling().