[fetter-devel] Global variables, macros and structs.
Brad Beveridge
brad.beveridge at gmail.com
Thu Dec 8 05:57:33 UTC 2005
Hi all, I have a few questions about VZN. I have used VZN to generate
bindings for ncurses.
I've started using the bindings and noticed a couple of things.
1) Global variables are not exported. Is there a reason for this, or
just something that is on the to-do list?
2) Macros don't get auto generated. This sounds like a hard problem
though, since C macros can be pretty weird at times.
3) If a header defines a struct the name of the struct is exported
from the package, but the struct members are not. Eg, given a package
FOO, with a struct BAR having a member BAZ, you need to access it as
(cffi:with-foreign-slots ((FOO::BAZ) ptr BAR) ... )
For ease of use should the members also be exported?
Back to #2, since C macros are probably hard to auto-generate, but
trivial to hand code, does VZN support a mechanism for injecting
custom code to the binding.
What I mean is, I'd like 1 file (library.binding) that contains the
info on how to generate the binding plus some code that I have hand
done that should also end up (verbatim) in the generated file. That
way I can write some helper code, and when the C header changes I can
just re-generate from one file.
Thoughts?
Cheers
Brad
More information about the fetter-devel
mailing list