Thanks for the feedback Yves and Wolfgang. I'll have a play around
with some of the ideas and see how it goes. The different approaches
presented for handling the multiarg procs in the bind implementation
are very interesting!
I've made some changes to the FFI.bind call. Now it looks like:
MyFunc = {FFI.bind Library "myfunc" Retval [ Arg1 Arg2 Arg3 ]}
I'm in the midst of adding ways of handling C arrays, pointer
arguments, etc. I also want to do a simple way of writing calls that
doesn't require a bind, and works out the argument types based on the
Oz types passed. This will allow code as simple as:
declare OpenAL = {FFI.load "openal.so"}
{OpenAL.alInit nil nil}
The library can pick up that two nil values are passed (which are
marshalled as null pointers) and call the alInit function. Not as
efficient as binding first but good for exploratory programming. And
saves the tedium of defining dozens of binds for libraries.
I'm putting together a demo using OpenAL (cross platform sound library) as I go.
Chris
--
http://www.bluishcoder.co.nz
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users