=================================================================== RCS file: /home/cvs/OpenXM_contrib/gnuplot/Attic/plot.c,v retrieving revision 1.1.1.2 retrieving revision 1.1.1.3 diff -u -p -r1.1.1.2 -r1.1.1.3 --- OpenXM_contrib/gnuplot/Attic/plot.c 2000/01/22 14:15:59 1.1.1.2 +++ OpenXM_contrib/gnuplot/Attic/plot.c 2003/09/15 07:09:25 1.1.1.3 @@ -1,5 +1,5 @@ #ifndef lint -static char *RCSid = "$Id: plot.c,v 1.1.1.2 2000/01/22 14:15:59 maekawa Exp $"; +static char *RCSid = "$Id: plot.c,v 1.1.1.3 2003/09/15 07:09:25 ohara Exp $"; #endif /* GNUPLOT - plot.c */ @@ -34,14 +34,22 @@ static char *RCSid = "$Id: plot.c,v 1.1.1.2 2000/01/22 * to the extent permitted by applicable law. ]*/ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include +#include #include "plot.h" #include "fit.h" #include "setshow.h" #include "fnproto.h" -#include +#ifdef HAVE_SYS_UTSNAME_H +# include +#endif + #if defined(MSDOS) || defined(DOS386) || defined(__EMX__) # include #endif @@ -87,6 +95,7 @@ char *infile_name = NULL; /* name of command file; NUL #ifdef HAVE_LIBREADLINE extern char *rl_readline_name; extern int rl_complete_with_tilde_expansion; +extern char *rl_terminal_name; #endif #ifdef X11 @@ -105,9 +114,9 @@ char HelpFile[MAXPATH]; /* a longjmp buffer to get back to the command line */ #ifdef _Windows -static jmp_buf far command_line_env; +static JMP_BUF far command_line_env; #else -static jmp_buf command_line_env; +static JMP_BUF command_line_env; #endif static void load_rcfile __PROTO((void)); @@ -254,7 +263,7 @@ int anint; #else term_reset(); (void) putc('\n', stderr); - longjmp(command_line_env, TRUE); /* return to prompt */ + LONGJMP(command_line_env, TRUE); /* return to prompt */ #endif } @@ -310,7 +319,7 @@ take_privilege() /* a wrapper for longjmp so we can keep everything local */ void bail_to_command_line() { - longjmp(command_line_env, TRUE); + LONGJMP(command_line_env, TRUE); } #if defined(_Windows) || defined(_Macintosh) @@ -382,6 +391,7 @@ char **argv; #ifdef HAVE_LIBREADLINE rl_readline_name = argv[0]; rl_complete_with_tilde_expansion = 1; + rl_terminal_name = getenv("TERM"); #endif #ifdef X11 @@ -421,7 +431,7 @@ char **argv; #endif gpoutfile = stdout; - (void) Gcomplex(&udv_pi.udv_value, Pi, 0.0); + (void) Gcomplex(&udv_pi.udv_value, M_PI, 0.0); init_memory(); @@ -446,6 +456,33 @@ char **argv; else noinputfiles = TRUE; + /* Need this before show_version is called for the first time */ + +#ifdef HAVE_SYS_UTSNAME_H + { + struct utsname uts; + + /* something is fundamentally wrong if this fails ... */ + if (uname(&uts) > -1) { +# ifdef _AIX + strcpy(os_name, uts.sysname); + sprintf(os_name, "%s.%s", uts.version, uts.release); +# elif defined(SCO) + strcpy(os_name, "SCO"); + strcpy(os_rel, uts.release); +# else + strcpy(os_name, uts.sysname); + strcpy(os_rel, uts.release); +# endif + } + } +#else /* ! HAVE_SYS_UTSNAME_H */ + + strcpy(os_name, OS); + strcpy(os_rel, ""); + +#endif /* HAVE_SYS_UTSNAME_H */ + if (interactive) show_version(stderr); @@ -457,7 +494,7 @@ char **argv; done(status[1]); #endif /* VMS */ - if (!setjmp(command_line_env)) { + if (!SETJMP(command_line_env, 1)) { /* first time */ interrupt_setup(); load_rcfile(); @@ -701,11 +738,11 @@ ULONG RexxInterface(PRXSTRING rxCmd, PUSHORT pusErr, P */ { int rc; - static jmp_buf keepenv; + static JMP_BUF keepenv; int cmdlen; - memcpy(keepenv, command_line_env, sizeof(jmp_buf)); - if (!setjmp(command_line_env)) { + memcpy(keepenv, command_line_env, sizeof(JMP_BUF)); + if (!SETJMP(command_line_env, 1)) { /* set variable input_line. * Watch out for line length of NOT_ZERO_TERMINATED strings ! */ cmdlen = rxCmd->strlength + 1; @@ -721,7 +758,7 @@ ULONG RexxInterface(PRXSTRING rxCmd, PUSHORT pusErr, P *pusErr = RXSUBCOM_ERROR; RexxSetHalt(getpid(), 1); } - memcpy(command_line_env, keepenv, sizeof(jmp_buf)); + memcpy(command_line_env, keepenv, sizeof(JMP_BUF)); return 0; } #endif