You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Nicholas Riley <nj...@uiuc.edu> on 2003/04/13 07:27:15 UTC

[PATCH] Fix SWIG binding for svn_node_kind_t * (used in ViewCVS)

Hi,

I isolated the problem I was having with ViewCVS to the change Karl
Fogel made in revision 5502 not being propagated to the Python
bindings.  (I notice it's broken on svn.tigris.org too... :)

cmpilato posted this patch on the ViewCVS-dev list:

<http://www.lyra.org/pipermail/viewcvs-dev/2003-April/001007.html>

which I only found after I fixed it myself, of course :-/.  I read
through the SWIG documentation and this appears to be the correct
solution, even for enumerated types.  The patch should be to
svn_types.i, not svn_fs.i, though, since svn_node_kind_t * is also
referenced in svn_io.h.

Incidentally, I am still having this problem with ViewCVS, and am out
of svn hacking time for the moment.  If anyone has ideas, they'd be
appreciated.

<http://www.lyra.org/pipermail/viewcvs/2003q1/001759.html>

Also, is there an issue for the broken make dependencies on the SWIG
bindings?  I couldn't find anything, but have found I need to do this
in order to get the bindings properly rebuilt:

rm -rf subversion/bindings && mkdir -p subversion/bindings/swig/python && make && make swig-py && sudo make install-swig-py

If I omit the rm, I end up with stale bindings; if I omit the mkdir, I
get an error message.

---

* subversion/bindings/swig/svn_types.i: Add a typemap for
  svn_node_kind_t *, so svn_fs_check_path() is correctly bridged to
  Python.

Index: subversion/bindings/swig/svn_types.i
===================================================================
--- subversion/bindings/swig/svn_types.i        (revision 5607)
+++ subversion/bindings/swig/svn_types.i        (working copy)
@@ -103,6 +103,13 @@
 */
 %apply long *OUTPUT { svn_revnum_t * };
 
+/* -----------------------------------------------------------------------
+   'svn_node_kind_t *' will always be an OUTPUT parameter.  (The
+   enumerated type is cast to a long before being passed to
+   PyInt_AsLong.)
+*/
+%apply long *OUTPUT { svn_node_kind_t * };
+
 /* ----------------------------------------------------------------------- */
 
 /* Define an OUTPUT typemap for 'svn_filesize_t *'.  For now, we'll

-- 
=Nicholas Riley <nj...@uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
        Pablo Research Group, Department of Computer Science and
  Medical Scholars Program, University of Illinois at Urbana-Champaign

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

Re: [PATCH] Fix SWIG binding for svn_node_kind_t * (used in ViewCVS)

Posted by Sander Roobol <ph...@wanadoo.nl>.
Filed as issue #1263.

Sander`

On Sun, Apr 13, 2003 at 02:32:05AM -0500, Nicholas Riley wrote:
> On Sun, Apr 13, 2003 at 02:27:15AM -0500, Nicholas Riley wrote:
> > +   PyInt_AsLong.)
>       ^^^^^^^^^^^^
> 
> Er, this should be PyInt_FromLong.  *sigh*
> 
> -- 
> =Nicholas Riley <nj...@uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
>         Pablo Research Group, Department of Computer Science and
>   Medical Scholars Program, University of Illinois at Urbana-Champaign
> 
> ---------------------------------------------------------------------
> 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

Re: [PATCH] Fix SWIG binding for svn_node_kind_t * (used in ViewCVS)

Posted by Nicholas Riley <nj...@uiuc.edu>.
On Sun, Apr 13, 2003 at 02:27:15AM -0500, Nicholas Riley wrote:
> +   PyInt_AsLong.)
      ^^^^^^^^^^^^

Er, this should be PyInt_FromLong.  *sigh*

-- 
=Nicholas Riley <nj...@uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
        Pablo Research Group, Department of Computer Science and
  Medical Scholars Program, University of Illinois at Urbana-Champaign

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