18 #include <grass/gis.h>
19 #include <grass/glocale.h>
23 char path[GPATH_MAX], buff[GPATH_MAX], answer[50], *a;
24 struct Key_Value *in_proj_keys;
29 sprintf(path,
"%s/etc/projections",
G_gisbase());
30 while (access(path, 0) != 0)
35 npr = in_proj_keys->nitems;
37 if (
NULL == (Tmp_fd = fopen(Tmp_file,
"w"))) {
40 for (i = 0; i < npr; i++) {
41 fprintf(Tmp_fd,
"%s -- %s\n", in_proj_keys->key[i],
42 in_proj_keys->value[i]);
49 fprintf(stderr, _(
"\n\nPlease specify projection name\n"));
51 _(
"Enter 'list' for the list of available projections\n"));
52 fprintf(stderr, _(
"Hit RETURN to cancel request\n"));
57 if (strlen(answer) == 0)
59 if (strcmp(answer,
"list") == 0) {
62 pager =
getenv(
"GRASS_PAGER");
63 if (!pager || strlen(pager) == 0)
67 sprintf(buff,
"%s \"%s\" 1>&2", pager,
74 fprintf(stderr, _(
"\ninvalid projection\n"));
81 sprintf(proj_id,
"%s", answer);
82 sprintf(proj_name,
"%s", a);