GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
target.c
Go to the documentation of this file.
1
#include <stdio.h>
2
#include <grass/gis.h>
3
#include <grass/imagery.h>
4
#include <grass/glocale.h>
5
22
int
I_get_target
(
const
char
*group,
char
*location,
char
*mapset)
23
{
24
FILE *fd;
25
int
ok;
26
27
*location = *mapset = 0;
28
G_suppress_warnings
(1);
29
fd =
I_fopen_group_file_old
(group,
"TARGET"
);
30
G_suppress_warnings
(0);
31
if
(fd ==
NULL
)
32
return
0;
33
34
ok = (fscanf(fd,
"%s %s"
, location, mapset) == 2);
35
fclose(fd);
36
if
(!ok) {
37
*location = *mapset = 0;
38
G_warning
(_(
"Unable to read target file for group [%s]"
), group);
39
}
40
41
return
ok;
42
}
43
44
62
int
I_put_target
(
const
char
*group,
const
char
*location,
const
char
*mapset)
63
{
64
FILE *fd;
65
66
fd =
I_fopen_group_file_new
(group,
"TARGET"
);
67
if
(fd ==
NULL
)
68
return
0;
69
70
fprintf(fd,
"%s\n%s\n"
, location, mapset);
71
fclose(fd);
72
73
return
1;
74
}
lib
imagery
target.c
Generated on Sun Mar 16 2014 05:07:48 for GRASS Programmer's Manual by
1.8.1.2