1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000, 2006, 2007 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 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, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 #include <data/transformations.h>
26 #include <data/casefile-factory.h>
27 #include <libpspp/compiler.h>
37 /* Transformations. */
39 void add_transformation (struct dataset *ds,
40 trns_proc_func *, trns_free_func *, void *);
41 void add_transformation_with_finalizer (struct dataset *ds,
44 trns_free_func *, void *);
45 size_t next_transformation (const struct dataset *ds);
47 void discard_variables (struct dataset *ds);
51 bool proc_cancel_all_transformations (struct dataset *ds);
52 struct trns_chain *proc_capture_transformations (struct dataset *ds);
54 void proc_start_temporary_transformations (struct dataset *ds);
55 bool proc_in_temporary_transformations (const struct dataset *ds);
56 bool proc_make_temporary_transformations_permanent (struct dataset *ds);
57 bool proc_cancel_temporary_transformations (struct dataset *ds);
62 typedef void replace_source_callback (struct case_source *);
63 typedef void replace_dictionary_callback (struct dictionary *);
66 struct dataset * create_dataset (struct casefile_factory *fact,
67 replace_source_callback *,
68 replace_dictionary_callback *
71 void destroy_dataset (struct dataset *);
73 struct casefile_factory *dataset_get_casefile_factory (const struct dataset *);
75 void proc_set_source (struct dataset *ds, struct case_source *);
76 bool proc_has_source (const struct dataset *ds);
78 void proc_set_sink (struct dataset *ds, struct case_sink *);
79 struct casefile *proc_capture_output (struct dataset *ds);
81 typedef bool casefile_func (const struct casefile *, void *);
82 typedef bool case_func (const struct ccase *, void *, const struct dataset *);
83 typedef void begin_func (const struct ccase *, void *, const struct dataset*);
85 typedef bool end_func (void *, const struct dataset *);
87 typedef bool split_func (const struct ccase *, const struct casefile *,
88 void *, const struct dataset *);
92 bool procedure (struct dataset *ds, case_func *, void *aux) WARN_UNUSED_RESULT;
94 bool procedure_with_splits (struct dataset *ds,
100 bool multipass_procedure (struct dataset *ds, casefile_func *, void *aux)
102 bool multipass_procedure_with_splits (struct dataset *ds,
107 time_t time_of_last_procedure (struct dataset *ds);
109 void proc_open (struct dataset *);
110 bool proc_read (struct dataset *, struct ccase **);
111 bool proc_close (struct dataset *);
114 struct ccase *lagged_case (const struct dataset *ds, int n_before);
116 inline struct dictionary *dataset_dict (const struct dataset *ds);
117 inline void dataset_set_dict ( struct dataset *ds, struct dictionary *dict);
119 void dataset_need_lag (struct dataset *ds, int n_before);
121 #endif /* procedure.h */