10 #include <grass/imagery.h>
11 #include <grass/spawn.h>
13 static char *tempfile =
NULL;
33 temp = fopen(tempfile,
"w");
36 fprintf(temp,
"Available groups\n");
37 fprintf(temp,
"---------------------------------\n");
46 if ((ls = popen(buf,
"r"))) {
47 while (
G_getl2(buf,
sizeof(buf), ls)) {
49 fprintf(temp,
"%s", buf);
53 fprintf(temp,
" (%s)", title);
56 for (i = 0; i < ref.nfiles; i++)
57 fprintf(temp,
"\t%s in %s\n", ref.file[i].name,
60 fprintf(temp,
"\t** empty **\n");
69 fprintf(temp,
"no group files available\n");
70 fprintf(temp,
"---------------------------------\n");
74 fprintf(stdout,
"hit RETURN to continue -->");
83 char element[GNAME_MAX + 15];
94 sprintf(element,
"group/%s/subgroup", group);
97 temp = fopen(tempfile,
"w");
100 fprintf(temp,
"Available subgroups in group %s\n", group);
101 fprintf(temp,
"---------------------------------\n");
110 if ((ls = popen(buf,
"r"))) {
111 while (
G_getl2(buf,
sizeof(buf), ls)) {
113 fprintf(temp,
"%s\n", buf);
116 for (i = 0; i < ref.nfiles; i++)
117 fprintf(temp,
"\t%s in %s\n", ref.file[i].name,
120 fprintf(temp,
"\t** empty **\n");
127 fprintf(temp,
"no subgroup files available\n");
128 fprintf(temp,
"---------------------------------\n");
132 fprintf(stdout,
"hit RETURN to continue -->");