[redland-dev] [patch] librdf_stream_get_context
laalto at gmail.com
Mon May 5 09:53:25 BST 2008
Thank you for the question and patch.
On Fri, May 2, 2008 at 1:58 PM, Michael Stahl <Michael.Stahl at sun.com> wrote:
> so, i noticed that librdf_stream_get_context returns a void*... why?
I don't really know.
I'd guess it comes from the fact that the underlying stream callback
get_method returns a void* as it will return librdf_statement* or
librdf_node*, depending on the flags passed in. That makes it easy to
use void*s internally and transfer the burden of type casting to
librdf_stream inherits its core design from librdf_iterator. According
to svn logs, latest significant changes to that design are from 2002.
> imho it should return librdf_node* instead.
> patch is attached.
Agree, returing librdf_node* makes sense. However, it would introduce
a slight API break and would not bring much benefit as such. I'd like
to hear dajobe's take on this issue.
The patch itself is not sufficient:
- prototypes in rdf_stream.h are not changed
- should keep rdf_stream consistent with rdf_iterator -> patch
rdf_iterator.[ch] as well
More information about the redland-dev