Fix memory leaks.
[pspp-builds.git] / src / vfm.h
index 9577953ef40c802bc0edfb4ca32fe901357b3772..9b577ed8abbb7bf58c99292a13ba46c9dc447cd1 100644 (file)
--- a/src/vfm.h
+++ b/src/vfm.h
@@ -71,15 +71,15 @@ 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 *);
 
-int storage_source_on_disk (const struct case_source *);
-struct case_list *storage_source_get_cases (const struct case_source *);
-void storage_source_set_cases (const struct case_source *,
-                               struct case_list *);
-void storage_source_to_disk (struct case_source *source);
+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;
@@ -111,9 +111,10 @@ struct case_sink_class
     /* Closes and destroys the sink. */
     void (*destroy) (struct case_sink *);
 
-    /* Closes and destroys the sink and returns a source that can
-       read back the cases that were written, perhaps transformed
-       in some way. */
+    /* Closes the sink and returns a source that can read back
+       the cases that were written, perhaps transformed in some
+       way.  The sink must still be separately destroyed by
+       calling destroy(). */
     struct case_source *(*make_source) (struct case_sink *);
   };
 
@@ -123,6 +124,9 @@ extern const struct case_sink_class null_sink_class;
 struct case_sink *create_case_sink (const struct case_sink_class *,
                                     const struct dictionary *,
                                     void *);
+void case_sink_open (struct case_sink *);
+void case_sink_write (struct case_sink *, const struct ccase *);
+void case_sink_destroy (struct case_sink *);
 void free_case_sink (struct case_sink *);
 \f
 /* Number of cases to lag. */
@@ -134,5 +138,9 @@ void procedure_with_splits (void (*begin_func) (void *aux),
                             void (*end_func) (void *aux),
                             void *aux);
 struct ccase *lagged_case (int n_before);
+\f
+void multipass_procedure_with_splits (void (*) (const struct casefile *,
+                                                void *),
+                                      void *aux);
 
 #endif /* !vfm_h */