X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fprocedure.c;h=fa52806f60f6795154234af340b8226f95f5172d;hb=18e0d701a5e9a288604a408100efcf1463b6da9c;hp=c79e784e8b70f4d7ced4cabf5414cd76d8baca8c;hpb=f550aee00a62fe1d8baf62d83cd7efef6cc2ee92;p=pspp-builds.git diff --git a/src/data/procedure.c b/src/data/procedure.c index c79e784e..fa52806f 100644 --- a/src/data/procedure.c +++ b/src/data/procedure.c @@ -163,10 +163,14 @@ proc_execute (struct dataset *ds) static const struct casereader_class proc_casereader_class; -/* Opens dataset DS for reading cases with proc_read. +/* Opens dataset DS for reading cases with proc_read. If FILTER is true, then + cases filtered out with FILTER BY will not be included in the casereader + (which is usually desirable). If FILTER is false, all cases will be + included regardless of FILTER BY settings. + proc_commit must be called when done. */ struct casereader * -proc_open (struct dataset *ds) +proc_open_filtering (struct dataset *ds, bool filter) { struct casereader *reader; @@ -179,7 +183,8 @@ proc_open (struct dataset *ds) /* Finish up the collection of transformations. */ add_case_limit_trns (ds); - add_filter_trns (ds); + if (filter) + add_filter_trns (ds); trns_chain_finalize (ds->cur_trns_chain); /* Make permanent_dict refer to the dictionary right before @@ -237,6 +242,14 @@ proc_open (struct dataset *ds) return reader; } +/* Opens dataset DS for reading cases with proc_read. + proc_commit must be called when done. */ +struct casereader * +proc_open (struct dataset *ds) +{ + return proc_open_filtering (ds, true); +} + /* Returns true if a procedure is in progress, that is, if proc_open has been called but proc_commit has not. */ bool