18 #include <grass/gis.h>
19 #include <grass/glocale.h>
23 char buff[1024], answer[50];
30 if (
NULL == (Tmp_fd = fopen(Tmp_file,
"w"))) {
33 fprintf(Tmp_fd,
"sphere\n");
35 fprintf(Tmp_fd,
"%s\n", sph);
42 fprintf(stderr, _(
"\nPlease specify ellipsoid name\n"));
44 _(
"Enter 'list' for the list of available ellipsoids\n"));
45 fprintf(stderr, _(
"Hit RETURN to cancel request\n"));
49 if (strlen(answer) == 0)
51 if (strcmp(answer,
"list") == 0) {
54 pager =
getenv(
"GRASS_PAGER");
55 if (!pager || strlen(pager) == 0)
59 sprintf(buff,
"%s \"%s\" 1>&2", pager,
64 if (strcmp(answer,
"sphere") == 0)
67 fprintf(stderr, _(
"\ninvalid ellipsoid\n"));
73 sprintf(spheroid,
"%s", answer);
75 if (strcmp(spheroid,
"sphere") == 0) {
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
char * G_convert_dirseps_to_host(char *path)
Converts directory separator characters in a string to the native host separator character (/ on Unix...
char * G_tempfile(void)
Returns a temporary file name.
int G_strip(char *buf)
Removes all leading and trailing white space from string.
int G_ask_ellipse_name(char *spheroid)
char * G_ellipsoid_name(int n)
get ellipsoid name
int G_get_ellipsoid_by_name(const char *name, double *a, double *e2)
get ellipsoid parameters by name
int G_system(const char *command)
Run a shell level command.
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.