[Prev][Next][Index][Thread]
FFI question #2: Getting the address of a C function
-
To: info-dylan@ai.mit.edu
-
Subject: FFI question #2: Getting the address of a C function
-
From: oodl@my-deja.com
-
Date: Fri, 21 Jul 2000 15:15:01 -0400 (EDT)
-
Organization: Deja.com - Before you buy.
-
Xref: traf.lcs.mit.edu comp.lang.dylan:12489
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: