1 /* PSPP - computes sample statistics.
2 Copyright (C) 2004, 2006 Free Software Foundation, Inc.
3 Written by Ben Pfaff <blp@gnu.org>.
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 #ifndef CASEFILE_PRIVATE_H
21 #define CASEFILE_PRIVATE_H
25 #include <libpspp/ll.h>
34 void (*destroy) (struct casefile *) ;
36 bool (*error) (const struct casefile *) ;
38 size_t (*get_value_cnt) (const struct casefile *) ;
39 unsigned long (*get_case_cnt) (const struct casefile *) ;
41 struct casereader * (*get_reader) (const struct casefile *) ;
43 bool (*append) (struct casefile *, const struct ccase *) ;
46 bool (*in_core) (const struct casefile *) ;
47 bool (*to_disk) (const struct casefile *) ;
48 bool (*sleep) (const struct casefile *) ;
53 const struct class_casefile *class ; /* Class pointer */
55 struct ll_list reader_list ; /* List of our readers. */
56 struct ll ll ; /* Element in the class' list
58 bool being_destroyed; /* A destructive reader exists */
62 struct class_casereader
64 struct ccase * (*get_next_case) (struct casereader *);
66 unsigned long (*cnum) (const struct casereader *);
68 void (*destroy) (struct casereader * r);
70 struct casereader * (*clone) (const struct casereader *);
74 #define CLASS_CASEREADER(K) ( (struct class_casereader *) K)
78 const struct class_casereader *class; /* Class pointer */
80 struct casefile *cf; /* The casefile to which this reader belongs */
81 struct ll ll; /* Element in the casefile's list of readers */
83 struct casefilter *filter; /* The filter to be used */
84 bool destructive; /* True if this reader is destructive */
88 #define CASEFILE(C) ( (struct casefile *) C)
89 #define CONST_CASEFILE(C) ( (const struct casefile *) C)
91 #define CASEFILEREADER(CR) ((struct casereader *) CR)
94 /* Functions for implementations' use only */
96 void casefile_register (struct casefile *cf,
97 const struct class_casefile *k);
99 void casereader_register (struct casefile *cf,
100 struct casereader *reader,
101 const struct class_casereader *k);