GRASS GIS 8 Programmer's Manual
8.5.0dev(2025)-565e82de51
Main Page
Related Pages
Data Structures
Data Structures
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
x
y
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
r
s
t
u
v
w
y
Enumerations
a
c
d
e
h
i
j
l
m
n
o
p
r
s
t
v
y
Enumerator
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
gisbase.c
Go to the documentation of this file.
1
/**********************************************************************
2
*
3
* char *
4
* G_gisbase()
5
*
6
* returns: pointer to string containing the base directory of
7
* GRASS-GRID
8
**********************************************************************/
9
10
#include <
grass/gis.h
>
11
12
/*!
13
* \brief Get full path name of the top level module directory
14
*
15
* Returns the full path name of the top level directory for GRASS
16
* programs. This directory will have subdirectories which will
17
* contain modules and files required for the running of the
18
* system. Some of these directories are:
19
20
\verbatim
21
bin commands run by the user
22
etc modules and data files used by GRASS commands
23
\endverbatim
24
25
* The use of G_gisbase() to find these subdirectories enables GRASS
26
* modules to be written independently of where the GRASS system is
27
* actually installed on the machine. For example, to run the module
28
* <i>sroff</i> in the GRASS <i>etc</i> directory:
29
30
\code
31
char command[200];
32
33
sprintf(command, "%s/etc/sroff", G_gisbase());
34
G_spawn(command, "sroff", NULL);
35
\endcode
36
*
37
* \return pointer to a string
38
*/
39
const
char
*
G_gisbase
(
void
)
40
{
41
return
G_getenv
(
"GISBASE"
);
42
}
G_getenv
const char * G_getenv(const char *)
Get environment variable.
Definition:
env.c:360
gis.h
G_gisbase
const char * G_gisbase(void)
Get full path name of the top level module directory.
Definition:
gisbase.c:39
lib
gis
gisbase.c
Generated on Thu Mar 20 2025 07:33:24 for GRASS GIS 8 Programmer's Manual by
1.9.1