bool blank_valid;
};
-static trns_proc_func autorecode_trns_proc;
-static trns_free_func autorecode_trns_free;
+static const struct trns_class autorecode_trns_class;
static int compare_arc_items (const void *, const void *, const void *aux);
static void arc_free (struct autorecode_pgm *);
bool print = false;
/* Create procedure. */
- struct autorecode_pgm *arc = xzalloc (sizeof *arc);
+ struct autorecode_pgm *arc = XZALLOC (struct autorecode_pgm);
arc->blank_valid = true;
/* Parse variable lists. */
/* Free array. */
free (items);
}
- add_transformation (ds, autorecode_trns_proc, autorecode_trns_free, arc);
+ add_transformation (ds, &autorecode_trns_class, arc);
for (size_t i = 0; i < n_dsts; i++)
free (dst_names[i]);
return direction == ASCENDING ? cmp : -cmp;
}
-static int
+static enum trns_result
autorecode_trns_proc (void *arc_, struct ccase **c,
casenumber case_idx UNUSED)
{
size_t hash = value_hash (value, width, 0);
const struct arc_item *item = find_arc_item (spec->items, value, width,
hash);
- case_data_rw (*c, spec->dst)->f = item ? item->to : SYSMIS;
+ *case_num_rw (*c, spec->dst) = item ? item->to : SYSMIS;
}
return TRNS_CONTINUE;
arc_free (arc);
return true;
}
+
+static const struct trns_class autorecode_trns_class = {
+ .name = "AUTORECODE",
+ .execute = autorecode_trns_proc,
+ .destroy = autorecode_trns_free,
+};