|
|
|
@ -814,6 +814,16 @@ ngSpice_nospinit(void) |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
/* Set variable no_spiceinit, if reading '.spiceinit' is not wanted. */ |
|
|
|
IMPEXP |
|
|
|
int |
|
|
|
ngSpice_nospiceinit(void) |
|
|
|
{ |
|
|
|
bool t = TRUE; |
|
|
|
cp_vset("no_spicenit", CP_BOOL, &t); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
/* Initialise external voltage source and synchronization */ |
|
|
|
IMPEXP |
|
|
|
int |
|
|
|
@ -972,7 +982,9 @@ ngSpice_Init(SendChar* printfcn, SendStat* statusfcn, ControlledExit* ngspiceexi |
|
|
|
try accessing the initialisation file .spiceinit in a user provided |
|
|
|
path read from environmental variable SPICE_USERINIT_DIR, |
|
|
|
if that fails try the alternate name spice.rc, then look into |
|
|
|
the current directory, then the HOME directory, then into USERPROFILE */ |
|
|
|
the current directory, then the HOME directory, then into USERPROFILE. |
|
|
|
Don't read .spiceinit, if ngSpice_nospiceinit() has been called. */ |
|
|
|
if (!cp_getvar("no_spiceinit", CP_BOOL, NULL, 0)) { |
|
|
|
do { |
|
|
|
{ |
|
|
|
const char* const userinit = getenv("SPICE_USERINIT_DIR"); |
|
|
|
@ -1017,6 +1029,10 @@ ngSpice_Init(SendChar* printfcn, SendStat* statusfcn, ControlledExit* ngspiceexi |
|
|
|
} |
|
|
|
} |
|
|
|
} while (0); /* end of case that init file is read */ |
|
|
|
} |
|
|
|
else { |
|
|
|
fprintf(stdout, "Note: .spiceinit is ignored, because ngSpice_nospiceinit() has been called.\n"); |
|
|
|
} |
|
|
|
|
|
|
|
#endif /* ~ HAVE_PWD_H */ |
|
|
|
|
|
|
|
|