GRASS Programmer's Manual
6.4.2(2012)
|
00001 #include <grass/imagery.h> 00002 #include <string.h> 00003 #include <grass/gis.h> 00004 00005 /* makes a three part title with location, mapset info */ 00006 int I_location_info(char *buf, const char *middle) 00007 { 00008 char left[80]; 00009 char right[80]; 00010 int len; 00011 00012 sprintf(left, "LOCATION: %s", G_location()); 00013 sprintf(right, "MAPSET: %s", G_mapset()); 00014 len = 79 - strlen(left) - strlen(middle) - strlen(right); 00015 sprintf(buf, "%s%*s%s%*s%s", 00016 left, len / 2, "", middle, len / 2, "", right); 00017 00018 return 0; 00019 }