1 /* PSPP - computes sample statistics.
2 Copyright (C) 2007 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 DATA_DATASHEET_H
20 #define DATA_DATASHEET_H 1
22 #include <data/case.h>
23 #include <data/value.h>
27 /* A datasheet is a 2-d array of data that may be stored in
28 memory or on disk. It efficiently supports data storage and
29 retrieval, as well as adding, removing, and rearranging both
32 struct datasheet *datasheet_create (struct casereader *);
33 void datasheet_destroy (struct datasheet *);
34 struct datasheet *datasheet_rename (struct datasheet *);
36 bool datasheet_error (const struct datasheet *);
37 void datasheet_force_error (struct datasheet *);
38 const struct taint *datasheet_get_taint (const struct datasheet *);
40 struct casereader *datasheet_make_reader (struct datasheet *);
43 size_t datasheet_get_column_cnt (const struct datasheet *);
44 bool datasheet_insert_columns (struct datasheet *,
45 const union value[], size_t cnt,
47 void datasheet_delete_columns (struct datasheet *, size_t start, size_t cnt);
48 void datasheet_move_columns (struct datasheet *,
49 size_t old_start, size_t new_start,
53 casenumber datasheet_get_row_cnt (const struct datasheet *);
54 bool datasheet_insert_rows (struct datasheet *,
55 casenumber before, struct ccase[],
57 void datasheet_delete_rows (struct datasheet *,
58 casenumber first, casenumber cnt);
59 void datasheet_move_rows (struct datasheet *,
60 size_t old_start, size_t new_start,
64 bool datasheet_get_row (const struct datasheet *, casenumber, struct ccase *);
65 bool datasheet_put_row (struct datasheet *, casenumber, struct ccase *);
66 bool datasheet_get_value (const struct datasheet *, casenumber, size_t column,
67 union value *, int width);
68 bool datasheet_put_value (struct datasheet *, casenumber, size_t column,
69 const union value *, int width);
74 struct datasheet_test_params
86 struct mc_results *datasheet_test (struct mc_options *options, void *params);
88 #endif /* data/datasheet.h */