c83f39db82637430eabca7b4931ff0b2b8ca93d5
[pspp-builds.git] / src / data / lazy-casereader.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 /* Lazy casereader.
18
19    A "lazy casereader" is a casereader that saves an underlying
20    casereader from the need to be instantiated in the case where
21    it is never used.  If any casereader operation is ever
22    performed on a lazy casereader, it invokes a callback function
23    (provided by the lazy casereader's creator) to instantiate the
24    underlying reader. */
25
26 #ifndef DATA_LAZY_CASEREADER_H
27 #define DATA_LAZY_CASEREADER_H 1
28
29 #include <stdbool.h>
30 #include <data/case.h>
31
32 struct casereader *lazy_casereader_create (size_t value_cnt,
33                                            casenumber case_cnt,
34                                            struct casereader *(*) (void *aux),
35                                            void *aux,
36                                            unsigned long int *serial);
37 bool lazy_casereader_destroy (struct casereader *, unsigned long int serial);
38
39 #endif /* data/lazy-casereader.h */