1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2019 Free Software Foundation, Inc.
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.
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.
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/>. */
17 #ifndef OUTPUT_SPV_SELECT_H
18 #define OUTPUT_SPV_SELECT_H 1
20 #include "libpspp/string-array.h"
25 /* Matching criteria for commands, subtypes, and labels.
27 Each of the members is an array of strings. A string that ends in '*'
28 matches anything that begins with the rest of the string, otherwise a string
29 requires an exact (case-insensitive) match. */
30 struct spv_criteria_match
32 struct string_array commands;
33 struct string_array subtypes;
34 struct string_array labels;
39 /* Include objects that are not visible? */
42 /* If false, include all objects.
43 If true, include only objects that have an error on loading. */
46 /* Bit-mask of SPV_CLASS_* for the classes to include. */
49 /* Include all of the objects that match 'include' and do not match
50 'exclude', except that objects are included by default if 'include' is
52 struct spv_criteria_match include;
53 struct spv_criteria_match exclude;
55 /* Include XML and binary member names that match (except that everything
56 is included by default if empty). */
57 struct string_array members;
59 /* Include the objects with indexes listed in INSTANCES within each of the
60 commands that are included. Indexes are 1-based. Index -1 means the
61 last object within a command. */
66 #define SPV_CRITERIA_INITIALIZER { .classes = SPV_ALL_CLASSES }
68 void spv_select (const struct spv_reader *,
69 const struct spv_criteria[], size_t n_criteria,
70 struct spv_item ***items, size_t *n_items);
73 #endif /* output/spv/spv-select.h */