GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-d6dec75dd4
|
GIS library - environment routines (mapset) More...
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include "gis_local_proto.h"
Go to the source code of this file.
Functions | |
const char * | G_mapset (void) |
Get current mapset name. More... | |
const char * | G__mapset (void) |
Get current mapset name (internal use only) More... | |
char * | G_mapset_path (void) |
Get current mapset UNIX-like path. More... | |
char * | G__mapset_path (void) |
Get current mapset UNIX-like path (internal use only) More... | |
GIS library - environment routines (mapset)
(C) 2001-2009, 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.
Definition in file gis/mapset.c.
const char* G__mapset | ( | void | ) |
Get current mapset name (internal use only)
See G_mapset().
Definition at line 51 of file gis/mapset.c.
References G_getenv_nofatal().
Referenced by G__mapset_path(), and G_mapset().
char* G__mapset_path | ( | void | ) |
Get current mapset UNIX-like path (internal use only)
Allocated buffer should be freed by G_free(). See also G_mapset_path().
Definition at line 96 of file gis/mapset.c.
References G__mapset(), G_gisdbase(), G_location(), and G_malloc.
Referenced by G_mapset_path().
const char* G_mapset | ( | void | ) |
Get current mapset name.
Returns the name of the current mapset in the current location. This routine is often used when accessing files in the current mapset. See Mapsets for an explanation of mapsets.
G_fatal_error() is called on error.
Definition at line 33 of file gis/mapset.c.
References _, G__mapset(), and G_fatal_error().
Referenced by check_mapset_in_layer_name(), db_set_default_connection(), fopen_group_file_old(), fopen_subgroup_file_old(), G_make_mapset_element(), G_make_mapset_element_tmp(), G_rename(), Gs_save_3dview(), I_find_group(), I_find_group_file(), I_find_subgroup(), I_find_subgroup_file(), I_fopen_group_file_append(), I_fopen_group_file_new(), I_fopen_signature_file_old(), I_fopen_sigset_file_old(), I_fopen_subgroup_file_append(), I_fopen_subgroup_file_new(), I_get_control_points(), I_get_group(), I_list_subgroups(), I_location_info(), I_put_control_points(), M__empty(), M_do_copy(), M_do_remove(), M_do_rename(), main(), Rast3d_mask_file_exists(), Rast__check_for_auto_masking(), Rast__close_null(), Rast__mask_info(), Rast__open_null_write(), Rast__quant_export(), Rast__quant_import(), Rast_mask_is_present(), Rast_mask_name(), Rast_mask_status(), Rast_remove_colors(), Rast_write_range(), V1_close_ogr(), Vect_close(), Vect_copy(), Vect_hist_command(), Vect_remove_colors(), Vect_save_fidx(), and Vect_set_db_updated().
char* G_mapset_path | ( | void | ) |
Get current mapset UNIX-like path.
Allocated buffer should be freed by G_free(). See G__mapset_path().
Returns the full UNIX path name of the current mapset. For example, if the user is working in mapset user1, location spearfish in the /home/user/grassdata database directory, this routine will return a string which looks like /home/user/grassdata/spearfish/user1.
This function also checks if mapset path is readable by the current user. It calls G_fatal_error() on failure.
Definition at line 73 of file gis/mapset.c.
References _, G__mapset_path(), and G_fatal_error().