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

FFI question #2: Getting the address of a C function



Hi,

I'm trying to fill in a C struct with C function pointers.  I want to do
something like:

  callbacks.function-1 := address-of-c-function("foo");

where foo is the name of C function that is being linked in with the
Dylan executable as a C library, and "address-of-c-function" is some
magic compiler functionality that I am hoping that the FFI has.

I know I can get the address of a C function via this:

  define c-address foo-pointer :: <c-function-pointer>
    c-name: "foo";
  end;

but I would prefer something shorter though because I have many
callbacks, and  I don't need for them to be named in Dylan.  I think
that define c-address macro must use a function that does what I want,
but I don't know how to get at it.

thanks in advance...


Sent via Deja.com http://www.deja.com/
Before you buy.



Follow-Ups: