00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <grass/gis.h>
00010
00011 char *
00012 G_get_dig_title (name, mapset)
00013 char *name;
00014 char *mapset;
00015 {
00016 FILE *fd;
00017 int stat;
00018 char title[100];
00019
00020 stat = -1;
00021 fd = G_fopen_old ("dig_cats", name, mapset);
00022 if (fd)
00023 {
00024 stat = 1;
00025 if (!fgets(title, sizeof title, fd))
00026 stat = -1;
00027 else if (!G_getl(title, sizeof title, fd))
00028 stat = -1;
00029
00030 fclose (fd);
00031 }
00032
00033 if (stat < 0)
00034 *title = 0;
00035 else
00036 G_strip (title);
00037 return G_store(title) ;
00038 }