-/* This is used to read from the active file. */
-extern struct case_stream *vfm_source;
-
-/* This is used to write to the replacement active file. */
-extern struct case_stream *vfm_sink;
-
-/* General data streams. */
-extern struct case_stream vfm_memory_stream;
-extern struct case_stream vfm_disk_stream;
-extern struct case_stream sort_stream;
-extern struct case_stream flip_stream;
+extern const struct case_source_class storage_source_class;
+extern const struct case_source_class data_list_source_class;
+extern const struct case_source_class file_type_source_class;
+extern const struct case_source_class input_program_source_class;
+extern const struct case_source_class get_source_class;
+extern const struct case_source_class import_source_class;
+extern const struct case_source_class sort_source_class;
+
+struct dictionary;
+struct case_source *create_case_source (const struct case_source_class *,
+ const struct dictionary *,
+ void *);
+void free_case_source (struct case_source *);
+
+int case_source_is_complex (const struct case_source *);
+int case_source_is_class (const struct case_source *,
+ const struct case_source_class *);
+
+struct casefile *storage_source_get_casefile (struct case_source *);
+struct case_source *storage_source_create (struct casefile *,
+ const struct dictionary *);
+\f
+/* The replacement active file, to which cases are written. */
+extern struct case_sink *vfm_sink;
+
+/* A case sink. */
+struct case_sink
+ {
+ const struct case_sink_class *class; /* Class. */
+ void *aux; /* Auxiliary data. */
+
+ /* Cases written to a case sink belong to a dictionary, but
+ their data is compacted to drop scratch variables. */
+ const struct dictionary *dict; /* Dictionary for cases. */
+ int *idx_to_fv; /* `dict' index -> case `data' index. */
+ size_t value_cnt; /* Number of `union value's in case. */
+ };