- /* Delete all the scratch variables. */
- struct variable **v;
- size_t nv;
- size_t i;
-
- v = xmalloc (sizeof *v * dict_get_var_cnt (dict));
- nv = 0;
- for (i = 0; i < dict_get_var_cnt (dict); i++)
- if (dict_class_from_id (dict_get_var (dict, i)->name) == DC_SCRATCH)
- v[nv++] = dict_get_var (dict, i);
- dict_delete_vars (dict, v, nv);
- free (v);
- }
-
- while (op == OP_MATCH || lex_match ('/'))
- {
- if (op == OP_SAVE && lex_match_id ("COMPRESSED"))
- *compress = 1;
- else if (op == OP_SAVE && lex_match_id ("UNCOMPRESSED"))
- *compress = 0;
- else if (lex_match_id ("DROP"))
- {
- struct variable **v;
- int nv;
-
- lex_match ('=');
- if (!parse_variables (dict, &v, &nv, PV_NONE))
- return 0;
- dict_delete_vars (dict, v, nv);
- free (v);
- }
- else if (lex_match_id ("KEEP"))
- {
- struct variable **v;
- int nv;
- int i;
-
- lex_match ('=');
- if (!parse_variables (dict, &v, &nv, PV_NONE))
- return 0;
-
- /* Move the specified variables to the beginning. */
- dict_reorder_vars (dict, v, nv);
-
- /* Delete the remaining variables. */
- v = xrealloc (v, (dict_get_var_cnt (dict) - nv) * sizeof *v);
- for (i = nv; i < dict_get_var_cnt (dict); i++)
- v[i - nv] = dict_get_var (dict, i);
- dict_delete_vars (dict, v, dict_get_var_cnt (dict) - nv);
- free (v);
- }
- else if (lex_match_id ("RENAME"))
- {
- if (!rename_variables (dict))
- return 0;
- }
- else
- {
- lex_error (_("while expecting a valid subcommand"));
- return 0;
- }
-
- if (dict_get_var_cnt (dict) == 0)
- {
- msg (SE, _("All variables deleted from system file dictionary."));
- return 0;
- }
-
- if (op == OP_MATCH)
- goto success;