FREQUENCIES and layered split file has tests that work
[pspp] / src / output / pivot-table.h
index 2904fd4f357c1211da1d3b95d5aeb193e3776f6e..f2125c7058b3c103e09a3909a39be019c0cca337 100644 (file)
@@ -282,14 +282,43 @@ void pivot_dimension_destroy (struct pivot_dimension *);
 void pivot_dimension_dump (const struct pivot_dimension *,
                            const struct pivot_table *, int indentation);
 \f
+/* Split file handling with pivot tables.
+
+   When SPLIT FILE is in effect with the LAYERED option, values for the split
+   file variables need to be incorporated into pivot table output.  These
+   functions make that easier.
+
+   To use them:
+
+   1. After adding the rest of the dimensions to an output pivot table, call
+      pivot_splits_create().  If there are any and LAYERED mode is in use, then
+      pivot_splits_create() will add a dimension for each split file
+      variable and return a structure.  Otherwise, it returns NULL.
+
+   2. Before adding data to the pivot table for each SPLIT FILE group, call
+      pivot_splits_new_split(), passing in an example case from the group (the
+      first or last case is fine).  This will the split file handler add
+      categories for the group to the split dimensions.
+
+      pivot_splits_new_split() does nothing if given a null pivot_splits, so
+      it's fine to call it unconditionally.
+
+   3. Use pivot_splits_put*(), instead of pivot_table_put*(), to add data to
+      the pivot table.  These functions automatically add the current group
+      leaf indexes after the indexes passed in, as a convenience.
+
+      These functions still work fine if given a null pivot_splits, so it's
+      fine to use them in all cases.
+
+   4. Destroy the pivot_splits with pivot_splits_destroy() when the pivot table
+      has been fully constructed. */
+
 struct pivot_splits *pivot_splits_create (struct pivot_table *,
                                           enum pivot_axis_type,
                                           const struct dictionary *);
 void pivot_splits_destroy (struct pivot_splits *);
 
 void pivot_splits_new_split (struct pivot_splits *, const struct ccase *);
-size_t pivot_splits_get_dindexes (const struct pivot_splits *,
-                                  size_t *dindexes);
 
 void pivot_splits_put1 (struct pivot_splits *, struct pivot_table *,
                         size_t idx1, struct pivot_value *);
@@ -301,8 +330,6 @@ void pivot_splits_put3 (struct pivot_splits *, struct pivot_table *,
 void pivot_splits_put4 (struct pivot_splits *, struct pivot_table *,
                         size_t idx1, size_t idx2, size_t idx3, size_t idx4,
                         struct pivot_value *);
-
-size_t pivot_splits_count (const struct pivot_splits *);
 \f
 /* A pivot_category is a leaf (a category) or a group: