Browse Source

Save the wordlist sourceinfo to the current circuit.

Remove sourceinfo only upon 'quit'.
pre-master-46
Holger Vogt 2 years ago
parent
commit
36bc67ecbb
  1. 2
      src/frontend/inp.c
  2. 8
      src/frontend/misccoms.c
  3. 1
      src/include/ngspice/ftedefs.h

2
src/frontend/inp.c

@ -73,6 +73,7 @@ void eval_opt(struct card *deck);
extern bool ft_batchmode;
extern int dynmaxline;
extern wordlist* sourceinfo;
/* from inpcom.c */
extern struct nscope* inp_add_levels(struct card *deck);
@ -1533,6 +1534,7 @@ inp_dodeck(
tfree(ct->ci_filename);
#endif
ct->ci_filename = copy(filename);
ct->ci_sourceinfo = sourceinfo;
/* load the optran data, if provided by .spiceinit or spinit.
Return immediately, if optran is not selected.*/

8
src/frontend/misccoms.c

@ -93,17 +93,21 @@ com_quit(wordlist *wl)
/* Destroy CKT when quit. */
if (!ft_nutmeg) {
while(ft_curckt)
while (ft_curckt) {
wl_delete(ft_curckt->ci_sourceinfo);
com_remcirc(NULL);
}
}
cp_destroy_keywords();
destroy_ivars();
#else
/* remove plotting parameters */
pl_rempar();
while (ft_curckt)
while (ft_curckt) {
wl_delete(ft_curckt->ci_sourceinfo);
com_remcirc(NULL);
}
#endif
tfree(errMsg);

1
src/include/ngspice/ftedefs.h

@ -52,6 +52,7 @@ struct circ {
struct ccom *ci_nodes; /* ccom structs for the nodes... */
struct ccom *ci_devices; /* and devices in the circuit. */
char *ci_filename; /* Where this circuit came from. */
wordlist* ci_sourceinfo; /* paths and names of input files */
TSKtask *ci_defTask; /* default task for this circuit */
TSKtask *ci_specTask; /* special task for command line jobs */
TSKtask *ci_curTask; /* most recent task for this circuit */

Loading…
Cancel
Save