diff --git a/src/frontend/variable.c b/src/frontend/variable.c index 2a87032d8..9f4372de5 100644 --- a/src/frontend/variable.c +++ b/src/frontend/variable.c @@ -1031,3 +1031,10 @@ var_set_vlist(struct variable *v, struct variable *value) v->va_type = CP_LIST; v->va_vlist = value; } + +void +cp_remvar_all(void) +{ + free_struct_variable(variables); + variables = NULL; +} diff --git a/src/include/ngspice/cpextern.h b/src/include/ngspice/cpextern.h index 7e2ab2542..608b88f11 100644 --- a/src/include/ngspice/cpextern.h +++ b/src/include/ngspice/cpextern.h @@ -167,6 +167,7 @@ extern void cp_vset(char *varname, enum cp_types type, void *value); extern struct variable *cp_setparse(wordlist *wl); extern wordlist *vareval(char *string); extern char *span_var_expr(char *t); +extern void cp_remvar_all(void); /* var2.c */ extern void cp_vprint(void);