3c849805a69a8fc2c518f5e9d13264fa1412507c
[pspp-builds.git] / src / data / caseinit.h
1 /* PSPP - computes sample statistics.
2    Copyright (C) 2007 Free Software Foundation, Inc.
3
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.
8
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.
13
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
17    02110-1301, USA. */
18
19 /* Case initializer.
20
21    The procedure code has to resize cases provided by the active
22    file data source, to provide room for any other variables that
23    should go in the case, fill in the values of "left" variables,
24    and initialize the values of other non-left variable to zero
25    or spaces.  Then, when we're done with that case, we have to
26    save the values of "left" variables to copy into the next case
27    read from the active file.
28
29    The caseinit data structure provides a little help for
30    tracking what data to initialize or to copy from case to
31    case. */
32
33 #ifndef DATA_CASEINIT_H
34 #define DATA_CASEINIT_H 1
35
36 struct dictionary;
37 struct ccase;
38
39 /* Creation and destruction. */
40 struct caseinit *caseinit_create (void);
41 void caseinit_clear (struct caseinit *);
42 void caseinit_destroy (struct caseinit *);
43
44 /* Track data to be initialized. */
45 void caseinit_mark_as_preinited (struct caseinit *, const struct dictionary *);
46 void caseinit_mark_for_init (struct caseinit *, const struct dictionary *);
47
48 /* Initialize data and copy data from case to case. */
49 void caseinit_init_vars (const struct caseinit *, struct ccase *);
50 void caseinit_update_left_vars (struct caseinit *, const struct ccase *);
51
52 #endif /* data/caseinit.h */