- return casereader_create_sequential (NULL, dict_get_proto (ds->dict),
- CASENUMBER_MAX,
- &proc_casereader_class, ds);
+
+ /* Create casereader and insert a shim on top. The shim allows us to
+ arbitrarily extend the casereader's lifetime, by slurping the cases into
+ the shim's buffer in proc_commit(). That is especially useful when output
+ table_items are generated directly from the procedure casereader (e.g. by
+ the LIST procedure) when we are using an output driver that keeps a
+ reference to the output items passed to it (e.g. the GUI output driver in
+ PSPPIRE). */
+ reader = casereader_create_sequential (NULL, dict_get_proto (ds->dict),
+ CASENUMBER_MAX,
+ &proc_casereader_class, ds);
+ ds->shim = casereader_shim_insert (reader);
+ 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);