inproved error messages in pipe mode
This commit is contained in:
parent
890d049a5b
commit
57c9b44c73
|
|
@ -1,3 +1,9 @@
|
|||
2011-08-10 Holger Vogt
|
||||
* evtplot.c: initilize 'value' to 0
|
||||
* xpressn.c: improved error message
|
||||
* misccoms.c, main.c, error.c, fteext.h: flag ft_pipemode set
|
||||
in main.c, used to optimize or suppress output messages
|
||||
|
||||
2011-08-09 Holger Vogt
|
||||
* inp2dot.c: align spaces and braces
|
||||
* inp2dot.c, examples/pss/*.cir: uic for pss to end of line
|
||||
|
|
|
|||
|
|
@ -26,11 +26,18 @@ void winmessage(char* new_msg);
|
|||
void
|
||||
controlled_exit(int status)
|
||||
{
|
||||
if (status != 0)
|
||||
#ifdef HAS_WINDOWS
|
||||
winmessage("Fatal error in NGSPICE");
|
||||
winmessage("Fatal error in NGSPICE");
|
||||
#else
|
||||
fprintf(stderr, "Fatal error in NGSPICE - Return");
|
||||
getc(stdin);
|
||||
{
|
||||
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");
|
||||
}
|
||||
#endif
|
||||
exit(status);
|
||||
}
|
||||
|
|
@ -73,7 +80,7 @@ void
|
|||
internalerror(char *message)
|
||||
{
|
||||
|
||||
fprintf(stderr, "internal error: %s\n", message);
|
||||
fprintf(stderr, "ERROR: (internal) %s\n", message);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -82,6 +89,6 @@ void
|
|||
externalerror(char *message)
|
||||
{
|
||||
|
||||
fprintf(stderr, "external error: %s\n", message);
|
||||
fprintf(stderr, "ERROR: (external) %s\n", message);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,18 +144,23 @@ com_bug(wordlist *wl)
|
|||
{
|
||||
NG_IGNORE(wl);
|
||||
|
||||
fprintf(cp_out, "Send mail to the address ngspice-devel@lists.sourceforge.net\n");
|
||||
fprintf(cp_out, "Please use the ngspice bug tracker at:\n");
|
||||
fprintf(cp_out, "http://sourceforge.net/tracker/?group_id=38962&atid=423915\n");
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /* SYSTEM_MAIL */
|
||||
|
||||
/* printout upon startup or 'version' command. options to version are -s (short)
|
||||
or -f (full). 'version' with options may also be used in ngspice pipe mode. */
|
||||
void
|
||||
com_version(wordlist *wl)
|
||||
{
|
||||
char *s;
|
||||
|
||||
if (!wl) {
|
||||
/* no printout in pipe mode (-p) */
|
||||
if (ft_pipemode) return;
|
||||
fprintf(cp_out, "******\n");
|
||||
|
||||
fprintf(cp_out, "** %s-%s : %s\n", ft_sim->simulator,
|
||||
|
|
@ -204,6 +209,18 @@ com_version(wordlist *wl)
|
|||
fprintf(cp_out,"** XSPICE extensions included\n");
|
||||
#endif
|
||||
fprintf(cp_out,"** Relevant compilation options (refer to user's manual):\n");
|
||||
#ifdef NGDEBUG
|
||||
fprintf(cp_out,"** Debugging option (-g) enabled\n");
|
||||
#endif
|
||||
#ifdef ADMS
|
||||
fprintf(cp_out,"** Adms interface enabled\n");
|
||||
#endif
|
||||
#ifdef USE_OMP
|
||||
fprintf(cp_out,"** OpenMP multithreading for BSIM3, BSIM4 enabled\n");
|
||||
#endif
|
||||
#if defined(X_DISPLAY_MISSING) && !defined(HAS_WINDOWS)
|
||||
fprintf(cp_out,"** X11 interface not compiled into ngspice\n");
|
||||
#endif
|
||||
#ifdef NOBYPASS
|
||||
fprintf(cp_out,"** --enable-nobypass\n");
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include "dvec.h"
|
||||
#include "../frontend/variable.h"
|
||||
#include "compatmode.h"
|
||||
#include "error.h"
|
||||
|
||||
/* random numbers in /maths/misc/randnumb.c */
|
||||
extern double gauss0(void);
|
||||
|
|
@ -1394,8 +1395,8 @@ evaluate (tdico * dico, SPICE_DSTRINGPTR qstr_p, char *t, unsigned char mode)
|
|||
|
||||
char buf[17+1];
|
||||
if(snprintf(buf, sizeof(buf), "% 17.9le", u) != 17) {
|
||||
fprintf(stderr, "internal ERROR in %s(%d)\n", __FUNCTION__, __LINE__);
|
||||
exit(1);
|
||||
fprintf(stderr, "ERROR: xpressn.c, %s(%d)\n", __FUNCTION__, __LINE__);
|
||||
controlled_exit(1);
|
||||
}
|
||||
scopys(qstr_p, buf);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,7 +147,8 @@ extern void fperror(char *mess, int code);
|
|||
extern void ft_sperror(int code, char *mess);
|
||||
extern char ErrorMessage[];
|
||||
extern void internalerror(char *);
|
||||
extern void externalerror(char *);
|
||||
extern void externalerror(char *);
|
||||
extern bool ft_pipemode;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@
|
|||
/* Main options */
|
||||
static bool ft_servermode = FALSE;
|
||||
bool ft_batchmode = FALSE;
|
||||
bool ft_pipemode = FALSE;
|
||||
bool rflag = FALSE; /* has rawfile */
|
||||
|
||||
/* Frontend options */
|
||||
|
|
@ -946,6 +947,7 @@ main(int argc, char **argv)
|
|||
case 'p': /* Run in pipe mode */
|
||||
iflag = TRUE;
|
||||
istty = TRUE;
|
||||
ft_pipemode = TRUE;
|
||||
break;
|
||||
|
||||
case 'q': /* Command completion */
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ struct dvec *EVTfindvec(
|
|||
|
||||
double *anal_point_vec;
|
||||
double *value_vec;
|
||||
double value;
|
||||
double value = 0;
|
||||
|
||||
struct dvec *d;
|
||||
struct dvec *scale;
|
||||
|
|
|
|||
Loading…
Reference in New Issue