4
#include <grass/imagery.h>
8
/* read the target for the group and cast it into the alternate GRASS env */
12
static char buf[1024];
21
if (!I_get_target(group.name, location, mapset)) {
22
sprintf(buf, "Target information for group [%s] missing\n",
27
sprintf(buf, "%s/%s", G_gisdbase(), location);
28
if (access(buf, 0) != 0) {
29
sprintf(buf, "Target location [%s] not found\n", location);
33
G__setenv("LOCATION_NAME", location);
34
stat = G__mapset_permissions(mapset);
36
G__setenv("MAPSET", mapset);
37
G__create_alt_search_path();
39
G__switch_search_path();
43
sprintf(buf, "Mapset [%s] in target location [%s] - ", mapset, location);
44
strcat(buf, stat == 0 ? "permission denied\n" : "not found\n");
47
strcat(buf, "Please run i.target for group ");
48
strcat(buf, group.name);
54
int select_current_env(void)
58
G__switch_search_path();
65
int select_target_env(void)
69
G__switch_search_path();