|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-1878fdfec5
|
GIS library - environment routines (location) More...
#include <stdio.h>#include <string.h>#include <unistd.h>#include <sys/types.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_location (void) |
| Get current location name. | |
| char * | G_location_path (void) |
| Get current location UNIX-like path. | |
| char * | G__location_path (void) |
| Get current location UNIX-like path (internal use only) | |
GIS library - environment routines (location)
SPDX-FileCopyrightText: 2001-2008, 2012 GRASS Development Team SPDX-License-Identifier: GPL-2.0-or-later
Definition in file location.c.
Get current location UNIX-like path (internal use only)
Allocated buffer should be freed by G_free(). See also G_location_path().
Definition at line 75 of file location.c.
References G_gisdbase(), G_location(), G_malloc, HOST_DIRSEP, and name.
Referenced by G_location_path().
Get current location name.
Returns the name of the current database location. This routine should be used by modules that need to display the current location to the user. See Locations for an explanation of locations.
Definition at line 30 of file location.c.
References G_getenv().
Referenced by G__location_path(), G__mapset_path(), G_get_projepsg(), G_get_projinfo(), G_get_projsrid(), G_get_projunits(), G_get_projwkt(), G_make_mapset(), I_location_info(), Vect__open_old(), and Vect_hist_command().
Get current location UNIX-like path.
Allocated buffer should be freed by G_free(). See G__location_path().
Returns the full UNIX path name of the current database location. For example, if the user is working in location spearfish in the /home/user/grassdata database directory, this routine will return a string which looks like /home/user/grassdata/spearfish.
This function also checks if location path is readable by the current user. It calls G_fatal_error() on failure.
Definition at line 52 of file location.c.
References _, access, F_OK, G__location_path(), and G_fatal_error().
Referenced by db_set_default_connection(), G__gisinit(), and G_get_available_mapsets().