-void proc_init (void);
-void proc_done (void);
-
-void proc_set_source (struct case_source *);
-bool proc_has_source (void);
-
-void proc_set_sink (struct case_sink *);
-struct casefile *proc_capture_output (void);
-
-bool procedure (bool (*proc_func) (struct ccase *, void *),
- void *aux);
-bool procedure_with_splits (void (*begin_func) (const struct ccase *, void *),
- bool (*proc_func) (const struct ccase *, void *),
- void (*end_func) (void *),
- void *aux);
-bool multipass_procedure (bool (*proc_func) (const struct casefile *, void *),
- void *aux);
-bool multipass_procedure_with_splits (bool (*) (const struct ccase *,
- const struct casefile *,
- void *),
- void *aux);
-time_t time_of_last_procedure (void);
+struct dictionary ;
+typedef void replace_source_callback (struct case_source *);
+typedef void replace_dictionary_callback (struct dictionary *);
+
+
+struct dataset * create_dataset (struct casefile_factory *fact,
+ replace_source_callback *,
+ replace_dictionary_callback *
+ );
+
+void destroy_dataset (struct dataset *);
+
+struct casefile_factory *dataset_get_casefile_factory (const struct dataset *);
+
+void proc_set_source (struct dataset *ds, struct case_source *);
+bool proc_has_source (const struct dataset *ds);
+
+void proc_set_sink (struct dataset *ds, struct case_sink *);
+struct casefile *proc_capture_output (struct dataset *ds);
+
+typedef bool casefile_func (const struct casefile *, void *);
+typedef bool case_func (const struct ccase *, void *, const struct dataset *);
+typedef void begin_func (const struct ccase *, void *, const struct dataset*);
+
+typedef bool end_func (void *, const struct dataset *);
+
+typedef bool split_func (const struct ccase *, const struct casefile *,
+ void *, const struct dataset *);
+
+
+
+bool procedure (struct dataset *ds, case_func *, void *aux) WARN_UNUSED_RESULT;
+
+bool procedure_with_splits (struct dataset *ds,
+ begin_func *,
+ case_func *,
+ end_func *,
+ void *aux)
+ WARN_UNUSED_RESULT;
+bool multipass_procedure (struct dataset *ds, casefile_func *, void *aux)
+ WARN_UNUSED_RESULT;
+bool multipass_procedure_with_splits (struct dataset *ds,
+ split_func *,
+ void *aux)
+ WARN_UNUSED_RESULT;
+
+time_t time_of_last_procedure (struct dataset *ds);
+
+void proc_open (struct dataset *);
+bool proc_read (struct dataset *, struct ccase **);
+bool proc_close (struct dataset *);