sys-file-reader: Check that multiple response set names begin with `$'.
[pspp-builds.git] / src / data / procedure.c
index c79e784e8b70f4d7ced4cabf5414cd76d8baca8c..fa52806f60f6795154234af340b8226f95f5172d 100644 (file)
@@ -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