void (*callback) (void *); /* Callback for when the dataset changes */
void *cb_data;
+ /* Default encoding for reading syntax files. */
+ char *syntax_encoding;
}; /* struct dataset */
ds->cb_data = cb_data;
}
+void
+dataset_set_default_syntax_encoding (struct dataset *ds, const char *encoding)
+{
+ free (ds->syntax_encoding);
+ ds->syntax_encoding = xstrdup (encoding);
+}
+
+const char *
+dataset_get_default_syntax_encoding (const struct dataset *ds)
+{
+ return ds->syntax_encoding;
+}
/* Returns the last time the data was read. */
time_t
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;
/* 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
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
ds->caseinit = caseinit_create ();
proc_cancel_all_transformations (ds);
+
+ ds->syntax_encoding = xstrdup ("Auto");
+
return ds;
}
if ( ds->xform_callback)
ds->xform_callback (false, ds->xform_callback_aux);
+
+ free (ds->syntax_encoding);
free (ds);
}