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

« back to all changes in this revision

Viewing changes to imagery/i.ortho.photo/libes/camera.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
 
* I_get_group_camera (group, &Cam_Ref);
4
 
* I_put_group_camera (group, &Cam_Ref);
5
 
**********************************************************/
6
 
#include "orthophoto.h"
7
 
#include <grass/ortholib.h>
8
 
#include <grass/glocale.h>
9
 
 
10
 
/* Put the "camera" name into the group file "CAMERA" */
11
 
int I_put_group_camera(char *group, char *camera)
12
 
{
13
 
    FILE *fd;
14
 
 
15
 
    G_suppress_warnings(1);
16
 
    fd = I_fopen_group_camera_new(group);
17
 
    G_suppress_warnings(0);
18
 
    if (!fd)
19
 
        return 0;
20
 
 
21
 
    fprintf(fd, "%s\n", camera);
22
 
 
23
 
    return 0;
24
 
}
25
 
 
26
 
/* Return the camera name from the group file CAMERA */
27
 
int I_get_group_camera(char *group, char *camera)
28
 
{
29
 
    char buf[200];
30
 
    FILE *fd;
31
 
 
32
 
    G_suppress_warnings(1);
33
 
    fd = I_fopen_group_camera_old(group);
34
 
    G_suppress_warnings(0);
35
 
    if (!fd) {
36
 
        sprintf(buf,
37
 
                _("Unable to open camera file for group <%s> in mapset <%s>"),
38
 
                group, G_mapset());
39
 
        G_warning(buf);
40
 
        return 0;
41
 
    }
42
 
    G_getl2(buf, sizeof(buf), fd);
43
 
    sscanf(buf, "%s", camera);
44
 
    return 1;
45
 
}