1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc.
3 Written by Ben Pfaff <blp@gnu.org>.
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 #ifndef TRANSFORMATIONS_H
21 #define TRANSFORMATIONS_H 1
26 typedef unsigned long casenumber ;
28 /* trns_proc_func return values. */
31 TRNS_CONTINUE = -1, /* Continue to next transformation. */
32 TRNS_DROP_CASE = -2, /* Drop this case. */
33 TRNS_ERROR = -3, /* A serious error, so stop the procedure. */
34 TRNS_NEXT_CASE = -4, /* Skip to next case. INPUT PROGRAM only. */
35 TRNS_END_FILE = -5 /* End of input. INPUT PROGRAM only. */
39 typedef void trns_finalize_func (void *);
40 typedef int trns_proc_func (void *, struct ccase *, casenumber);
41 typedef bool trns_free_func (void *);
43 /* Transformation chains. */
45 struct trns_chain *trns_chain_create (void);
46 void trns_chain_finalize (struct trns_chain *);
47 bool trns_chain_destroy (struct trns_chain *);
49 bool trns_chain_is_empty (const struct trns_chain *);
51 void trns_chain_append (struct trns_chain *, trns_finalize_func *,
52 trns_proc_func *, trns_free_func *, void *);
53 size_t trns_chain_next (struct trns_chain *);
54 enum trns_result trns_chain_execute (struct trns_chain *, struct ccase *,
55 const size_t *case_nr);
57 void trns_chain_splice (struct trns_chain *, struct trns_chain *);
59 #endif /* transformations.h */