\f
/* pivot_value. */
-enum pivot_value_type
+enum ATTRIBUTE ((packed)) pivot_value_type
{
PIVOT_VALUE_NUMERIC, /* A value of a numeric variable. */
PIVOT_VALUE_STRING, /* A value of a string variable. */
size_t *footnote_indexes;
size_t n_footnotes;
- enum pivot_value_type type;
union
{
+ enum pivot_value_type type;
+
/* PIVOT_VALUE_NUMERIC. */
struct
{
- double x; /* The numeric value. */
+ enum pivot_value_type type;
+ enum settings_value_show show; /* Show value or label or both? */
struct fmt_spec format; /* Format to display 'x'. */
+ bool honor_small; /* Honor value of pivot table 'small'? */
+ double x; /* The numeric value. */
char *var_name; /* May be NULL. */
char *value_label; /* May be NULL. */
- enum settings_value_show show; /* Show value or label or both? */
- bool honor_small; /* Honor value of pivot table 'small'? */
}
numeric;
/* PIVOT_VALUE_STRING. */
struct
{
- char *s; /* The string value. */
+ enum pivot_value_type type;
+ enum settings_value_show show; /* Show value or label or both? */
bool hex; /* Display in hex? */
+ char *s; /* The string value. */
char *var_name; /* May be NULL. */
char *value_label; /* May be NULL. */
- enum settings_value_show show; /* Show value or label or both? */
}
string;
/* PIVOT_VALUE_VARIABLE. */
struct
{
+ enum pivot_value_type type;
+ enum settings_value_show show; /* Show name or label or both? */
char *var_name;
char *var_label; /* May be NULL. */
- enum settings_value_show show; /* Show name or label or both? */
}
variable;
/* PIVOT_VALUE_TEXT. */
struct
{
+ enum pivot_value_type type;
+
/* 'local', 'c', and 'id' must all be nonnull, but they are allowed
to be the same pointer. */
+ bool user_provided;
char *local; /* Localized. */
char *c; /* English. */
char *id; /* Identifier. */
- bool user_provided;
}
text;
/* PIVOT_VALUE_TEMPLATE. */
struct
{
+ enum pivot_value_type type;
+
+ /* Arguments.
+
+ The odd ordering in this struct reduces the overall size
+ of struct pivot_value. */
+ unsigned int n_args;
+ struct pivot_argument *args;
+
/* Both 'local' and 'id' must be nonnull, but they are allowed to
be the same pointer. */
char *local; /* Localized. */
char *id; /* Identifier. */
- struct pivot_argument *args;
- size_t n_args;
}
template;
};