GRASS 8 Programmer's Manual
8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
loc_info.c
Go to the documentation of this file.
1
#include <
grass/imagery.h
>
2
#include <
stdio.h
>
3
#include <
string.h
>
4
#include <
grass/gis.h
>
5
6
/* makes a three part title with location, mapset info */
7
char
*
I_location_info
(
const
char
*
middle
)
8
{
9
char
left[80];
10
char
right[80];
11
char
*buf;
12
int
len,
buf_len
;
13
14
snprintf
(left, 80,
"LOCATION: %s"
,
G_location
());
15
snprintf
(right, 80,
"MAPSET: %s"
,
G_mapset
());
16
len = 79 -
strlen
(left) -
strlen
(
middle
) -
strlen
(right);
17
buf_len
= len +
strlen
(left) +
strlen
(
middle
) +
strlen
(right);
18
buf = (
char
*)
G_calloc
(
buf_len
,
sizeof
(
char
));
19
snprintf
(buf,
buf_len
,
"%s%*s%s%*s%s"
, left, len / 2,
""
,
middle
, len / 2,
20
""
, right);
21
22
return
buf;
23
}
AMI_STREAM
Definition
ami_stream.h:153
G_calloc
#define G_calloc(m, n)
Definition
defs/gis.h:140
G_location
const char * G_location(void)
Get current location name.
Definition
location.c:32
G_mapset
const char * G_mapset(void)
Get current mapset name.
Definition
gis/mapset.c:33
gis.h
imagery.h
I_location_info
char * I_location_info(const char *middle)
Definition
loc_info.c:7
stdio.h
string.h
lib
imagery
loc_info.c
Generated on Fri Apr 3 2026 06:59:54 for GRASS 8 Programmer's Manual by
1.9.8