[cable] swig + cable.

Rene Dudfield illumen at yahoo.com
Sun Feb 24 07:32:03 EST 2002


Hello,

First, another question: How do I apply what is in cvs to gcc?


I'm currently trying to use swig to automatically generate wrappers for a 
largish c++ library( crystal space ).

I want to use gccxml to re write some of the header files so that swig 1.1 
can understand them.




Is reading in a header file, and then writing out the header file from gccxml 
produced xml possible?  Keeping comments would be prefered if possible.

If not, is finding the line number that a function starts, and the line 
number that it ends possible?  That way I could rewrite that particular 
function definition with a swig-happy version( using the data from the xml ), 
and keep the rest of the header file intact.

Thanks in advance for any info.



Specifically these are the problems that I need to fix so far.

1) function overloading.
Detect the functions which are overloaded, and add methods which are based on 
the type, and number of the arguments.  eg.
 int dosomething(int x);
 int dosomething(float x);
becomes:
 int dosomething_int(int x);
 int dosomething_float(float x);

Then I'll generate wrapper functions for the languages( eg python ) which 
check the type of the input and call the correct function.

2) Pass by reference functions.
Detect functions which use pass by reference and manually add new functions 
that use pointers and then dereference them before calling the pass by 
reference style function.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




More information about the cable mailing list