dig_title.c

Go to the documentation of this file.
00001 /**************************************************************
00002  * char *G_get_cell_title (name, mapset)
00003  *   char *name        name of map file
00004  *   char *mapset      mapset containing name
00005  *
00006  *   returns pointer to string containing cell title. (from cats file)
00007  *************************************************************/
00008 
00009 #include "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))   /* skip number of cats */
00026             stat = -1;
00027         else if (!G_getl(title, sizeof title, fd))      /* read title */
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 }

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