1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2021 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/>. */
19 #include "language/command.h"
20 #include "language/lexer/lexer.h"
21 #include "libpspp/message.h"
23 #include "gl/xalloc.h"
26 #define _(msgid) gettext (msgid)
30 struct pivot_table_look *look;
32 /* If this is NULL, zeros are displayed using the normal print format.
33 Otherwise, this string is displayed. */
36 /* If this is NULL, missing values are displayed using the normal print
37 format. Otherwise, this string is displayed. */
40 /* Contains "struct ctables_vlabel" structs. */
43 bool mrsets_count_duplicates; /* MRSETS. */
44 bool smissing_listwise; /* SMISSING. */
45 struct variable *base_weight; /* WEIGHT. */
46 double hide_threshold; /* HIDESMALLCOUNTS. */
48 struct ctables_table *tables;
54 struct hmap_node hmap_node; /* In struct ctables's 'vlabels' hmap. */
55 const char *name; /* Variable name. */
57 /* SETTINGS_VALUE_SHOW_DEFAULT is interpreted as "none". */
58 enum settings_value_show show;
61 struct ctables_postcompute
63 struct hmap_node hmap_node; /* In struct ctables's 'pcompute' hmap. */
64 const char *name; /* Name, without leading &. */
66 struct ctables_postcompute_expr *expr;
69 bool hide_source_cats;
72 struct ctables_postcompute_expr
74 enum ctables_postcompute_op
82 /* XXX SUBTOTAL and HSUBTOTAL */
95 /* CTPET_CAT_NUMBER, CTPET_NUMBER. */
100 XXX what about string ranges? */
103 double low; /* -DBL_MAX for LO. */
104 double high; /* DBL_MAX for HIGH. */
108 /* CTPET_ADD, CTPET_SUB, CTPET_MUL, CTPET_DIV, CTPET_POW. */
109 struct ctables_postcompute_expr *subs[2];
115 cmd_ctables (struct lexer *lexer, struct dataset *ds)