- arc.src_values_pool = pool_create ();
- arc.dst_vars = xnmalloc (arc.var_cnt, sizeof *arc.dst_vars);
- arc.src_values = xnmalloc (arc.var_cnt, sizeof *arc.src_values);
- for (i = 0; i < dst_cnt; i++)
- if (arc.src_vars[i]->type == ALPHA)
- arc.src_values[i] = hsh_create (10, compare_alpha_value,
- hash_alpha_value, NULL, arc.src_vars[i]);
- else
- arc.src_values[i] = hsh_create (10, compare_numeric_value,
- hash_numeric_value, NULL, NULL);
-
- ok = procedure (ds, autorecode_proc_func, &arc);
-
- for (i = 0; i < arc.var_cnt; i++)
- arc.dst_vars[i] = dict_create_var_assert (dataset_dict (ds),
- arc.dst_names[i], 0);
-
- recode (ds, &arc);
- arc_free (&arc);
- return ok ? CMD_SUCCESS : CMD_CASCADING_FAILURE;
-
-lossage:
- arc_free (&arc);
- return CMD_CASCADING_FAILURE;
-}
-
-static void
-arc_free (struct autorecode_pgm *arc)
-{
- free (arc->src_vars);
- if (arc->dst_names != NULL)