X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fxforms%2Frecode.c;h=4d491dd9be1462f49d46a0f0054d50e1f255d2d7;hb=60c545e6e958d868db3399a8989d37d8f9e0c131;hp=a2d963188ac949d64fa5e1ea9829d8f59375411a;hpb=339f1956cc727eda788638644ef93ab7852b31cd;p=pspp diff --git a/src/language/xforms/recode.c b/src/language/xforms/recode.c index a2d963188a..4d491dd9be 100644 --- a/src/language/xforms/recode.c +++ b/src/language/xforms/recode.c @@ -128,8 +128,9 @@ static void set_map_out_str (struct map_out *, struct pool *, static bool enlarge_dst_widths (struct recode_trns *); static void create_dst_vars (struct recode_trns *, struct dictionary *); -static trns_proc_func recode_trns_proc; -static trns_free_func recode_trns_free; +static bool recode_trns_free (void *trns_); + +static const struct trns_class recode_trns_class; /* Parser. */ @@ -173,8 +174,7 @@ cmd_recode (struct lexer *lexer, struct dataset *ds) create_dst_vars (trns, dict); /* Done. */ - add_transformation (ds, - recode_trns_proc, recode_trns_free, trns); + add_transformation (ds, &recode_trns_class, trns); } while (lex_match (lexer, T_SLASH)); @@ -690,7 +690,7 @@ find_src_string (struct recode_trns *trns, const uint8_t *value, } /* Performs RECODE transformation. */ -static int +static enum trns_result recode_trns_proc (void *trns_, struct ccase **c, casenumber case_idx UNUSED) { struct recode_trns *trns = trns_; @@ -747,3 +747,9 @@ recode_trns_free (void *trns_) pool_destroy (trns->pool); return true; } + +static const struct trns_class recode_trns_class = { + .name = "RECODE", + .execute = recode_trns_proc, + .destroy = recode_trns_free, +};