version 1.1.1.2, 2000/01/22 14:15:59 |
version 1.1.1.3, 2003/09/15 07:09:25 |
Line 34 static char *RCSid = "$Id$"; |
|
Line 34 static char *RCSid = "$Id$"; |
|
* to the extent permitted by applicable law. |
* to the extent permitted by applicable law. |
]*/ |
]*/ |
|
|
|
#ifdef HAVE_CONFIG_H |
|
# include "config.h" |
|
#endif |
|
|
#include <signal.h> |
#include <signal.h> |
|
#include <setjmp.h> |
|
|
#include "plot.h" |
#include "plot.h" |
#include "fit.h" |
#include "fit.h" |
#include "setshow.h" |
#include "setshow.h" |
#include "fnproto.h" |
#include "fnproto.h" |
#include <setjmp.h> |
|
|
|
|
#ifdef HAVE_SYS_UTSNAME_H |
|
# include <sys/utsname.h> |
|
#endif |
|
|
#if defined(MSDOS) || defined(DOS386) || defined(__EMX__) |
#if defined(MSDOS) || defined(DOS386) || defined(__EMX__) |
# include <io.h> |
# include <io.h> |
#endif |
#endif |
Line 87 char *infile_name = NULL; /* name of command file; NUL |
|
Line 95 char *infile_name = NULL; /* name of command file; NUL |
|
#ifdef HAVE_LIBREADLINE |
#ifdef HAVE_LIBREADLINE |
extern char *rl_readline_name; |
extern char *rl_readline_name; |
extern int rl_complete_with_tilde_expansion; |
extern int rl_complete_with_tilde_expansion; |
|
extern char *rl_terminal_name; |
#endif |
#endif |
|
|
#ifdef X11 |
#ifdef X11 |
Line 105 char HelpFile[MAXPATH]; |
|
Line 114 char HelpFile[MAXPATH]; |
|
|
|
/* a longjmp buffer to get back to the command line */ |
/* a longjmp buffer to get back to the command line */ |
#ifdef _Windows |
#ifdef _Windows |
static jmp_buf far command_line_env; |
static JMP_BUF far command_line_env; |
#else |
#else |
static jmp_buf command_line_env; |
static JMP_BUF command_line_env; |
#endif |
#endif |
|
|
static void load_rcfile __PROTO((void)); |
static void load_rcfile __PROTO((void)); |
|
|
#else |
#else |
term_reset(); |
term_reset(); |
(void) putc('\n', stderr); |
(void) putc('\n', stderr); |
longjmp(command_line_env, TRUE); /* return to prompt */ |
LONGJMP(command_line_env, TRUE); /* return to prompt */ |
#endif |
#endif |
} |
} |
|
|
Line 310 take_privilege() |
|
Line 319 take_privilege() |
|
/* a wrapper for longjmp so we can keep everything local */ |
/* a wrapper for longjmp so we can keep everything local */ |
void bail_to_command_line() |
void bail_to_command_line() |
{ |
{ |
longjmp(command_line_env, TRUE); |
LONGJMP(command_line_env, TRUE); |
} |
} |
|
|
#if defined(_Windows) || defined(_Macintosh) |
#if defined(_Windows) || defined(_Macintosh) |
|
|
#ifdef HAVE_LIBREADLINE |
#ifdef HAVE_LIBREADLINE |
rl_readline_name = argv[0]; |
rl_readline_name = argv[0]; |
rl_complete_with_tilde_expansion = 1; |
rl_complete_with_tilde_expansion = 1; |
|
rl_terminal_name = getenv("TERM"); |
#endif |
#endif |
|
|
#ifdef X11 |
#ifdef X11 |
|
|
#endif |
#endif |
|
|
gpoutfile = stdout; |
gpoutfile = stdout; |
(void) Gcomplex(&udv_pi.udv_value, Pi, 0.0); |
(void) Gcomplex(&udv_pi.udv_value, M_PI, 0.0); |
|
|
init_memory(); |
init_memory(); |
|
|
|
|
else |
else |
noinputfiles = TRUE; |
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) |
if (interactive) |
show_version(stderr); |
show_version(stderr); |
|
|
|
|
done(status[1]); |
done(status[1]); |
#endif /* VMS */ |
#endif /* VMS */ |
|
|
if (!setjmp(command_line_env)) { |
if (!SETJMP(command_line_env, 1)) { |
/* first time */ |
/* first time */ |
interrupt_setup(); |
interrupt_setup(); |
load_rcfile(); |
load_rcfile(); |
Line 701 ULONG RexxInterface(PRXSTRING rxCmd, PUSHORT pusErr, P |
|
Line 738 ULONG RexxInterface(PRXSTRING rxCmd, PUSHORT pusErr, P |
|
*/ |
*/ |
{ |
{ |
int rc; |
int rc; |
static jmp_buf keepenv; |
static JMP_BUF keepenv; |
int cmdlen; |
int cmdlen; |
|
|
memcpy(keepenv, command_line_env, sizeof(jmp_buf)); |
memcpy(keepenv, command_line_env, sizeof(JMP_BUF)); |
if (!setjmp(command_line_env)) { |
if (!SETJMP(command_line_env, 1)) { |
/* set variable input_line. |
/* set variable input_line. |
* Watch out for line length of NOT_ZERO_TERMINATED strings ! */ |
* Watch out for line length of NOT_ZERO_TERMINATED strings ! */ |
cmdlen = rxCmd->strlength + 1; |
cmdlen = rxCmd->strlength + 1; |
Line 721 ULONG RexxInterface(PRXSTRING rxCmd, PUSHORT pusErr, P |
|
Line 758 ULONG RexxInterface(PRXSTRING rxCmd, PUSHORT pusErr, P |
|
*pusErr = RXSUBCOM_ERROR; |
*pusErr = RXSUBCOM_ERROR; |
RexxSetHalt(getpid(), 1); |
RexxSetHalt(getpid(), 1); |
} |
} |
memcpy(command_line_env, keepenv, sizeof(jmp_buf)); |
memcpy(command_line_env, keepenv, sizeof(JMP_BUF)); |
return 0; |
return 0; |
} |
} |
#endif |
#endif |