[redland-dev] Librdf Parser API (str, len)

Steve Shepard steveshepard at mac.com
Tue Jul 27 21:24:29 BST 2004


The librdf parser API provides

REDLAND_API int librdf_parser_parse_string_into_model(librdf_parser* 
parser, const unsigned char *string, librdf_uri* base_uri, 
librdf_model* model);

for in-memory parsing.  The problem is that it requires a 
null-terminated string.  How about a variant

REDLAND_API int librdf_parser_parse_string_into_model(librdf_parser* 
parser, const unsigned char *string, size_t strlen, librdf_uri* 
base_uri, librdf_model* model);

This is useful when

* you don't have a null terminated string (as often happens when you 
are parsing chunks of a larger file).

* you only want to parse a section of a larger const string.

Both raptor and libxml provide API for this.

-Steve




More information about the redland-dev mailing list