myname.c

Go to the documentation of this file.
00001 /**********************************************************************
00002  *
00003  *   char *
00004  *   G_myname()
00005  *
00006  *   returns pointer to string containing the descriptive
00007  *   name of the data base.
00008  *
00009  *   note:
00010  *    This name is the first line in the file 
00011  *    $GISDBASE/$LOCATION_NAME/PERMANENT/MYNAME
00012  *
00013  **********************************************************************/
00014 #include <string.h>
00015 #include "gis.h"
00016 #include "glocale.h"
00017 
00018 
00031 char *
00032 G_myname()
00033 {
00034     static char name[128];
00035     char path[500];
00036     FILE *fd;
00037     int ok;
00038 
00039     ok = 0;
00040 
00041     G__file_name (path,"","MYNAME","PERMANENT");
00042     if ((fd = fopen(path,"r")))
00043     {
00044         ok = G_getl(name, sizeof name, fd);
00045         fclose (fd);
00046     }
00047     if (!ok)
00048         strcpy(name, _("Unknown Location")) ;
00049 
00050     return name;
00051 }

Generated on Wed Aug 23 17:49:22 2006 for GRASS by  doxygen 1.4.7