Moved the datasheet testing code out of src/{libspp,data}
[pspp-builds.git] / src / language / tests / datasheet-check.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2007 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_DATASHEET_TEST_H
18 #define DATA_DATASHEET_TEST_H 1
19
20 #if 0
21 #include <data/case.h>
22 #include <data/value.h>
23
24 struct casereader;
25
26 /* A datasheet is a 2-d array of data that may be stored in
27    memory or on disk.  It efficiently supports data storage and
28    retrieval, as well as adding, removing, and rearranging both
29    rows and columns.  */
30
31 struct datasheet *datasheet_create (struct casereader *);
32 void datasheet_destroy (struct datasheet *);
33 struct datasheet *datasheet_rename (struct datasheet *);
34
35 bool datasheet_error (const struct datasheet *);
36 void datasheet_force_error (struct datasheet *);
37 const struct taint *datasheet_get_taint (const struct datasheet *);
38
39 struct casereader *datasheet_make_reader (struct datasheet *);
40
41 /* Columns. */
42 size_t datasheet_get_column_cnt (const struct datasheet *);
43 bool datasheet_insert_columns (struct datasheet *,
44                                const union value[], size_t cnt,
45                                size_t before);
46 void datasheet_delete_columns (struct datasheet *, size_t start, size_t cnt);
47 void datasheet_move_columns (struct datasheet *,
48                              size_t old_start, size_t new_start,
49                              size_t cnt);
50
51 /* Rows. */
52 casenumber datasheet_get_row_cnt (const struct datasheet *);
53 bool datasheet_insert_rows (struct datasheet *,
54                             casenumber before, struct ccase[],
55                             casenumber cnt);
56 void datasheet_delete_rows (struct datasheet *,
57                             casenumber first, casenumber cnt);
58 void datasheet_move_rows (struct datasheet *,
59                           size_t old_start, size_t new_start,
60                           size_t cnt);
61
62 /* Data. */
63 bool datasheet_get_row (const struct datasheet *, casenumber, struct ccase *);
64 bool datasheet_put_row (struct datasheet *, casenumber, struct ccase *);
65 bool datasheet_get_value (const struct datasheet *, casenumber, size_t column,
66                           union value *, int width);
67 bool datasheet_put_value (struct datasheet *, casenumber, size_t column,
68                           const union value *, int width);
69
70 #endif
71
72 /* Testing. */
73 struct mc_options;
74
75 struct datasheet_test_params
76   {
77     /* Parameters. */
78     int max_rows;
79     int max_cols;
80     int backing_rows;
81     int backing_cols;
82
83     /* State. */
84     int next_value;
85   };
86
87 struct mc_results *datasheet_test (struct mc_options *options, void *params);
88
89 #endif /* data/datasheet.h */