Hi all,
I am writing a compiler, it can call C dynamic libraries through libdl
and libffi. I want to use Swig to automate the binding process.
Since the compiler makes calls through ffi, it is unnecessary to
generate C wrappers, a the moment. (With the exception of generating
C++ wrappers, in which I am not interested at the moment.)
What I need from Swig is a manner to translate enums, constants, types
and function prototypes to a binding in the target language.
Preferably with a minimum of fuss, and preferably without changing
header files at all.
I have a few questions regarding that, and thought it be best to put
them directly in the list. For some of the answers I just need
confirmation.
1. Does Swig derive the types of constant definitions? (I.e., does it
derive that in #define A 100, A is of type int?)
2. Does Swig know the values of enum records? (I.e., in enum {X =100},
does it know X has value 100)
3. Is there a manner to easily convert a type definition to its C base
type (a combination of char, int, long, float, double and pointer)?
4. The C generated C++ wrappers as generated by swig, does it perform
this translation before it calls the language module?
Thanks all,
Marco
|