|
Fabio Mascarenhas wrote:
Well, guess I spoke too soon about libffi! The documentation is pretty sketchy, but I dug around in the source of the CVS version of libffi and found how to do callbacks. So after some hours of late night hacking I ripped out ffcall and put libffi in its place. The Alien API remains the same, so I am calling this version 0.3.1.I've decided to try using Alien as a unit testing platform for a C library I wrote. While working on this I found a few deficiencies...... * callbacks cannot be nil - relatively easy to patch... in alien_check_callback, check for nil and return NULL if so... [I think thats right...]I uploaded a new rockspec and removed the rockspec for 0.3 from the repository. All traces of ffcall are gone from the distribution. I incorporated the libffi source code in the distribution because the version in MacPorts is buggy.Enjoy the GPL-free Alien 0.3.1!
* callbacks cannot be passed into a callback...EX: I have a callback that receives a 'next' callback that is to be called with results (and can be called multiple times, so return value cannot be hacked in well.) API suggestion: anonymous callbacks should be able to accept the :types function to apply types and make them callable.