Fix bug #20910.
[pspp] / src / data / lazy-casereader.h
diff --git a/src/data/lazy-casereader.h b/src/data/lazy-casereader.h
new file mode 100644 (file)
index 0000000..c83f39d
--- /dev/null
@@ -0,0 +1,39 @@
+/* PSPP - a program for statistical analysis.
+   Copyright (C) 2007 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+/* Lazy casereader.
+
+   A "lazy casereader" is a casereader that saves an underlying
+   casereader from the need to be instantiated in the case where
+   it is never used.  If any casereader operation is ever
+   performed on a lazy casereader, it invokes a callback function
+   (provided by the lazy casereader's creator) to instantiate the
+   underlying reader. */
+
+#ifndef DATA_LAZY_CASEREADER_H
+#define DATA_LAZY_CASEREADER_H 1
+
+#include <stdbool.h>
+#include <data/case.h>
+
+struct casereader *lazy_casereader_create (size_t value_cnt,
+                                           casenumber case_cnt,
+                                           struct casereader *(*) (void *aux),
+                                           void *aux,
+                                           unsigned long int *serial);
+bool lazy_casereader_destroy (struct casereader *, unsigned long int serial);
+
+#endif /* data/lazy-casereader.h */