From 82c91abea4314de78893c47f731bb3dd807dc7ad Mon Sep 17 00:00:00 2001 From: Giles Atkinson <“gatk555@gmail.com”> Date: Wed, 1 Apr 2026 07:26:20 +0100 Subject: [PATCH] Discard all XSPICE event data when using "-b -r", as there is no way to access it. An initial step for FR #105: "Esave + rawfile". --- src/include/ngspice/evtproto.h | 1 + src/main.c | 5 +++++ src/xspice/evt/evtprint.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/include/ngspice/evtproto.h b/src/include/ngspice/evtproto.h index 1ec0e3228..bca29dd47 100644 --- a/src/include/ngspice/evtproto.h +++ b/src/include/ngspice/evtproto.h @@ -162,4 +162,5 @@ int Evt_Parse_Node(const char *node, struct node_parse *result); void Evt_purge_free_outputs(void); +void EVTdiscard(void); #endif diff --git a/src/main.c b/src/main.c index 01702c1f2..67ada5d8e 100644 --- a/src/main.c +++ b/src/main.c @@ -1563,6 +1563,11 @@ int main(int argc, char **argv) are ignored, except .save, which has been handled by ft_dotsaves() from within inp_spsource (), data are put into linked list dbs. */ +#ifdef XSPICE + // Do not save any XSPICE node data, as there is no way to use it. + + EVTdiscard(); +#endif int error2 = ft_dorun(ft_rawfile); /* Execute the .whatever lines found in the deck, after we are done running. */ if (ft_cktcoms(TRUE) || error2) { diff --git a/src/xspice/evt/evtprint.c b/src/xspice/evt/evtprint.c index 3e20f3d93..3e8b909f5 100644 --- a/src/xspice/evt/evtprint.c +++ b/src/xspice/evt/evtprint.c @@ -963,6 +963,8 @@ static void set_all(CKTcircuit *ckt, Mif_Boolean_t val) node_table[i]->save = val; } +void EVTdiscard(void) {set_all(g_mif_info.ckt, MIF_FALSE);} + void EVTsave(wordlist *wl) {