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

Assorted C-FFI goodies



Thanks to everyone who helped me with the macro questions! I managed
to get the c-function-definer macros to work after about a half hour
of hacking, and I've gotten the C-FFI library to parse; I'm now
working on compilation. :)

I've thoroughly beaten this to death on gd-hackers, but now that I
understand more of the structure of the C-FFI IDL, I'd like to
resurrect some of this here to get a wider audience. :)

I'm seeing the following in c-ffi.dylan:

/* XXX - Need clear-memory!, copy-bytes!, copy-into!, equal-memory? */


Where can I find prototypes for these?

Also, I've never worked on code to communicate between languages
before, so I'm curious about something. How, exactly, does one coerce
C primitives into Dylan objects? I guess I could see how it is
possible with pointers; just copy the bytes using the above function
and structure them into an integer, right? Or, is there more than
that? How does one do that with values as opposed to references,
though? Is 'define C-subtype' the macro which I'd use for this? Or are
the primitives handled in a different manner?

Also, how would function calls work?

And, having admitted that I've never done something like this before,
I'm curious -- is this something that I could probably finish, or does
a project like this require lots of knowledge about the inner workings
of C primitives and such? I'd very much like to finish this since I'm
extremely interested in using Dylan for regular projects, but if this
is more than likely beyond my abilities, then I should probably shift
my efforts to Pidgin and wait for someone else to take up
c-ffi. Thoughts?




Follow-Ups: