pxd: initial work
[pspp] / src / data / column.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2012 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17 #ifndef DATA_COLUMN_H
18 #define DATA_COLUMN_H 1
19
20 #include "libpspp/compiler.h"
21 #include "data/case.h"
22 #include "data/value.h"
23
24 struct pxd;
25
26 struct column *column_create (struct pxd *, int width);
27 bool column_destroy (struct column *);
28
29 int column_get_width (const struct column *);
30
31 void column_read (const struct column *, casenumber, union value *);
32 void column_write (struct column *, casenumber, const union value *);
33 void column_append (struct column *, casenumber, const union value *);
34
35 struct column *column_clone (const struct column *);
36 void column_split (struct column *, struct column **, struct column **);
37 struct column *column_rename (struct column *);
38 void column_swap (struct column *, struct column *);
39
40 bool column_is_empty (struct column *);
41
42 bool column_error (const struct column *);
43 void column_force_error (struct column *);
44 const struct taint *column_get_taint (const struct column *);
45
46 casenumber column_get_size (struct column *);
47 casenumber column_count (const struct column *);
48 void column_truncate (struct column *, casenumber);
49
50 casenumber column_advance (struct column *, casenumber);
51
52 struct pxd_object *column_save (const struct column *, struct pxd *);
53 struct column *column_load (struct pxd_object *, const struct pxd *);
54
55 #endif /* data/column.h */