Debian Codegraph @

imagery/i.ortho.photo/lib/camera.c

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