On Sat, 31 Aug 2002, Greg Stein wrote:
> On Sat, Aug 31, 2002 at 03:43:33PM -0500, Jon Trowbridge wrote:
> > On Sat, 2002-08-31 at 14:53, Greg Stein wrote:
> > > I haven't applied enough thought or investigation to the problem. I'd be
> > > interested in seeing your hacky version. We might be able to reduce the Hack
> > > from it :-)
> > OK, you asked for it. :) I'm attaching a patch that implements the hack
> > for svn_client_diff. Since it depends on calling internal swig
> > functions, this approach is very fragile. Not to mention amazingly
> > wrong-headed.
> Using obj9 directly was the idea that I had in mind, actually :-) That's
> why I said it was fragile. If SWIG changed how it generated code, then it
> would break (and I've already seen changes in the generated output, in the
> past, which would have broken this kind of construct).
Um, IIRC, when i tried this, it placed the initialization of obj9 (it was
obj6 in the function i was looking at) after the call we needed it for.
IE it didn't work.
> > All of that said, Dan Berlin's proposal for modifying swig is obviously
> > much cleaner than this... but that would require getting the patch into
> > swig, having to wait for a new swig release containing the patch, etc.
> Right. I'm not entirely sure what that change would be, nor did I really
> understand what Dan wrote. I imagine something along the lines of enabling
> parameters to the typemaps. You could then define one typemap to invoke the
> other pameterized-typemap (e.g. pass the name of the pool arg).
This isn't as hard as one would think.
It should only require modifying cwrap.c and typemap.c
You should just be able to change Swig_typemap_apply to merge the param
attribute, then in Swig_cargs (which outputs the argument handling), set
It actually already does something like this for reference parameters,
setting a default value.
The parameters you pass to a typemap are just set as attributes, so you
don't need to do anything special to pass a new parameter to a typemap.
I'll work up a patch in a moment.
> We can go with the wrapper workaround unless/until somebody suggests a patch
> to the SWIG folks.
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Sun Sep 1 01:40:29 2002