Loading...
Searching...
No Matches
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.

## Function Documentation

## G_gisbase()

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];
snprintf(command, sizeof(command), "%s/etc/sroff", G_gisbase());
G_spawn(command, "sroff", NULL);
NULL
#define NULL
Definition ccmath.h:32
G_gisbase
const char * G_gisbase(void)
Get full path name of the top level module directory.
Definition gisbase.c:39
G_spawn
int G_spawn(const char *command,...)
Spawn new process based on command.
Definition spawn.c:920

Returns
  pointer to a string

Definition at line 39 of file gisbase.c.

References G_getenv().

Referenced by 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(), and S_read().