GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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

char * G_gisbase (void)
 top level module directory More...
 

Function Documentation

char* G_gisbase ( void  )

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
txt help files
menu files used by the <i>grass3</i> menu interface

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);
Parameters
void
Returns
char *

Definition at line 42 of file gisbase.c.

References G_getenv().

Referenced by db_read_dbmscap(), ellipsoid_table_file(), F_open(), G_ask_proj_name(), GPJ__get_datum_params(), GPJ_get_datum_transform_by_name(), GPJ_osr_to_grass(), GPJ_set_csv_loc(), parse_freetypecap(), R_parse_monitorcap(), read_datum_table(), read_ellipsoid_table(), S_read(), and set_proj_lib().