logo       

Re: List of functions ?: msg#00020

statistics.pspp.devel

Subject: Re: List of functions ?

John Darrington <john@xxxxxxxxxxxxxxx> writes:

> Thanks. The contents of parse.inc seem to be what I want. So far as
> I can see, the first two fields will suffice.
>
> However, this list contains more than what I want. There are some
> 'non functions' at the top of the file , and some that a user doesn't
> normally think of as functions, at the foot eg "ADD", "EQ" etc. Maybe
> it's possible to identify these with flag?

The user-visible functions are OP_function_first through
OP_function_last (see operations.h, also a generated file).

Perhaps a function-based external interface to the list then?
e.g.:

size_t
expr_get_function_cnt (void)
{
return OP_function_cnt;
}

const char *
expr_get_function_name (size_t idx)
{
assert (idx < OP_function_cnt);
return operations[idx + OP_function_first].name;
}

const char *
expr_get_function_prototype (size_t idx)
{
assert (idx < OP_function_cnt);
return operations[idx + OP_function_first].prototype;
}

(There will be some duplicates for function names, but prototypes
should be unique.)
--
Ben Pfaff
email: blp@xxxxxxxxxxxxxxx
web: http://benpfaff.org


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise