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

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

From: Nicholas Riley <njriley_at_uiuc.edu>
Date: 2003-04-13 09:27:15 CEST


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:


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


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
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 <njriley_at_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
Received on Sun Apr 13 09:28:15 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.