pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List of functions ?


From: Ben Pfaff
Subject: Re: List of functions ?
Date: Mon, 08 Jan 2007 10:02:20 -0800
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

John Darrington <address@hidden> 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: address@hidden
web: http://benpfaff.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]