Raptor RDF Syntax Parsing and Serializing Library Manual |
---|
There are several other callback handlers that can be set on parsers. These can be set any time before parsing is called. Errors and warnings from parsing can be returned with functions that all take a callback of type raptor_message_handler and signature:
void message_handler(void *user_data, raptor_locator* locator, const char *message) { /* do something with the message */ }
returning the user data given, associated location information as a raptor_locator and the error/warning message itself. The locator structure contains full information on the details of where in the file or URI the message occurred.
The fatal error, error and warning handlers are all set with similar functions that take a handler as follows:
raptor_set_fatal_error_handler(rdf_parser, user_data, fatal_handler); raptor_set_error_handler(rdf_parser, user_data, error_handler); raptor_set_warning_handler(rdf_parser, user_data, warning_handler);
abort()
if the fatal error handler returns.
Navigation: Redland Home Page