From 92063d602a1b07e4aeb849e08af2d06fb5883ba8 Mon Sep 17 00:00:00 2001 From: rlar Date: Mon, 2 Jan 2012 12:52:56 +0000 Subject: [PATCH] controlled_exit() shall not block waiting for a keyboard press --- ChangeLog | 23 +++++++++++++++++++++++ src/frontend/error.c | 35 +++++++++++++---------------------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5bee1153..dc60412ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2012-01-02 Robert Larice + * src/frontend/error.c : + controlled_exit() shall not block waiting for a keyboard press + + and advertise the exit message to external syntax coloring schemes, + emit "ERROR: " at the very beginning of a new line. + +2012-01-02 Robert Larice + * configure.ac , + * src/frontend/commands.c , + * src/frontend/runcoms.c , + * src/frontend/shyu.c , + * src/frontend/spiceif.c , + * src/include/ngspice/cktdefs.h , + * src/include/ngspice/pssdefs.h , + * src/spicelib/analysis/Makefile.am , + * src/spicelib/analysis/analysis.c , + * src/spicelib/parser/inp2dot.c , + * visualc/vngspice.vcproj : + conditionally compile PSS analysis + discouraging PSS as being `very experimental', to enable use: + configure --enable-pss + 2012-01-01 Robert Larice * src/Makefile.am : fix tarball, spinit.in was missing diff --git a/src/frontend/error.c b/src/frontend/error.c index 8b910edd8..6c00e9946 100644 --- a/src/frontend/error.c +++ b/src/frontend/error.c @@ -4,7 +4,6 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group **********/ /* - * * Print out in more detail what a floating point error was. */ @@ -23,23 +22,18 @@ char ErrorMessage[1024]; void winmessage(char* new_msg); #endif -void + +void controlled_exit(int status) { - if (status != 0) #ifdef HAS_WINDOWS - winmessage("Fatal error in NGSPICE"); + if (status) + winmessage("Fatal error in NGSPICE"); #else - { - if (!ft_pipemode) { - fprintf(stderr, " Fatal error in NGSPICE - Press Return to exit\n"); - getc(stdin); - } - else - fprintf(stderr, " Fatal error in NGSPICE - Exit\n"); - } + if (status) + fprintf(stderr, "\nERROR: fatal error in ngspice, exit(%d)\n", status); #endif - exit(status); + exit(status); } @@ -52,9 +46,7 @@ fperror(char *mess, int code) } - /* Print a spice error message. */ - void ft_sperror(int code, char *mess) { @@ -62,33 +54,32 @@ ft_sperror(int code, char *mess) return; } + void fatal(void) { cp_ccon(FALSE); -#ifdef FTEDEBUG -#ifdef SIGQUIT + +#if defined(FTEDEBUG) && defined(SIGQUIT) (void) signal(SIGQUIT, SIG_DFL); (void) kill(getpid(), SIGQUIT); #endif -#endif + exit(EXIT_BAD); } + /* These error messages are from internal consistency checks. */ void internalerror(char *message) { - fprintf(stderr, "ERROR: (internal) %s\n", message); - } + /* These errors are from external routines like fopen. */ void externalerror(char *message) { - fprintf(stderr, "ERROR: (external) %s\n", message); - }