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

Breakthrough on Java bindings - SWIG approach

From: <jesper_at_selskabet.org>
Date: 2003-01-29 23:55:30 CET

Just a bit of good news!

Please consider the following bit of code:

import org.tigris.subversion.swig.jni.*;

public class Test
   public static void main(java.lang.String[] args)

     System.out.println(Allocating pool);
     SWIGTYPE_p_apr_pool_t pool = util.svn_pool_create(null);

     System.out.println(calling mkdir);
     svn_client.svn_client_mkdir(null, test, null, null, null, pool);

     System.out.println(destroying pool);


This minimal example now actually runs and works on Win32 (haven't tried
Linux), and added a test directory to my working copy.

It took a whole lot more SWIG knowledge than I had originally
anticipated, but I'm willing to admit that the SWIG way IS easier than
going the whole nine yards.

(The point here is that SWIG/Java is very different than SWIG/Python
since Java is staticly typed, and SWIG has special constructs for that.
I was chasing up several wrong trees like t_output_helper, which is a

But, long ways to go until a patch is ready... Anyone interested may get
a snapshot from me

Still needed:
- Mapping of arrays (other than string)
- Mapping of hashes
- Mapping of byte regions, svn_string_t, svn_stringbuf_t
- Mapping of apr_file_t
- A zillion things must/should/might be ignored/hidden from SWIG
- SVN Error - Java Exception mapping (it currently works, but is quite
- A zillion typedefs (like apr_int32_t ...)
- Invocation of callback interfaces.
- High level class interfaces (!!)
- New client context stuff?
- Tests, tests, tests
- Regression test Python bindings
- Build environment on Win32 and Unix (my autoconf knowledge is

I'll start of svn_client.h


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 14 02:24:31 2006

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.