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

« back to all changes in this revision

Viewing changes to imagery/i.ortho.photo/lib/fopen_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
#include <grass/gis.h>
 
2
 
 
3
/******************************************************
 
4
* I_fopen_cam_file_new()
 
5
* I_fopen_cam_file_append()
 
6
* I_fopen_cam_file_old()
 
7
*
 
8
* fopen new camera files in the current mapset
 
9
* fopen old camera files anywhere
 
10
*******************************************************/
 
11
static int error(char *, char *, char *);
 
12
 
 
13
FILE *I_fopen_cam_file_new(char *camera)
 
14
{
 
15
    FILE *fd;
 
16
 
 
17
    fd = G_fopen_new("camera", camera);
 
18
    if (!fd)
 
19
        error(camera, "can't create ", "");
 
20
    return fd;
 
21
}
 
22
 
 
23
FILE *I_fopen_cam_file_append(char *camera)
 
24
{
 
25
    FILE *fd;
 
26
 
 
27
    fd = G_fopen_append("camera", camera);
 
28
    if (!fd)
 
29
        error(camera, "unable to open ", "");
 
30
    return fd;
 
31
}
 
32
 
 
33
FILE *I_fopen_cam_file_old(char *camera)
 
34
{
 
35
    FILE *fd;
 
36
 
 
37
    fd = G_fopen_old("camera", camera, G_mapset());
 
38
    if (!fd)
 
39
        error(camera, "can't open ", "");
 
40
    return fd;
 
41
}
 
42
 
 
43
static int error(char *camera, char *msga, char *msgb)
 
44
{
 
45
    char buf[100];
 
46
 
 
47
    sprintf(buf, "%s camera file [%s] in [%s %s] %s",
 
48
            msga, camera, G_location(), G_mapset(), msgb);
 
49
    G_warning(buf);
 
50
 
 
51
    return 0;
 
52
}