1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 #include "data/transformations.h"
24 #include "libpspp/compiler.h"
30 struct dataset *dataset_create (void);
31 void dataset_destroy (struct dataset *);
33 void dataset_clear (struct dataset *);
35 struct dictionary *dataset_dict (const struct dataset *);
36 void dataset_set_dict (struct dataset *, struct dictionary *);
38 const struct casereader *dataset_source (const struct dataset *);
39 bool dataset_has_source (const struct dataset *ds);
40 bool dataset_set_source (struct dataset *, struct casereader *);
41 struct casereader *dataset_steal_source (struct dataset *);
43 void dataset_set_default_syntax_encoding (struct dataset *, const char *);
44 const char *dataset_get_default_syntax_encoding (const struct dataset *);
46 struct dataset_callbacks
48 /* Called whenever a procedure completes execution or whenever the
49 dictionary within the dataset is modified (though not when it is
50 replaced by a new dictionary). */
51 void (*changed) (void *aux);
53 /* Called whenever a transformation is added or removed. NON_EMPTY is true
54 if after the change there is at least one transformation, false if there
55 are no transformations. */
56 void (*transformations_changed) (bool non_empty, void *aux);
59 void dataset_set_callbacks (struct dataset *, const struct dataset_callbacks *,
62 /* Transformations. */
64 void add_transformation (struct dataset *ds,
65 trns_proc_func *, trns_free_func *, void *);
66 void add_transformation_with_finalizer (struct dataset *ds,
69 trns_free_func *, void *);
70 size_t next_transformation (const struct dataset *ds);
72 bool proc_cancel_all_transformations (struct dataset *ds);
73 struct trns_chain *proc_capture_transformations (struct dataset *ds);
75 void proc_start_temporary_transformations (struct dataset *ds);
76 bool proc_in_temporary_transformations (const struct dataset *ds);
77 bool proc_make_temporary_transformations_permanent (struct dataset *ds);
78 bool proc_cancel_temporary_transformations (struct dataset *ds);
82 void proc_discard_output (struct dataset *ds);
84 bool proc_execute (struct dataset *ds);
85 time_t time_of_last_procedure (struct dataset *ds);
87 struct casereader *proc_open_filtering (struct dataset *, bool filter);
88 struct casereader *proc_open (struct dataset *);
89 bool proc_is_open (const struct dataset *);
90 bool proc_commit (struct dataset *);
92 bool dataset_end_of_command (struct dataset *);
94 const struct ccase *lagged_case (const struct dataset *ds, int n_before);
95 void dataset_need_lag (struct dataset *ds, int n_before);
97 #endif /* dataset.h */