split-file: New function output_split_file_values_peek().
[pspp] / src / language / dictionary / split-file.c
index 13eecbb4ce358ffd1d8ad2a7c6c61556343e8fa3..efb796d7d266f0dbdde246f857361adea8f6aa52 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 
 #include "data/case.h"
+#include "data/casereader.h"
 #include "data/data-out.h"
 #include "data/dataset.h"
 #include "data/dictionary.h"
@@ -104,3 +105,17 @@ output_split_file_values (const struct dataset *ds, const struct ccase *c)
 
   pivot_table_submit (table);
 }
+
+/* Dumps out the values of all the split variables for the first case in
+   READER. */
+void
+output_split_file_values_peek (const struct dataset *ds,
+                               const struct casereader *reader)
+{
+  struct ccase *c = casereader_peek (reader, 0);
+  if (c)
+    {
+      output_split_file_values (ds, c);
+      case_unref (c);
+    }
+}