work toward getting rid of struct table in table_item
[pspp] / src / output / pivot-table.h
index 091984a0daecd896bc585ad7cdc5938e99e88fcc..a62c5b7bae34f0c2e9ba6080c77fe59168771bb7 100644 (file)
@@ -432,7 +432,7 @@ struct pivot_table
     bool show_grid_lines;
     bool show_title;
     bool show_caption;
-    size_t *current_layer; /* axis[PIVOT_AXIS_LAYER].n_dimensions elements. */
+    size_t *current_layer; /* axes[PIVOT_AXIS_LAYER].n_dimensions elements. */
     enum settings_value_show show_values;
     enum settings_value_show show_variables;
     struct fmt_spec weight_format;
@@ -509,6 +509,13 @@ bool pivot_table_is_empty (const struct pivot_table *);
 /* Output. */
 void pivot_table_submit (struct pivot_table *);
 
+/* Layers. */
+#define PIVOT_TABLE_FOR_EACH_DISPLAY_LAYER(INDEXES, PT, PRINT)          \
+  for ((INDEXES) = NULL;                                                \
+       ((INDEXES) = pivot_table_next_display_layer (PT, INDEXES, PRINT)); )
+size_t *pivot_table_next_display_layer (const struct pivot_table *,
+                                        size_t *indexes, bool print);
+
 /* Data cells. */
 void pivot_table_put (struct pivot_table *, const size_t *dindexes, size_t n,
                       struct pivot_value *);