Continue reforming procedure execution. In this phase, get rid of the
[pspp-builds.git] / src / language / stats / frequencies.q
index b34299322db347a58940144109afc5e971beb053..39882e76c527c8d46e51bb708bcb3f7c5bfb6af2 100644 (file)
 */
 
 #include <config.h>
-#include <libpspp/message.h>
+
 #include <math.h>
 #include <stdlib.h>
 #include <gsl/gsl_histogram.h>
 
-#include <libpspp/alloc.h>
-#include <libpspp/bit-vector.h>
 #include <data/case.h>
-#include <libpspp/compiler.h>
 #include <data/dictionary.h>
-#include <libpspp/hash.h>
-#include <libpspp/pool.h>
+#include <data/procedure.h>
+#include <data/settings.h>
+#include <data/value-labels.h>
+#include <data/variable.h>
 #include <language/command.h>
+#include <language/dictionary/split-file.h>
 #include <language/lexer/lexer.h>
-#include <math/moments.h>
-#include <libpspp/message.h>
+#include <libpspp/alloc.h>
 #include <libpspp/array.h>
+#include <libpspp/bit-vector.h>
+#include <libpspp/compiler.h>
+#include <libpspp/hash.h>
 #include <libpspp/magic.h>
+#include <libpspp/message.h>
+#include <libpspp/message.h>
 #include <libpspp/misc.h>
-#include <output/output.h>
-#include <output/manager.h>
+#include <libpspp/pool.h>
 #include <libpspp/str.h>
-#include <output/table.h>
-#include <data/value-labels.h>
-#include <data/variable.h>
-#include <procedure.h>
-#include <data/settings.h>
-#include <output/charts/piechart.h>
+#include <math/histogram.h>
+#include <math/moments.h>
 #include <output/chart.h>
+#include <output/charts/piechart.h>
 #include <output/charts/plot-hist.h>
+#include <output/manager.h>
+#include <output/output.h>
+#include <output/table.h>
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -61,8 +64,6 @@
 
 /* (headers) */
 
-#include <libpspp/debug-print.h>
-
 /* (specification)
    FREQUENCIES (frq_):
      *variables=custom;
@@ -267,8 +268,8 @@ static void determine_charts (void);
 
 static void calc_stats (struct variable *v, double d[frq_n_stats]);
 
-static void precalc (void *);
-static bool calc (struct ccase *, void *);
+static void precalc (const struct ccase *, void *);
+static bool calc (const struct ccase *, void *);
 static void postcalc (void *);
 
 static void postprocess_freq_tab (struct variable *);
@@ -494,7 +495,7 @@ determine_charts (void)
 
 /* Add data from case C to the frequency table. */
 static bool
-calc (struct ccase *c, void *aux UNUSED)
+calc (const struct ccase *c, void *aux UNUSED)
 {
   double weight;
   size_t i;
@@ -549,10 +550,12 @@ calc (struct ccase *c, void *aux UNUSED)
 /* Prepares each variable that is the target of FREQUENCIES by setting
    up its hash table. */
 static void
-precalc (void *aux UNUSED)
+precalc (const struct ccase *first, void *aux UNUSED)
 {
   size_t i;
 
+  output_split_file_values (first);
+
   pool_destroy (gen_pool);
   gen_pool = pool_create ();