|
|
|
@ -58,7 +58,11 @@ extern int rl_catch_signals; /* missing from editline/readline.h */ |
|
|
|
#include "spicelib/devices/dev.h" |
|
|
|
#include "spicelib/analysis/analysis.h" |
|
|
|
#include "misc/ivars.h" |
|
|
|
#include "misc/getopt.h" |
|
|
|
#if defined(HAVE_GETOPT_LONG) && defined(HAVE_GETOPT_H) |
|
|
|
#include <getopt.h> |
|
|
|
#else |
|
|
|
#include "misc/getopt_bsd.h" |
|
|
|
#endif |
|
|
|
#include "frontend/resource.h" |
|
|
|
#include "frontend/variable.h" |
|
|
|
#include "frontend/display.h" /* added by SDB to pick up Input() fcn */ |
|
|
|
@ -95,6 +99,7 @@ bool ft_setflag = FALSE; /* TRUE = Don't abort simulation after an interrupt. |
|
|
|
char *ft_rawfile = "rawspice.raw"; |
|
|
|
|
|
|
|
#ifdef HAS_WINDOWS |
|
|
|
extern void winmessage(char* new_msg); |
|
|
|
bool oflag = FALSE; /* Output over redefined I/O functions */ |
|
|
|
FILE *flogp; /* hvogt 15.12.2001 */ |
|
|
|
#endif /* HAS_WINDOWS */ |
|
|
|
@ -335,6 +340,13 @@ struct dvec *EVTfindvec(char *node){ |
|
|
|
|
|
|
|
#endif /* SIMULATOR */ |
|
|
|
|
|
|
|
#ifndef HAS_WINDOWS |
|
|
|
/* dummy of MS Windows message function */ |
|
|
|
void winmessage(char* new_msg) { |
|
|
|
return; |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
char *hlp_filelist[] = { "ngspice", 0 }; |
|
|
|
|
|
|
|
|
|
|
|
@ -384,12 +396,18 @@ sp_shutdown(int exitval) |
|
|
|
{ |
|
|
|
cleanvars(); |
|
|
|
#ifdef PARALLEL_ARCH |
|
|
|
if (exitval == EXIT_BAD) { |
|
|
|
{ |
|
|
|
Error("Fatal error in SPICE", -1); |
|
|
|
} else { |
|
|
|
PEND_(); |
|
|
|
} |
|
|
|
#endif /* PARALLEL_ARCH */ |
|
|
|
#ifdef HAS_WINDOWS |
|
|
|
if (exitval == EXIT_BAD) |
|
|
|
winmessage("Fatal error in SPICE"); |
|
|
|
else |
|
|
|
winmessage("Information during setup, see text window!"); |
|
|
|
#endif |
|
|
|
exit (exitval); |
|
|
|
} |
|
|
|
|
|
|
|
@ -593,7 +611,7 @@ append_to_stream(FILE *dest, FILE *source) |
|
|
|
static bool |
|
|
|
read_initialisation_file(char * dir, char * name) |
|
|
|
{ |
|
|
|
#ifndef HAVE_ASPRINTF |
|
|
|
#ifndef HAVE_UNISTD_H |
|
|
|
FILE * fp = NULL; |
|
|
|
#endif /* not HAVE_ASPRINTF */ |
|
|
|
char * path; |
|
|
|
@ -750,10 +768,10 @@ main(int argc, char **argv) |
|
|
|
{"version", 0, 0, 'v'}, |
|
|
|
{"batch", 0, 0, 'b'}, |
|
|
|
{"autorun", 0, 0, 'a'}, |
|
|
|
{"circuitfile", 0, 0, 'c'}, |
|
|
|
{"circuitfile", 1, 0, 'c'}, |
|
|
|
{"interactive", 0, 0, 'i'}, |
|
|
|
{"no-spiceinit", 0, 0, 'n'}, |
|
|
|
{"output", 0, 0, 'o'}, |
|
|
|
{"output", 1, 0, 'o'}, |
|
|
|
{"completion", 0, 0, 'q'}, |
|
|
|
{"rawfile", 1, 0, 'r'}, |
|
|
|
{"server", 0, 0, 's'}, |
|
|
|
@ -793,7 +811,7 @@ main(int argc, char **argv) |
|
|
|
case 'c': /* Circuit file */ |
|
|
|
if (optarg) { |
|
|
|
if (!(circuit_file = fopen(optarg, "r"))) { |
|
|
|
perror("circuit file not available"); |
|
|
|
perror(optarg); |
|
|
|
sp_shutdown(EXIT_BAD); |
|
|
|
} |
|
|
|
istty = FALSE; |
|
|
|
@ -848,7 +866,7 @@ main(int argc, char **argv) |
|
|
|
default: |
|
|
|
printf ("?? getopt returned character code 0%o ??\n", c); |
|
|
|
} |
|
|
|
} /* --- End of command line option processing --- */ |
|
|
|
} /* --- End of command line option processing (While(1)-loop) --- */ |
|
|
|
|
|
|
|
if (orflag) { /* -o option has been set */ |
|
|
|
com_version(NULL); |
|
|
|
@ -1022,6 +1040,7 @@ bot: |
|
|
|
if (optind == argc && !istty) { |
|
|
|
append_to_stream(tempfile, stdin); |
|
|
|
} |
|
|
|
|
|
|
|
while (optind < argc) { |
|
|
|
char *arg; |
|
|
|
FILE *tp; |
|
|
|
@ -1060,8 +1079,9 @@ bot: |
|
|
|
perror("Could not delete temp file"); |
|
|
|
} |
|
|
|
#endif |
|
|
|
if (ft_batchmode && err) |
|
|
|
if (ft_batchmode && err) { |
|
|
|
sp_shutdown(EXIT_BAD); |
|
|
|
} |
|
|
|
} /* --- if (!ft_servermode && !ft_nutmeg) --- */ |
|
|
|
|
|
|
|
if (!gotone && ft_batchmode && !ft_nutmeg) |
|
|
|
|