X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=perl-module%2FPSPP.xs;h=7577b7ad2c7be4d54b37fad06013aca3d6be0332;hb=87798cfc4b530dc7dfdefef77e632a22ee8a4866;hp=e600f7b45d4e271d1d381e087349ec017a5f7831;hpb=24c5f7c629e68801492d7ca1766953a2a954a820;p=pspp diff --git a/perl-module/PSPP.xs b/perl-module/PSPP.xs index e600f7b45d..7577b7ad2c 100644 --- a/perl-module/PSPP.xs +++ b/perl-module/PSPP.xs @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -78,7 +77,7 @@ struct syswriter_info /* A thin wrapper around sfm_reader */ struct sysreader_info { - struct sfm_read_info opts; + struct any_read_info opts; /* A pointer to the reader. The reader is owned by the struct */ struct casereader *reader; @@ -633,8 +632,8 @@ INIT: opts.create_writeable = readonly ? ! SvIV (*readonly) : true; opts.compression = (compress && SvIV (*compress) - ? SFM_COMP_SIMPLE - : SFM_COMP_NONE); + ? ANY_COMP_SIMPLE + : ANY_COMP_NONE); opts.version = version ? SvIV (*version) : 3 ; } CODE: @@ -755,26 +754,16 @@ CODE: struct file_handle *fh = fh_create_file (NULL, name, fh_default_properties () ); struct dictionary *dict; - struct sfm_reader *r; sri = xmalloc (sizeof (*sri)); - r = sfm_open (fh); - if (r) - { - sri->reader = sfm_decode (r, NULL, &dict, &sri->opts); - if (sri->reader) - sri->dict = create_pspp_dict (dict); - else - { - free (sri); - sri = NULL; - } - } + sri->reader = any_reader_open_and_decode (fh, NULL, &dict, &sri->opts); + if (sri->reader) + sri->dict = create_pspp_dict (dict); else { free (sri); sri = NULL; - } + } RETVAL = sri; OUTPUT: