logo       

Re: Overriding PyArg_ParseTuple arguments: msg#00155

programming.swig

Subject: Re: Overriding PyArg_ParseTuple arguments

Tessa Lau writes:
> On Wed, Nov 26, 2003 at 12:11:50AM -0600, David Beazley wrote:
> > %typemap(in,parse="z") char * "";
>
> Perfect. Now how about using the "s#" format character, which expands
> a Python string into two C arguments, a char* and an int representing
> the length of the string? It requires adding an additional argument to
> the PyArg_ParseTuple call.
>

You can't use the above form for that. You'll have to write a normal
typemap. Actually, there's already a typemap for it.

%apply (char *STRING, int LENGTH) { (char *whatever, int size) };

-- Dave




_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise