Encapsulated the static data of procedure.[ch] into a single object, to be
[pspp-builds.git] / src / language / stats / oneway.q
index a400c1da6f0f08b54e23cbe98d47973be275e2e2..0b75608a761b482286eb3df470d233477e576da6 100644 (file)
@@ -57,17 +57,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 /* (specification)
    "ONEWAY" (oneway_):
    *^variables=custom;
-   +missing=miss:!analysis/listwise,
-   incl:include/!exclude;
-   contrast= double list;
-   statistics[st_]=descriptives,homogeneity.
+   missing=miss:!analysis/listwise,
+           incl:include/!exclude;
+   +contrast= double list;
+   +statistics[st_]=descriptives,homogeneity.
 */
 /* (declarations) */
 /* (functions) */
 
 
 
-static int bad_weight_warn = 1;
+static bool bad_weight_warn = true;
 
 
 static struct cmd_oneway cmd;
@@ -121,7 +121,7 @@ cmd_oneway(void)
   int i;
   bool ok;
 
-  if ( !parse_oneway(&cmd) )
+  if ( !parse_oneway(&cmd, NULL) )
     return CMD_FAILURE;
 
   /* If /MISSING=INCLUDE is set, then user missing values are ignored */
@@ -149,7 +149,7 @@ cmd_oneway(void)
        }
     }
 
-  ok = multipass_procedure_with_splits (run_oneway, &cmd);
+  ok = multipass_procedure_with_splits (current_dataset, run_oneway, &cmd);
 
   free (vars);
   free_oneway (&cmd);
@@ -223,17 +223,17 @@ output_oneway(void)
 
 /* Parser for the variables sub command */
 static int
-oneway_custom_variables(struct cmd_oneway *cmd UNUSED)
+oneway_custom_variables(struct cmd_oneway *cmd UNUSED, void *aux UNUSED)
 {
 
   lex_match('=');
 
-  if ((token != T_ID || dict_lookup_var (default_dict, tokid) == NULL)
+  if ((token != T_ID || dict_lookup_var (dataset_dict (current_dataset), tokid) == NULL)
       && token != T_ALL)
     return 2;
   
 
-  if (!parse_variables (default_dict, &vars, &n_vars,
+  if (!parse_variables (dataset_dict (current_dataset), &vars, &n_vars,
                        PV_DUPLICATE 
                        | PV_NUMERIC | PV_NO_SCRATCH) )
     {
@@ -917,7 +917,7 @@ run_oneway(const struct ccase *first, const struct casefile *cf, void *cmd_)
       size_t i;
 
       const double weight = 
-       dict_get_case_weight(default_dict,&c,&bad_weight_warn);
+       dict_get_case_weight (dataset_dict (current_dataset), &c, &bad_weight_warn);
       
       const union value *indep_val = case_data (&c, indep_var->fv);