X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvfm.h;h=cfd639a925ead255085b610cc7f6bb49aca25637;hb=92fb12eb06716d14c05b781f5d9dcde956d77c30;hp=9577953ef40c802bc0edfb4ca32fe901357b3772;hpb=14e7292894533c5491a774a2d749386362660812;p=pspp diff --git a/src/vfm.h b/src/vfm.h index 9577953ef4..cfd639a925 100644 --- a/src/vfm.h +++ b/src/vfm.h @@ -14,17 +14,14 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ #if !vfm_h #define vfm_h 1 #include -/* This is the time at which vfm was last invoked. */ -extern time_t last_vfm_invocation; - struct ccase; typedef struct write_case_data *write_case_data; typedef int write_case_func (write_case_data); @@ -36,7 +33,6 @@ extern struct case_source *vfm_source; struct case_source { const struct case_source_class *class; /* Class. */ - size_t value_cnt; /* Number of `union value's in case. */ void *aux; /* Auxiliary data. */ }; @@ -60,26 +56,20 @@ struct case_source_class }; 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 *); -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 *); /* The replacement active file, to which cases are written. */ extern struct case_sink *vfm_sink; @@ -89,11 +79,6 @@ 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. */ }; @@ -111,9 +96,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 +109,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 *); /* Number of cases to lag. */ @@ -134,5 +123,11 @@ void procedure_with_splits (void (*begin_func) (void *aux), void (*end_func) (void *aux), void *aux); struct ccase *lagged_case (int n_before); + +void multipass_procedure_with_splits (void (*) (const struct casefile *, + void *), + void *aux); + +time_t vfm_last_invocation (void); #endif /* !vfm_h */