X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fexpressions%2Fparse.c;h=a253bb4accabcaa37dfae7a80baf92576bb6118d;hb=f49ed94900625697d344071290cf2360293c27e3;hp=329a740960217979ec1310be133b71c6b34fdd39;hpb=48386ee68a5283653435d05a9ea4e449710fd370;p=pspp-builds.git diff --git a/src/language/expressions/parse.c b/src/language/expressions/parse.c index 329a7409..a253bb4a 100644 --- a/src/language/expressions/parse.c +++ b/src/language/expressions/parse.c @@ -1507,3 +1507,42 @@ allocate_unary_variable (struct expression *e, const struct variable *v) return expr_allocate_unary (e, var_is_numeric (v) ? OP_NUM_VAR : OP_STR_VAR, expr_allocate_variable (e, v)); } + +/* Export function details to other modules. */ + +/* Returns the operation structure for the function with the + given IDX. */ +const struct operation * +expr_get_function (size_t idx) +{ + assert (idx < OP_function_cnt); + return &operations[OP_function_first + idx]; +} + +/* Returns the number of expression functions. */ +size_t +expr_get_function_cnt (void) +{ + return OP_function_cnt; +} + +/* Returns the name of operation OP. */ +const char * +expr_operation_get_name (const struct operation *op) +{ + return op->name; +} + +/* Returns the human-readable prototype for operation OP. */ +const char * +expr_operation_get_prototype (const struct operation *op) +{ + return op->prototype; +} + +/* Returns the number of arguments for operation OP. */ +int +expr_operation_get_arg_cnt (const struct operation *op) +{ + return op->arg_cnt; +}