1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000, 2006 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/>. */
17 #ifndef TRANSFORMATIONS_H
18 #define TRANSFORMATIONS_H 1
22 #include <data/case.h>
24 /* trns_proc_func return values. */
27 TRNS_CONTINUE = -1, /* Continue to next transformation. */
28 TRNS_DROP_CASE = -2, /* Drop this case. */
29 TRNS_ERROR = -3, /* A serious error, so stop the procedure. */
30 TRNS_END_CASE = -4, /* Skip to next case. INPUT PROGRAM only. */
31 TRNS_END_FILE = -5 /* End of input. INPUT PROGRAM only. */
35 typedef void trns_finalize_func (void *);
36 typedef int trns_proc_func (void *, struct ccase *, casenumber);
37 typedef bool trns_free_func (void *);
39 /* Transformation chains. */
41 struct trns_chain *trns_chain_create (void);
42 void trns_chain_finalize (struct trns_chain *);
43 bool trns_chain_destroy (struct trns_chain *);
45 bool trns_chain_is_empty (const struct trns_chain *);
47 void trns_chain_append (struct trns_chain *, trns_finalize_func *,
48 trns_proc_func *, trns_free_func *, void *);
49 size_t trns_chain_next (struct trns_chain *);
50 enum trns_result trns_chain_execute (const struct trns_chain *, enum trns_result,
51 struct ccase *, casenumber case_nr);
53 void trns_chain_splice (struct trns_chain *, struct trns_chain *);
55 #endif /* transformations.h */