[redland-dev] API change proposal: raptor_uri_handlers, rdf_concepts

Dave Beckett dave at dajobe.org
Fri Nov 9 17:18:26 GMT 2007


On Wed, 7 Nov 2007, Lauri Aalto wrote:
> I propose two relatively small API changes to Raptor
> raptor_uri_handlers and librdf rdf_concepts.
>
> If nobody screams, I will submit these changes to svn.librdf.org
> repository soonish, let's say next week. (I have the changes already
> in my private development branch.)
>
> Motivation for both source compatibility breaks is the same: moving
> Redland libraries to re-entrant direction with no writable (non-const)
> static data.
>
>
> 1. const raptor_uri_handler
>
> Raptor currently has no need to touch raptor_uri_handler structs
> passed to it. raptor_uri_handlers should be flagged as const in the
> API to enforce compile-time constness checking and to avoid casting
> const data to non-const.
>
> This would change raptor_uri_handler argument to const
> raptor_uri_handler in the following 5 raptor.h public functions:
>
> raptor_uri_set_handler()
> raptor_uri_get_handler()
> raptor_new_namespaces()
> raptor_namespaces_init()
> raptor_new_xml_writer()

This change will have to be reverted since a writable uri handler
is needed to handle the change to the structure to add the uri_compare
factory method.

> 2. rdf_concepts
>
> All non-const static data should be moved from rdf_concepts.c to
> librdf_world struct. Accessing it would require changes to all public
> API macros in rdf_concepts.h - practically they need a pointer to a
> librdf_world object. For example:
>
>  #define LIBRDF_MS_Alt librdf_concept_resources[LIBRDF_CONCEPT_MS_Alt]
>
> would change to
>
>  #define LIBRDF_MS_Alt(world) world->concept_resources[LIBRDF_CONCEPT_MS_Alt]
>
> (The underlying change would also fix
> http://bugs.librdf.org/mantis/view.php?id=213 in a better way.)

This one is OK by me.  I bet this isn't widely known/used.

Dave



More information about the redland-dev mailing list