[redland-dev] Redland for Revolution & questions
rodney tamblyn
rodney at stonebow.otago.ac.nz
Thu Oct 14 11:58:26 BST 2004
Hi everyone,
Together with a fellow student (Noel Garside) here I've been working on
porting Redland to a set of DLLs so they can be called from Runtime
Revolution (Rev) programming environment (http://www.runrev.com). The
DLLs include Rev glue and wrapper code allowing callbacks, exchange of
variables, and exposing of the Redland API within the Rev scripting
environment. Things have been going pretty well, we've got Redland
compiling fine under Windows, including the extra header files and glue
files to expose wrapped Redland functions within Revolution. Once
everythings going fine on Windows we'll take a look at doing same on
OSX.
I'm going to use Redland as part of research project I'm working on to
create a collaborative image annotation application for use in medical
teaching settings.
So far we've been able to create a world, storage object (memory) and
model, parse in a URI, add statements, and print out a model (using
librdf_model_print).
At the moment I have a problem which I'm hoping list members may be
able to help with. If I create a memory storage I'm able to complete
the example above successfully. However if change the storage params
to create a hashes database, and repeat, the persistent database is
created successfully on disk, but Rev crashes when calling
librdf_model_print. I've also tried creating a serializer and calling
serializer_print_model_to_file with same results. Executing the same
code directly from C as a compiled application (eg example1.exe) runs
fine.
If I create an example which just reads a model from a hashes database
on disk, and feed it the database created by Rev, it prints the model
out fine. This shows that there's nothing wrong with the model, or
storage, but there's something going on in the serializer when called
from Rev. I think what may be happening is that the serializer is
raising an error, but I have not implemented an error callback message
(world_set_error). Perhaps this is then returning control from the
external to Rev in such a way as to cause an memory exception error.
I'm pretty new to C programming (although very experienced in scripting
environments) so I'm hoping someone kind could provide some C examples
showing:
- an example "hello world" redland error handling function - this could
for example just print the error to stderr
- code to setup this function (i.e appropriate syntax to configure this
via world_set_error)
- ideally, and example which will cause an error (so that I can test
this is working correctly).
I can then modify the example to send callback messages to Revolution
when errors are raised. Once I've got error reporting working for the
above, I'll implement functions for serializer_set_error and
serializer_set_warning as this is where I think my problem is.
A couple more questions:
1) - if an error occurs and world_set_error has not been set, what
happens?
2) - are warnings and logger actually utilized in the library? I
notice quite a lot of messages being written to stdout and stderr, and
just wondered if these shouldn't more appropriately be sent to the
logger?
Thanks for help and suggestions in advance.
~ Rodney
--
Rodney Tamblyn
44 Melville Street
Dunedin
New Zealand
+64 3 4778606
http://rodney.buzzword.com/
http://oceanbrowser.com
More information about the redland-dev
mailing list