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>
33 void (*destroy) (struct casefile *) ;
35 bool (*error) (const struct casefile *) ;
37 size_t (*get_value_cnt) (const struct casefile *) ;
38 unsigned long (*get_case_cnt) (const struct casefile *) ;
40 struct casereader * (*get_reader) (const struct casefile *) ;
42 bool (*append) (struct casefile *, const struct ccase *) ;
45 bool (*in_core) (const struct casefile *) ;
46 bool (*to_disk) (const struct casefile *) ;
47 bool (*sleep) (const struct casefile *) ;
52 const struct class_casefile *class ; /* Class pointer */
54 struct ll_list reader_list ; /* List of our readers. */
55 struct ll ll ; /* Element in the class' list
57 bool being_destroyed; /* A destructive reader exists */
61 struct class_casereader
63 struct ccase * (*get_next_case) (struct casereader *);
65 unsigned long (*cnum) (const struct casereader *);
67 void (*destroy) (struct casereader * r);
69 struct casereader * (*clone) (const struct casereader *);
73 #define CLASS_CASEREADER(K) ( (struct class_casereader *) K)
77 const struct class_casereader *class; /* Class pointer */
79 struct casefile *cf; /* The casefile to which this reader belongs */
80 struct ll ll; /* Element in the casefile's list of readers */
81 bool destructive; /* True if this reader is destructive */
85 #define CASEFILE(C) ( (struct casefile *) C)
86 #define CONST_CASEFILE(C) ( (const struct casefile *) C)
88 #define CASEFILEREADER(CR) ((struct casereader *) CR)
91 /* Functions for implementations' use only */
93 void casefile_register (struct casefile *cf,
94 const struct class_casefile *k);
96 void casereader_register (struct casefile *cf,
97 struct casereader *reader,
98 const struct class_casereader *k);