1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000, 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
31 const struct case_sink_class *class; /* Class. */
32 void *aux; /* Auxiliary data. */
33 size_t value_cnt; /* Number of `union value's in case. */
36 /* A case sink class. */
37 struct case_sink_class
39 const char *name; /* Identifying name. */
41 /* Opens the sink for writing. */
42 void (*open) (struct case_sink *);
44 /* Writes a case to the sink. */
45 bool (*write) (struct case_sink *, const struct ccase *);
47 /* Closes and destroys the sink. */
48 void (*destroy) (struct case_sink *);
50 /* Closes the sink and returns a source that can read back
51 the cases that were written, perhaps transformed in some
52 way. The sink must still be separately destroyed by
54 struct case_source *(*make_source) (struct case_sink *);
57 extern const struct case_sink_class null_sink_class;
59 struct case_sink *create_case_sink (const struct case_sink_class *,
60 const struct dictionary *,
62 void free_case_sink (struct case_sink *);
64 #endif /* case-sink.h */