X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fdataset.h;h=b2aa8bcf0e120a43c71fddf69295e5cb73d78c30;hb=b401615e6db40bf74394839b96600afe3a868a95;hp=4561f97e67d62b0dc5d97dda176318c5965bff19;hpb=2be9bee9da6a2ce27715e58128569594319abfa2;p=pspp-builds.git diff --git a/src/data/dataset.h b/src/data/dataset.h index 4561f97e..b2aa8bcf 100644 --- a/src/data/dataset.h +++ b/src/data/dataset.h @@ -27,6 +27,38 @@ struct casereader; struct dataset; struct dictionary; +struct dataset *dataset_create (void); +void dataset_destroy (struct dataset *); + +void dataset_clear (struct dataset *); + +struct dictionary *dataset_dict (const struct dataset *); +void dataset_set_dict (struct dataset *, struct dictionary *); + +const struct casereader *dataset_source (const struct dataset *); +bool dataset_has_source (const struct dataset *ds); +bool dataset_set_source (struct dataset *, struct casereader *); +struct casereader *dataset_steal_source (struct dataset *); + +void dataset_set_default_syntax_encoding (struct dataset *, const char *); +const char *dataset_get_default_syntax_encoding (const struct dataset *); + +struct dataset_callbacks + { + /* Called whenever a procedure completes execution or whenever the + dictionary within the dataset is modified (though not when it is + replaced by a new dictionary). */ + void (*changed) (void *aux); + + /* Called whenever a transformation is added or removed. NON_EMPTY is true + if after the change there is at least one transformation, false if there + are no transformations. */ + void (*transformations_changed) (bool non_empty, void *aux); + }; + +void dataset_set_callbacks (struct dataset *, const struct dataset_callbacks *, + void *aux); + /* Transformations. */ void add_transformation (struct dataset *ds, @@ -47,22 +79,6 @@ bool proc_cancel_temporary_transformations (struct dataset *ds); /* Procedures. */ -typedef void transformation_change_callback_func (bool non_empty, void *aux); - -struct dataset * create_dataset (void); - -void destroy_dataset (struct dataset *); - -void dataset_add_transform_change_callback (struct dataset *, - transformation_change_callback_func *, void *); - -void proc_discard_active_file (struct dataset *); -void proc_set_active_file (struct dataset *, - struct casereader *, struct dictionary *); -bool proc_set_active_file_data (struct dataset *, struct casereader *); -bool proc_has_active_file (const struct dataset *ds); -struct casereader *proc_extract_active_file_data (struct dataset *); - void proc_discard_output (struct dataset *ds); bool proc_execute (struct dataset *ds); @@ -75,15 +91,7 @@ bool proc_commit (struct dataset *); bool dataset_end_of_command (struct dataset *); -struct dictionary *dataset_dict (const struct dataset *ds); -const struct casereader *dataset_source (const struct dataset *ds); - const struct ccase *lagged_case (const struct dataset *ds, int n_before); void dataset_need_lag (struct dataset *ds, int n_before); -void dataset_set_callback (struct dataset *ds, void (*cb) (void *), void *); - -void dataset_set_default_syntax_encoding (struct dataset *, const char *); -const char *dataset_get_default_syntax_encoding (const struct dataset *); - #endif /* dataset.h */