GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
gishelp.c
Go to the documentation of this file.
1
/*
2
****************************************************************************
3
*
4
* MODULE: GRASS 5 gis library, gishelp.c
5
* AUTHOR(S): unknown
6
* PURPOSE: Print help information
7
* COPYRIGHT: (C) 2000 by the GRASS Development Team
8
*
9
* This program is free software under the GNU General Public
10
* License (>=v2). Read the file COPYING that comes with GRASS
11
* for details.
12
*
13
*****************************************************************************/
14
15
/*
16
**********************************************************************
17
*
18
* G_gishelp(helpfile, request)
19
* char *helpfile help directory where "request" is found
20
* char *request help file desired
21
*
22
* Prints a helpfile to the screen. Helpfiles are stored in directories
23
* associated with different GRID programs. A given file will be
24
* found in $GISBASE/txt/"helpfile"/"request".
25
*
26
**********************************************************************/
27
28
#include <grass/gis.h>
29
#include <grass/glocale.h>
30
#include <unistd.h>
31
#include <stdlib.h>
32
#include <grass/spawn.h>
33
#define GEN_HELP "gen_help"
34
35
int
G_gishelp
(
const
char
*helpfile,
const
char
*request)
36
{
37
char
file
[1024];
38
39
if
(request ==
NULL
)
40
request =
GEN_HELP
;
41
42
sprintf(file,
"%s/txt/%s/%s"
,
G_getenv
(
"GISBASE"
), helpfile, request);
43
44
if
(!access(file, 04)) {
45
fprintf(stderr, _(
"one moment...\n"
));
46
G_spawn
(
getenv
(
"GRASS_PAGER"
),
getenv
(
"GRASS_PAGER"
), file,
NULL
);
47
}
48
else
{
49
fprintf(stderr, _(
"No help available for command [%s]\n"
), request);
50
}
51
52
return
0;
53
}
lib
gis
gishelp.c
Generated on Wed Jun 6 2012 14:04:22 for GRASS Programmer's Manual by
1.8.1