From: John B. <jo...@ma...> - 2003-11-04 22:55:18
|
> I'm gonna put out a new test release soon... we now have better error > checking.. you will be able to check and see if that datasource = failed > to open.. and you can see if execute failed... (from pdf and c) great, that's useful. > I have started python bindings.. which will allow for a more shell > scriptable rlib have you thought of wrapping rlib with SWIG http://www.swig.org/ That would give you library capability from: Tcl 8.0 and newer versions.=20 Python 1.5 and newer.=20 Perl 5.003 or newer.=20 Guile 1.3.4 and newer. Java JDK 1.1 and newer.=20 Ruby.=20 Mzscheme. and it's super easy give that you have a C api. > John.. do you have any more patches for me you want in for general > testing? Just that command line program, otherwise I didn't end up needing to = keep any changes I made. -john |
From: Bob D. <bd...@si...> - 2003-11-04 23:57:20
|
Damn.... swig looks really nice... I wish I saw that earlier... I'll go swig instead... so that way we can have tons of bindings ;) - Bob On Tue, 2003-11-04 at 17:55, John Buckman wrote: > have you thought of wrapping rlib with SWIG http://www.swig.org/ > > That would give you library capability from: > > Tcl 8.0 and newer versions. > Python 1.5 and newer. > Perl 5.003 or newer. > Guile 1.3.4 and newer. > Java JDK 1.1 and newer. > Ruby. > Mzscheme. > > and it's super easy give that you have a C api. > > > John.. do you have any more patches for me you want in for general > > testing? > > Just that command line program, otherwise I didn't end up needing to keep any changes I made. > > -john > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Rlib-users mailing list > Rli...@li... > https://lists.sourceforge.net/lists/listinfo/rlib-users > |
From: John B. <jo...@ma...> - 2003-11-05 00:02:55
|
> swig looks really nice... I wish I saw that earlier... I'll go swig > instead... so that way we can have tons of bindings ;) Yeah, I was one of the early developers on it, years and years ago. = Once you define the C bindings, it'll do everything else for you. The = only caveat is that it doesn't make crash-proof APIs (ie, no real = parameter checking) but for rlib, that should be fine. -john > - Bob > On Tue, 2003-11-04 at 17:55, John Buckman wrote: > > have you thought of wrapping rlib with SWIG http://www.swig.org/ > >=20 > > That would give you library capability from: > >=20 > > Tcl 8.0 and newer versions.=20 > > Python 1.5 and newer.=20 > > Perl 5.003 or newer.=20 > > Guile 1.3.4 and newer. > > Java JDK 1.1 and newer.=20 > > Ruby.=20 > > Mzscheme. > >=20 > > and it's super easy give that you have a C api. > >=20 > > > John.. do you have any more patches for me you want in for = general > > > testing? > >=20 > > Just that command line program, otherwise I didn't end up needing = to keep any changes > I made. > >=20 > > -john > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This SF.net email is sponsored by: SF.net Giveback Program. > > Does SourceForge.net help you be more productive? Does it > > help you create better code? SHARE THE LOVE, and help us help > > YOU! Click Here: http://sourceforge.net/donate/ > > _______________________________________________ > > Rlib-users mailing list > > Rli...@li... > > https://lists.sourceforge.net/lists/listinfo/rlib-users > >=20 |
From: Bob D. <bd...@si...> - 2003-11-05 15:11:34
|
John you are my hero!!!! You saved me a whole hell of a lot of time This now works... and I assume the bindings will be just as easy in other languages :) #!/usr/bin/python2.2 import librlib; test = librlib.rlib_init(); res = librlib.rlib_add_datasource_mysql(test, "mysql", "localhost", "user", "password", "database"); librlib.rlib_add_query_as(test, "mysql", "select * from example", "example"); librlib.rlib_add_report(test, "report.xml", ""); librlib.rlib_set_output_format_from_text(test, "PDF"); librlib.rlib_execute(test); librlib.rlib_spool(test); librlib.rlib_free(test); - bob On Tue, 2003-11-04 at 19:02, John Buckman wrote: > > swig looks really nice... I wish I saw that earlier... I'll go swig > > instead... so that way we can have tons of bindings ;) > > Yeah, I was one of the early developers on it, years and years ago. Once you define the C bindings, it'll do everything else for you. The only caveat is that it doesn't make crash-proof APIs (ie, no real parameter checking) but for rlib, that should be fine. > > -john > > > > - Bob > > > On Tue, 2003-11-04 at 17:55, John Buckman wrote: > > > have you thought of wrapping rlib with SWIG http://www.swig.org/ > > > > > > That would give you library capability from: > > > > > > Tcl 8.0 and newer versions. > > > Python 1.5 and newer. > > > Perl 5.003 or newer. > > > Guile 1.3.4 and newer. > > > Java JDK 1.1 and newer. > > > Ruby. > > > Mzscheme. > > > > > > and it's super easy give that you have a C api. > > > |
From: John B. <jo...@ma...> - 2003-11-05 16:00:23
|
> John you are my hero!!!! > You saved me a whole hell of a lot of time > This now works... and I assume the bindings will be just as easy in > other languages :) Yes, because your normal api is a very thin shim on top of your C api, = all the languages will work the same way, with exactly the same api. = Makes documenting really easy too. I see that you added rlib_set_output_format_from_text() so as to get = rid of the ENUM -- that's the right way to do it. This isn't a big deal, but if you added two bools to the struct ("test" = below) you hold, with bool has_initialized; bool has_executed; then when rlib_add_datasource_mysql() is called, rlib_init(); could be = called automatically, and the same thing with spool() calling = execute(). Can one re-use a report object, or must it be freed after use? If it = has to be freed, then you might as well make spool() call free(). Another easy feature, that'd be convenient, and make your api cleaner, = would be a short-form call that does it all, namely: rlib_mysql_report("localhost", "user", "password", "database", "select = * from example", "PDF") that gets rid of the need to keep an object around, and thus worrying = about freeing memory. Memory leaking is probably my biggest worry = about embedding rlib in another language, so wrapping the entire report = request in a single stateless call gets rid of that. Also, I've = noticed that the biggest problem people have with getting rlib to work = is with the various api calls. Making this "short form" call the one = most people (at least initially) use would solve that. I can, of = course, write this call for you if you like, but it's a trivial piece = of C. -john > #!/usr/bin/python2.2 > import librlib; > test =3D librlib.rlib_init(); > res =3D librlib.rlib_add_datasource_mysql(test, "mysql", "localhost", > "user", "password", "database"); > librlib.rlib_add_query_as(test, "mysql", "select * from example", > "example"); > librlib.rlib_add_report(test, "report.xml", ""); > librlib.rlib_set_output_format_from_text(test, "PDF"); > librlib.rlib_execute(test); > librlib.rlib_spool(test); > librlib.rlib_free(test); > - bob > On Tue, 2003-11-04 at 19:02, John Buckman wrote: > > > swig looks really nice... I wish I saw that earlier... I'll go = swig > > > instead... so that way we can have tons of bindings ;) > >=20 > > Yeah, I was one of the early developers on it, years and years ago. = Once you define > the C bindings, it'll do everything else for you. The only caveat is = that it doesn't > make crash-proof APIs (ie, no real parameter checking) but for rlib, = that should be > fine. > >=20 |