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

Re: SOLVED: Re: Problem with the svn python bindings

From: Matt Kraai <kraai_at_alumni.cmu.edu>
Date: 2003-04-01 06:13:57 CEST

On Mon, Mar 31, 2003 at 10:48:14PM -0500, Garrett Rooney wrote:
>
> On Monday, March 31, 2003, at 10:03 PM, kfogel@collab.net wrote:
>
> ><ryan@netidea.com> writes:
> >>Change # 5502 changed the interface to svn_fs_file_length() without
> >>changing
> >>fs.py in the python bindings.
> >
> >I'm sorry -- I thought those were automatically generated from the
> >header files, at 'make swig-py' time. Did I miss a step?
>
> it looks like it's the _foo.py stuff that's autogenerated. the foo.py
> stuff is hand coded wrappers around the generated code, if i'm reading
> this right.

I believe the following patch fixes this. Would someone please
test it?

* subversion/bindings/swig/svn_types.i: Add a typemap for
  svn_filesize_t.

Index: subversion/bindings/swig/svn_types.i
===================================================================
--- subversion/bindings/swig/svn_types.i (revision 5509)
+++ subversion/bindings/swig/svn_types.i (working copy)
@@ -103,6 +103,17 @@
 */
 %apply long *OUTPUT { svn_revnum_t * };
 
+/* ----------------------------------------------------------------------- */
+
+/* Define an OUTPUT typemap for 'svn_filesize_t *'. For now, we'll
+ treat it as a 'long' even if that isn't entirely correct... */
+
+%typemap(python,in,numinputs=0) svn_filesize_t * (svn_filesize_t temp)
+ "$1 = &temp;";
+
+%typemap(python,argout,fragment="t_output_helper") svn_filesize_t *
+ "$result = t_output_helper($result,PyInt_FromLong((long) (*$1)));";
+
 /* -----------------------------------------------------------------------
    Define a general ptr/len typemap. This takes a single script argument
    and expands it into a ptr/len pair for the native call.

Matt

-- 
It's most certainly GNU/Linux, not Linux.  Read more at
http://www.gnu.org/gnu/why-gnu-linux.html.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 1 06:13:06 2003

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.