Suggestions for C++ or DLL code

Andreas Raab andreas.raab at gmx.de
Mon Jul 31 07:22:24 UTC 2006


Ron Teitelbaum wrote:
> As for the VW dll/c connect code.  I found the ability to set up libs and
> header files and automatically generate code very useful. 

Yes, it is useful. And no, the FFI doesn't do header file parsing. I 
think there was some talk about using SWIG for dealing with this but I 
don't know if there is a Squeak backend to it yet.

> Looking at the
> FFI kernel it appears that the pieces are there for me to assemble manually,
> which I why I asked the question if it is possible.  What concerns me most
> is having to dissect the 5 or 6 very large header files that are needed to
> support the few api calls that are made.

If you only have a few api calls, you may just support the structures 
you need for those FFI calls.

> Are there some good examples of more complex FFI calls and structures, or
> easier ways to support many different required header files?  I haven't
> downloaded the VMMaker or looked at slang, do you suggest I look at that
> first before deciding on which path to take?

No, there really isn't much support for it. And none too many complex 
examples. Personally I only use the FFI for OpenGL and here we punt by 
implementing those functions that deal with complex data structures in 
primitives and only expose the ones with the trivial interfaces. If that 
is an option for you, it's a very useful one.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list