GRASS Programmer's Manual 6.4.1(2011)
myname.c
Go to the documentation of this file.
00001 
00017 #include <string.h>
00018 #include <grass/gis.h>
00019 #include <grass/glocale.h>
00020 
00021 
00035 char *G_myname(void)
00036 {
00037     static char name[GNAME_MAX];
00038     char path[GPATH_MAX];
00039     FILE *fd;
00040     int ok;
00041 
00042     ok = 0;
00043 
00044     G__file_name(path, "", "MYNAME", "PERMANENT");
00045     if ((fd = fopen(path, "r"))) {
00046         ok = G_getl(name, sizeof name, fd);
00047         fclose(fd);
00048     }
00049     if (!ok)
00050         strcpy(name, _("This location has no description."));
00051 
00052     return name;
00053 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines