1 /* PSPP - computes sample statistics.
2 Copyright (C) 2004, 2006 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 #ifndef CASEFILE_PRIVATE_H
20 #define CASEFILE_PRIVATE_H
24 #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 */
82 struct casefilter *filter; /* The filter to be used */
83 bool destructive; /* True if this reader is destructive */
87 #define CASEFILE(C) ( (struct casefile *) C)
88 #define CONST_CASEFILE(C) ( (const struct casefile *) C)
90 #define CASEFILEREADER(CR) ((struct casereader *) CR)
93 /* Functions for implementations' use only */
95 void casefile_register (struct casefile *cf,
96 const struct class_casefile *k);
98 void casereader_register (struct casefile *cf,
99 struct casereader *reader,
100 const struct class_casereader *k);