X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fvfm.c;h=b88d3eb13847f34e47d4e83e419f60f3a3f57b0d;hb=65620ac48c2b146a580a80af120590e4e3d4a6d4;hp=6d7e526bf1a5d66a015eb3658e4dd22184f2264b;hpb=933b760efccdfa26f14254f1fae002ea3b0a1495;p=pspp diff --git a/src/vfm.c b/src/vfm.c index 6d7e526bf1..b88d3eb138 100644 --- a/src/vfm.c +++ b/src/vfm.c @@ -30,6 +30,7 @@ #include "alloc.h" #include "case.h" #include "casefile.h" +#include "command.h" #include "dictionary.h" #include "do-ifP.h" #include "error.h" @@ -907,3 +908,32 @@ multipass_split_output (struct multipass_split_aux_data *aux) casefile_destroy (aux->casefile); aux->casefile = NULL; } + + +/* Discards all the current state in preparation for a data-input + command like DATA LIST or GET. */ +void +discard_variables (void) +{ + dict_clear (default_dict); + default_handle = NULL; + + n_lag = 0; + + if (vfm_source != NULL) + { + free_case_source (vfm_source); + vfm_source = NULL; + } + + cancel_transformations (); + + ctl_stack = NULL; + + expr_free (process_if_expr); + process_if_expr = NULL; + + cancel_temporary (); + + pgm_state = STATE_INIT; +}