GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73587
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gisbase.c File Reference
#include <grass/gis.h>
Include dependency graph for gisbase.c:

Go to the source code of this file.

Functions

const char * G_gisbase (void)
 Get full path name of the top level module directory. More...
 

Function Documentation

const char* G_gisbase ( void  )

Get full path name of the top level module directory.

Returns the full path name of the top level directory for GRASS programs. This directory will have subdirectories which will contain modules and files required for the running of the system. Some of these directories are:

bin    commands run by the user
etc    modules and data files used by GRASS commands

The use of G_gisbase() to find these subdirectories enables GRASS modules to be written independently of where the GRASS system is actually installed on the machine. For example, to run the module sroff in the GRASS etc directory:

char command[200];
sprintf(command, "%s/etc/sroff", G_gisbase());
G_spawn(command, "sroff", NULL);
Returns
pointer to a string

Definition at line 41 of file gisbase.c.

References G_getenv().

Referenced by db_read_dbmscap(), G_read_datum_table(), G_read_ellipsoid_table(), GPJ_get_datum_transform_by_name(), GPJ_osr_to_grass(), GPJ_set_csv_loc(), M_read_list(), parse_fontcap(), read_datum_table(), read_ellipsoid_table(), S_read(), and set_proj_lib().