X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=perl-module%2FPSPP.xs;h=237ae95f541a9564829ff93bff2ce33d8fcb2314;hb=5fb2011a5a7d63dd694d49944a114562bfe764ca;hp=e0943d6e6513b052b6ff97417d7b82f09fdc9ca1;hpb=8ec9e3a8a285f20c614d555185e4cffca3bea8ef;p=pspp-builds.git diff --git a/perl-module/PSPP.xs b/perl-module/PSPP.xs index e0943d6e..237ae95f 100644 --- a/perl-module/PSPP.xs +++ b/perl-module/PSPP.xs @@ -1,5 +1,5 @@ /* PSPP - computes sample statistics. - Copyright (C) 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -671,32 +671,24 @@ CODE: RETVAL -SV * +void get_next_case (sfr) struct sysreader_info *sfr; -CODE: +PPCODE: struct ccase *c; - if (! (c = casereader_read (sfr->reader))) - { - RETVAL = 0; - } - else + if (c = casereader_read (sfr->reader)) { int v; - AV *av_case = (AV *) sv_2mortal ((SV *) newAV()); + EXTEND (SP, dict_get_var_cnt (sfr->dict)); for (v = 0; v < dict_get_var_cnt (sfr->dict); ++v ) { const struct variable *var = dict_get_var (sfr->dict, v); const union value *val = case_data (c, var); - av_push (av_case, value_to_scalar (val, var)); + PUSHs (sv_2mortal (value_to_scalar (val, var))); } case_unref (c); - RETVAL = newRV ((SV *) av_case); } -OUTPUT: - RETVAL -