GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
loc_info.c
Go to the documentation of this file.
1 #include <grass/imagery.h>
2 #include <string.h>
3 #include <grass/gis.h>
4 
5 /* makes a three part title with location, mapset info */
6 int I_location_info(char *buf, const char *middle)
7 {
8  char left[80];
9  char right[80];
10  int len;
11 
12  sprintf(left, "LOCATION: %s", G_location());
13  sprintf(right, "MAPSET: %s", G_mapset());
14  len = 79 - strlen(left) - strlen(middle) - strlen(right);
15  sprintf(buf, "%s%*s%s%*s%s",
16  left, len / 2, "", middle, len / 2, "", right);
17 
18  return 0;
19 }
char * G_mapset(void)
current mapset name
Definition: mapset.c:31
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
char * G_location(void)
Get current location name.
Definition: location.c:61
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
Definition: g3drange.c:62
int I_location_info(char *buf, const char *middle)
Definition: loc_info.c:6