GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
location.c File Reference

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 dependency graph for location.c:

Go to the source code of this file.

Functions

char * G_location_path (void)
 Get current location directory. More...
 
char * G_location (void)
 Get current location name. More...
 
char * G__location_path (void)
 Get current location path. More...
 

Detailed Description

GIS library - environment routines (location)

(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.

Author
Original author CERL

Definition in file location.c.

Function Documentation

char* G__location_path ( void  )

Get current location path.

Parameters
\returnchar* to location path

Definition at line 72 of file location.c.

References G_gisdbase(), G_location(), render::name, and sprintf().

Referenced by G__file_name(), G__file_name_misc(), and G_location_path().

char* G_location ( void  )

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.

Parameters
\returnchar* tolocation name

Definition at line 61 of file location.c.

References G_getenv().

Referenced by G__location_path(), G__make_mapset(), G_get_projinfo(), G_get_projunits(), I_location_info(), Vect__open_old(), Vect_delete(), Vect_hist_command(), and Vect_open_new().

char* G_location_path ( void  )

Get current location directory.

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.

Parameters
\returnchar *

Definition at line 37 of file location.c.

References G__location_path(), and G_fatal_error().

Referenced by db_set_default_connection(), G__gisinit(), G_available_mapsets(), and Vect_delete().