GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
progrm_nme.c
Go to the documentation of this file.
1
2
/**********************************************************************
3
*
4
* char *
5
* G_program_name()
6
*
7
* returns the current program name
8
*
9
**********************************************************************
10
*
11
* G_set_program_name(name)
12
* char *name
13
*
14
* program name set to name (name will be returned by G_program_name
15
*
16
**********************************************************************/
17
#include <string.h>
18
#include <grass/gis.h>
19
20
static
const
char
*
name
=
"?"
;
21
22
33
const
char
*
G_program_name
(
void
)
34
{
35
return
name
;
36
}
37
38
int
G_set_program_name
(
const
char
*
s
)
39
{
40
int
i;
41
char
*temp;
42
43
i = strlen(s);
44
while
(--i >= 0) {
45
if
(
G_is_dirsep
(s[i])) {
46
s += i + 1;
47
break
;
48
}
49
}
50
temp =
G_store
(s);
51
G_basename
(temp,
"exe"
);
52
name
=
G_store
(temp);
53
G_free
(temp);
54
55
return
0;
56
}
lib
gis
progrm_nme.c
Generated on Sat Oct 5 2013 12:11:09 for GRASS Programmer's Manual by
1.8.4