GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
myname.c
Go to the documentation of this file.
1 
17 #include <string.h>
18 #include <grass/gis.h>
19 #include <grass/glocale.h>
20 
21 
35 char *G_myname(void)
36 {
37  static char name[GNAME_MAX];
38  char path[GPATH_MAX];
39  FILE *fd;
40  int ok;
41 
42  ok = 0;
43 
44  G__file_name(path, "", "MYNAME", "PERMANENT");
45  if ((fd = fopen(path, "r"))) {
46  ok = G_getl(name, sizeof name, fd);
47  fclose(fd);
48  }
49  if (!ok)
50  strcpy(name, _("This location has no description."));
51 
52  return name;
53 }
char * G_myname(void)
Returns location title.
Definition: myname.c:35
FILE * fd
Definition: g3dcolor.c:368
string name
Definition: render.py:1314
char * G__file_name(char *path, const char *element, const char *name, const char *mapset)
Builds full path names to GIS data files.
Definition: file_name.c:33
int G_getl(char *buf, int n, FILE *fd)
gets a line of text from a file
Definition: getl.c:17
fclose(fd)