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

Re: Problem with python swig example - geturl.py

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-12-03 04:02:17 CET

On Mon, Dec 02, 2002 at 03:59:29PM -0800, Peter Davis wrote:
> On Monday 02 December 2002 15:37, Philip Martin wrote:
> > > adm_baton = wc.svn_wc_adm_open(None, None, dir, True, True, adm_pool)
> >
> > I know nothing about swig. The C function svn_wc_adm_open returns an
> > error (an svn_error_t*) not an access baton (an svn_wc_adm_access_t*).
> > The access baton is returned through the first argument, which is of
> > type svn_wc_adm_access_t**. If passing "None" above is equivalent to
> > passing NULL in C then that will cause a segv.
>
> I don't know much about Swig either, but I do know that it is capable of
> defining and translating arguments (the first argument in this case), as
> return values. If an error is returned by the real svn_wc_adm_open, then
> Swig will throw a real Python exception. Otherwise, it actually returns the
> value of the implicit first argument. The first "None" above should actually
> be the second argument passed to the real svn_wc_adm_open, if I understand
> Swig correctly.

Right. Except that we didn't tell swig that "svn_wc_adm_access_t **" was a
return value. I just fixed that, so it should work much better now. In fact,
I updated the geturl.py to match the new APIs.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Dec 3 04:00:45 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.