00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "gis.h"
00010
00011
00026 char *
00027 G_get_cell_title (name, mapset)
00028 char *name;
00029 char *mapset;
00030 {
00031 FILE *fd;
00032 int stat;
00033 char title[1024];
00034
00035 stat = -1;
00036 fd = G_fopen_old ("cats", name, mapset);
00037 if (fd)
00038 {
00039 stat = 1;
00040 if (!fgets(title, sizeof title, fd))
00041 stat = -1;
00042 else if (!G_getl(title, sizeof title, fd))
00043 stat = -1;
00044
00045 fclose (fd);
00046 }
00047
00048 if (stat < 0)
00049 *title = 0;
00050 else
00051 G_strip (title);
00052 return G_store(title) ;
00053 }