I need a Java API (Re: XML-RPC interface)
Jack Greenbaum
j.greenbaum@computer.org
Sun, 14 Oct 2001 19:18:52 -0700
Linas Vepstas wrote:
> I beleive the 'hard part' will be making swig work.
Indeed. I was able to get your perl examples working from the gnucash-1.6.4 source
distribution, the files you sent, SWIG 1.3.9, and Perl 5.003 with the following
caveats:
* I had to add back the -Dbool=char CFLAGS arg to compile the SWIG output files
* I had to add a typemap for input gboolean (not gboolean *) in perl5_typemaps.i:
%typemap(perl5, in) gboolean (int temp) {
/* Convert function arguments from perl to the C representation */
/* in particular, convert perl scalar into integer, then cast to type */
temp = (int) SvIV($source);
$target = &temp;
// printf ("Info: gboolean input arg is %ld \n", * ($target));
}
> In particular, you'll need to do things like write the swig wrapper to
> convert glib linked lists into whatever it is that Java uses for
> sequences/lists.
Yeah, that should be fun. I'll get back to it next weekend, at least I've reproduced
the perl examples so I have at least something to start from. I was able to generate
the java interface with only errors on long longs, but haven't tried any of it yet.
> > I need to be
> > building from CVS.
>
> Only because the swig code isn't in the gnucash-1.6.4-source-tar,gz file.
> I will attach the swig code to this email.
>
> Otherwise I recomment working from the 1.6.4. source tar file, rather
> than from the current CVS. This is because the CVS code is changing
> daily, and is quite unstable, and could lead to considerable unhappines
> on your part.
Yeah, I'd rather work from a stable source base and port later.
> In order to make sure that your efforts are not 'wasted', I strongly
> suggest sending in patches as you get each piece of the java bindings
> working. You don't have to get everything working perfectly before
> sending in a patch.
Should I send in diffs from the source you sent?
Thanks for getting me started.
-- Jack Greenbaum