X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fxforms%2Fcount.c;h=1a1422b31f0a69ff695abe4cc7e76888957d0ce4;hb=60c545e6e958d868db3399a8989d37d8f9e0c131;hp=0369af1e5d8687071edd44350c45c89760c42d75;hpb=339f1956cc727eda788638644ef93ab7852b31cd;p=pspp diff --git a/src/language/xforms/count.c b/src/language/xforms/count.c index 0369af1e5d..1a1422b31f 100644 --- a/src/language/xforms/count.c +++ b/src/language/xforms/count.c @@ -88,13 +88,13 @@ struct count_trns struct pool *pool; }; -static trns_proc_func count_trns_proc; -static trns_free_func count_trns_free; +static const struct trns_class count_trns_class; static bool parse_numeric_criteria (struct lexer *, struct pool *, struct criteria *); static bool parse_string_criteria (struct lexer *, struct pool *, struct criteria *, const char *dict_encoding); +static bool count_trns_free (void *trns_); int cmd_count (struct lexer *lexer, struct dataset *ds) @@ -185,7 +185,7 @@ cmd_count (struct lexer *lexer, struct dataset *ds) dv->var = dict_create_var_assert (dataset_dict (ds), dv->name, 0); } - add_transformation (ds, count_trns_proc, count_trns_free, trns); + add_transformation (ds, &count_trns_class, trns); return CMD_SUCCESS; fail: @@ -337,7 +337,7 @@ count_string (struct criteria *crit, const struct ccase *c) } /* Performs the COUNT transformation T on case C. */ -static int +static enum trns_result count_trns_proc (void *trns_, struct ccase **c, casenumber case_num UNUSED) { @@ -369,3 +369,9 @@ count_trns_free (void *trns_) pool_destroy (trns->pool); return true; } + +static const struct trns_class count_trns_class = { + .name = "COUNT", + .execute = count_trns_proc, + .destroy = count_trns_free, +};