iv->current = casereader_read (iv->input);
}
-static int
+static enum trns_result
rank_trns_proc (void *trns_, struct ccase **c, casenumber case_idx UNUSED)
{
struct rank_trns *trns = trns_;
return true;
}
+static const struct trns_class rank_trns_class = {
+ .name = "RANK",
+ .execute = rank_trns_proc,
+ .destroy = rank_trns_free,
+};
+
static bool
rank_cmd (struct dataset *ds, const struct rank *cmd)
{
subcase_add_vars_always (&projection,
cmd->group_vars, cmd->n_group_vars);
subcase_add_vars_always (&projection, dict_get_split_vars (d),
- dict_get_split_cnt (d));
+ dict_get_n_splits (d));
if (weight_var != NULL)
{
subcase_add_var_always (&projection, weight_var, SC_ASCEND);
- weight_idx = 2 + cmd->n_group_vars + dict_get_split_cnt (d);
+ weight_idx = 2 + cmd->n_group_vars + dict_get_n_splits (d);
}
else
weight_idx = -1;
/* Group by split variables */
subcase_init_empty (&split_vars);
- for (j = 0; j < dict_get_split_cnt (d); j++)
+ for (j = 0; j < dict_get_n_splits (d); j++)
subcase_add_always (&split_vars, 2 + j + cmd->n_group_vars,
var_get_width (dict_get_split_vars (d)[j]),
SC_ASCEND);
}
free (outputs);
- add_transformation (ds, rank_trns_proc, rank_trns_free, trns);
+ add_transformation (ds, &rank_trns_class, trns);
/* Delete our sort key, which we don't need anymore. */
dict_delete_var (d, order_var);