Merge commit 'origin/stable'
[pspp-builds.git] / src / data / casegrouper.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2007 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 /* Casegrouper.
18
19    Breaks up the cases from a casereader into sets of contiguous
20    cases based on some criteria, e.g. sets of cases that all have
21    the same values for some subset of variables.  Each set of
22    cases is made available to the client as a casereader. */
23
24 #ifndef DATA_CASEGROUPER_H
25 #define DATA_CASEGROUPER_H 1
26
27 #include <stdbool.h>
28 #include <stddef.h>
29
30 struct casereader;
31 struct ccase;
32 struct dictionary;
33 struct subcase;
34 struct variable;
35
36 struct casegrouper *
37 casegrouper_create_func (struct casereader *,
38                          bool (*same_group) (const struct ccase *,
39                                              const struct ccase *,
40                                              void *aux),
41                          void (*destroy) (void *aux),
42                          void *aux);
43 struct casegrouper *casegrouper_create_vars (struct casereader *,
44                                              const struct variable *const *vars,
45                                              size_t var_cnt);
46 struct casegrouper *casegrouper_create_splits (struct casereader *,
47                                                const struct dictionary *);
48 struct casegrouper *casegrouper_create_subcase (struct casereader *,
49                                                 const struct subcase *);
50 bool casegrouper_get_next_group (struct casegrouper *, struct casereader **);
51 bool casegrouper_destroy (struct casegrouper *);
52
53 #endif /* data/casegrouper.h */