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