variable.c, introduce cp_remvar_all() to free all variables

This commit is contained in:
h_vogt 2016-07-24 18:05:48 +02:00 committed by rlar
parent 4f229d450a
commit 0e986f7059
2 changed files with 8 additions and 0 deletions

View File

@ -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;
}

View File

@ -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);