work on docs
[pspp] / src / data / case-map.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2007, 2009, 2012 Free Software Foundation, Inc.
3
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.
8
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.
13
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/>.
16 */
17
18 /* Case map.
19
20    A case map copies data from a case that corresponds to one
21    dictionary to a case that corresponds to a second dictionary.
22    A few options are available for ways to create the mapping. */
23
24 #ifndef DATA_CASE_MAP_H
25 #define DATA_CASE_MAP_H 1
26
27 #include <stddef.h>
28
29 struct case_map;
30 struct casereader;
31 struct casewriter;
32 struct ccase;
33 struct dictionary;
34
35 struct case_map *case_map_create (void);
36 void case_map_destroy (struct case_map *);
37 struct ccase *case_map_execute (const struct case_map *, struct ccase *);
38
39 const struct caseproto *case_map_get_proto (const struct case_map *);
40
41 struct casereader *case_map_create_input_translator (struct case_map *,
42                                                     struct casereader *);
43 struct casewriter *case_map_create_output_translator (struct case_map *,
44                                                       struct casewriter *);
45
46 /* For mapping cases for one version of a dictionary to those in
47    a modified version of the same dictionary. */
48 struct case_map_stage *case_map_stage_create (const struct dictionary *);
49 void case_map_stage_destroy (struct case_map_stage *);
50 struct case_map *case_map_stage_get_case_map (const struct case_map_stage *);
51
52 /* For eliminating "holes" in a case. */
53 struct case_map *case_map_to_compact_dict (const struct dictionary *d,
54                                            unsigned int exclude_classes);
55
56 /* For mapping cases for one dictionary to another based on
57    variable names within the dictionary. */
58 struct case_map *case_map_by_name (const struct dictionary *old,
59                                    const struct dictionary *new);
60
61 void case_map_dump (const struct case_map *);
62
63 #endif /* data/case-map.h */