[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Swig and C# (was: Strategy for dealing with C++ )

From: James Michael DuPont
Subject: Re: [DotGNU]Swig and C# (was: Strategy for dealing with C++ )
Date: Mon, 9 Dec 2002 04:18:37 -0800 (PST)

--- Gopal V <address@hidden> wrote:
> If memory serves me right, James Michael DuPont wrote:
> > > I have used Swig for python and found it grossly insufficent for
> my
> > > work ... (easy, but not sufficent) ... I finally wrote my own
> > > wrappers
> > > in C for Python ... which is a lot more flexible than SWIG 
> > 
> > But did you report the problems or look how the swig generators
> could
> > be modified?
> My work was far too specialized to modify something so general like
> swig.
> Swig is useful for wrapping C functions , it is not useful for
> building
> Python wrappers . 

OK, but for calling C from python?

> Especially when I need a custom marshalling scheme.
> The
> Swig is sort of hard coded for a standard wrapping code ... It does
> not 
> handle mapping VarArg python methods onto vararg C methods ...

Ok, makes sense.

> (AFAIK).
>       case 'i':
>               params[count].int32Value\
> =(int)(PyInt_AsLong(PyTuple_GetItem(args,count+prefix)));
>               count++;
>               break;
>       case 'c':
>               params[count].int32Value=\
> (PyString_AsString(PyTuple_GetItem(args,count+prefix))[0]);
>               count++;
>               break;
> Swig is a "Simple Wrapper Interface Generator" IIRC , I'd rather
> write my
> own generator than hack swig to handle this very special case ... 
> The quoted code is from my Python wrapper shell for C# , And after
> all I 
> need to inherit Objects from C# into Python which cannot be done with
> Swig
> at all ...

OK gopal. I see your point. I am looking at the Libxml right now, but
it seems that the xsharp is cleaner code, he does not use any local

I am looking into this, I hope to have some examples for librdf soon, 
with a modified swig to do the job.


James Michael DuPont

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]