size_t n;
};
+static void ctables_stack_uninit (struct ctables_stack *);
+
struct ctables_value
{
struct hmap_node node;
struct hmap domains[N_CTDTS]; /* Contains "struct ctables_domain"s. */
};
+static void ctables_section_uninit (struct ctables_section *);
+
struct ctables_table
{
struct ctables *ctables;
if (!t)
return;
+ for (size_t i = 0; i < t->n_sections; i++)
+ ctables_section_uninit (&t->sections[i]);
+ free (t->sections);
+
for (size_t i = 0; i < t->n_categories; i++)
ctables_categories_unref (t->categories[i]);
free (t->categories);
- ctables_axis_destroy (t->axes[PIVOT_AXIS_COLUMN]);
- ctables_axis_destroy (t->axes[PIVOT_AXIS_ROW]);
- ctables_axis_destroy (t->axes[PIVOT_AXIS_LAYER]);
+ for (enum pivot_axis_type a = 0; a < PIVOT_N_AXES; a++)
+ {
+ ctables_axis_destroy (t->axes[a]);
+ ctables_stack_uninit (&t->stacks[a]);
+ }
+
free (t->caption);
free (t->corner);
free (t->title);
if (!ct)
return;
+ fmt_settings_uninit (&ct->ctables_formats);
pivot_table_look_unref (ct->look);
free (ct->zero);
free (ct->missing);
}
free (sorted);
free (groups);
+ free (levels);
+ free (sections);
}
}
}
}
+static void
+ctables_section_uninit (struct ctables_section *s)
+{
+ ctables_section_clear (s);
+
+ for (enum pivot_axis_type a = 0; a < PIVOT_N_AXES; a++)
+ {
+ for (size_t i = 0; i < s->nests[a]->n; i++)
+ hmap_destroy (&s->occurrences[a][i]);
+ free (s->occurrences[a]);
+ }
+
+ hmap_destroy (&s->cells);
+ for (size_t i = 0; i < N_CTDTS; i++)
+ hmap_destroy (&s->domains[i]);
+}
+
static void
ctables_table_clear (struct ctables_table *t)
{