X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fapply-dict.c;h=4cc8c10379644585db7b33f358854e9d6be59c05;hb=f62199cac6213ed1c03ffe48450a583da0fadc68;hp=541d93382ddafed986cfe1811a684438573cdf85;hpb=3a7fba81ceae5b049d0f7d671e9e3c3c43bbf703;p=pspp-builds.git diff --git a/src/apply-dict.c b/src/apply-dict.c index 541d9338..4cc8c103 100644 --- a/src/apply-dict.c +++ b/src/apply-dict.c @@ -20,11 +20,12 @@ #include #include #include "command.h" +#include "dictionary.h" #include "error.h" #include "file-handle.h" #include "hash.h" #include "lexer.h" -#include "sfm.h" +#include "sfm-read.h" #include "str.h" #include "value-labels.h" #include "var.h" @@ -36,24 +37,23 @@ int cmd_apply_dictionary (void) { struct file_handle *handle; + struct sfm_reader *reader; struct dictionary *dict; int n_matched = 0; int i; - lex_match_id ("APPLY"); - lex_match_id ("DICTIONARY"); - lex_match_id ("FROM"); lex_match ('='); - handle = fh_parse_file_handle (); + handle = fh_parse (); if (!handle) return CMD_FAILURE; - dict = sfm_read_dictionary (handle, NULL); + reader = sfm_open_reader (handle, &dict, NULL); if (dict == NULL) return CMD_FAILURE; + sfm_close_reader (reader); for (i = 0; i < dict_get_var_cnt (dict); i++) { @@ -173,7 +173,7 @@ cmd_apply_dictionary (void) dict_set_weight (default_dict, new_weight); } - sfm_maybe_close (handle); + sfm_close_reader (reader); return lex_end_of_command (); }