[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Multiple problems with svn python bindings

From: Daniel Berlin <dberlin_at_dberlin.org>
Date: 2002-08-31 18:52:40 CEST

y

On 31 Aug 2002, Jon Trowbridge wrote:

> On Fri, 2002-08-30 at 16:42, Greg Stein wrote:
> > The issue here is that we need to accept a (Python) list and construct an
> > apr_array_header_t for passing into those functins. To do *that*, we need a
> > pool for that construction. So what needs to happen with those functions is
> > to somehow tell SWIG that the pool to use is "arg6" or whatever.
>
> Is there a way to get SWIG to do this that isn't totally abusive? I
> figured out one way, but it is so overwhelmingly hacky that I'm too
> embarrassed to mention it in public. :)

It's probably easiest to modify swig, actually.
I would imagine this is not a feature that would be unused or is specific
to subversion.
You just need to be able to have a parameter that is matched somewhere
else.

Like so:
%typemap(python, in, param=pool) svn_stringbuf_t * {
        $1 = svn_stringbuf_create(...,pool);
}

Then, any function where this typemap is used, either has to specifically
have a parameter named "pool" (which it would use by default), or specify
the value somehow (a "param_is").

We do this in GCC's garbage collector walker generator because of variable
arrays (which are unions of about 30 different types) and whatnot, where
we know at the point we use them what type of thing we are storing in
them, but not at the point of the structure definition. Which is like what
we have here.

We know what pool to use at the point of the use of the conversion, but
not at the definition of how to do that conversion.

> -JT
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sat Aug 31 18:53:15 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.