+struct dataset {
+
+ /* An abstract factory which creates casefiles */
+ struct casefile_factory *cf_factory;
+
+ /* Callback which occurs when a procedure provides a new source for
+ the dataset */
+ replace_source_callback *replace_source ;
+
+ /* Callback which occurs whenever the DICT is replaced by a new one */
+ replace_dictionary_callback *replace_dict;
+
+ /* Cases are read from proc_source,
+ pass through permanent_trns_chain (which transforms them into
+ the format described by permanent_dict),
+ are written to proc_sink,
+ pass through temporary_trns_chain (which transforms them into
+ the format described by dict),
+ and are finally passed to the procedure. */
+ struct case_source *proc_source;
+ struct trns_chain *permanent_trns_chain;
+ struct dictionary *permanent_dict;
+ struct case_sink *proc_sink;
+ struct trns_chain *temporary_trns_chain;
+ struct dictionary *dict;
+
+ /* The transformation chain that the next transformation will be
+ added to. */
+ struct trns_chain *cur_trns_chain;
+
+ /* The compactor used to compact a case, if necessary;
+ otherwise a null pointer. */
+ struct dict_compactor *compactor;
+
+ /* Time at which proc was last invoked. */
+ time_t last_proc_invocation;
+
+ /* Lag queue. */
+ int n_lag; /* Number of cases to lag. */
+ int lag_count; /* Number of cases in lag_queue so far. */
+ int lag_head; /* Index where next case will be added. */
+ struct ccase *lag_queue; /* Array of n_lag ccase * elements. */
+
+ /* Procedure data. */
+ bool is_open; /* Procedure open? */
+ struct ccase trns_case; /* Case used for transformations. */
+ struct ccase sink_case; /* Case written to sink, if
+ compacting is necessary. */
+ size_t cases_written; /* Cases output so far. */
+ bool ok;
+}; /* struct dataset */