~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to lib/gis/dig_title.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/**************************************************************
3
 
 * char *G_get_cell_title (name, mapset)
4
 
 *   char *name        name of map file
5
 
 *   char *mapset      mapset containing name
6
 
 *
7
 
 *   returns pointer to string containing cell title. (from cats file)
8
 
 *************************************************************/
9
 
 
10
 
#include <stdio.h>
11
 
#include <grass/gis.h>
12
 
 
13
 
char *G_get_dig_title(const char *name, const char *mapset)
14
 
{
15
 
    FILE *fd;
16
 
    int stat = -1;
17
 
    char title[100];
18
 
 
19
 
    fd = G_fopen_old("dig_cats", name, mapset);
20
 
    if (fd) {
21
 
        stat = 1;
22
 
        if (!fgets(title, sizeof title, fd))    /* skip number of cats */
23
 
            stat = -1;
24
 
        else if (!G_getl(title, sizeof title, fd))      /* read title */
25
 
            stat = -1;
26
 
 
27
 
        fclose(fd);
28
 
    }
29
 
 
30
 
    if (stat < 0)
31
 
        *title = 0;
32
 
    else
33
 
        G_strip(title);
34
 
 
35
 
    return G_store(title);
36
 
}