void pivot_dimension_destroy (struct pivot_dimension *);
-void pivot_dimension_dump (const struct pivot_dimension *, int indentation);
+void pivot_dimension_dump (const struct pivot_dimension *,
+ const struct pivot_table *, int indentation);
\f
/* A pivot_category is a leaf (a category) or a group:
bool show_label_in_corner;
/* Leaf only. */
- struct fmt_spec format;
size_t group_index; /* In ->parent->subs[]. */
size_t data_index; /* In ->dimension->data_leaves[]. */
size_t presentation_index; /* In ->dimension->presentation_leaves[]. */
+ struct fmt_spec format; /* Default format for values in this category. */
+ bool honor_small; /* Honor pivot_table 'small' setting? */
};
static inline bool
struct pivot_table_sizing sizing[TABLE_N_AXES];
/* Format settings. */
- int epoch;
- char decimal; /* Usually ',' or '.'. */
+ struct fmt_settings settings;
char grouping; /* Usually '.' or ','. */
- char *ccs[5]; /* Custom currency. */
double small;
/* Command information. */
struct pivot_value *content);
struct pivot_table *pivot_table_ref (const struct pivot_table *);
+struct pivot_table *pivot_table_unshare (struct pivot_table *);
void pivot_table_unref (struct pivot_table *);
bool pivot_table_is_shared (const struct pivot_table *);
+/* Axes. */
+void pivot_table_swap_axes (struct pivot_table *,
+ enum pivot_axis_type, enum pivot_axis_type);
+void pivot_table_transpose (struct pivot_table *);
+void pivot_table_move_dimension (struct pivot_table *,
+ struct pivot_dimension *,
+ enum pivot_axis_type, size_t ofs);
+
/* Styling. */
const struct pivot_table_look *pivot_table_get_look (
const struct pivot_table *);
struct pivot_value *pivot_table_get_rw (struct pivot_table *,
const size_t *dindexes);
+bool pivot_table_delete (struct pivot_table *, const size_t *dindexes);
+
/* Footnotes.
Use pivot_table_create_footnote() to create a footnote.
char **subscripts;
size_t n_subscripts;
- const struct pivot_footnote **footnotes;
+ size_t *footnote_indexes;
size_t n_footnotes;
enum pivot_value_type type;
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;
/* Converting a pivot_value to a string for display. */
char *pivot_value_to_string (const struct pivot_value *,
- enum settings_value_show show_values,
- enum settings_value_show show_variables);
+ const struct pivot_table *);
+char *pivot_value_to_string_defaults (const struct pivot_value *);
void pivot_value_format (const struct pivot_value *,
- enum settings_value_show show_values,
- enum settings_value_show show_variables,
- struct string *);
+ const struct pivot_table *, struct string *);
bool pivot_value_format_body (const struct pivot_value *,
- enum settings_value_show show_values,
- enum settings_value_show show_variables,
+ const struct pivot_table *,
struct string *);
/* Styling. */