[redland-dev] Wrong API with certain functions

Dave Beckett dave at dajobe.org
Mon Aug 4 22:32:25 EDT 2014


On 8/4/14, 5:58 AM, Victor Porton wrote:
> The API for raptor_iostream_write_bytes() function is wrongly documented. (The function itself is correct, just the documentation is wrong.)
> 
> There are similar issues also with
> 
> raptor_iostream_decimal_write()
> raptor_iostream_hexadecimal_write()
> 
> For the last two functions, it is unclear what should be changed, the functions themselves or their documentation.
> 
> See my bug report (Raptor 2.0.14) for details:
> 
> http://bugs.librdf.org/mantis/view.php?id=575
> 
> Please inform me about these two functions, whether we will change the functions themselves or just the documentation.
> 
> I need this information to continue writing my Ada binding for Raptor.

I replied in the bug:

The signatures were originally intended to match fwrite() which returns
number of objects. Hence why raptor_filename_iostream_write_bytes() just
casts it from fwrite(). Although that is bad since the signature of fwrite()
returns a size_t, so write_bytes() should have been defined that way.

Since raptor_iostream_decimal_write() and
raptor_iostream_hexadecimal_write() both call
raptor_filename_iostream_write_bytes() they are at least implemented the
same way even if the documentation doesn't match.

So I guess I'm considering it a documentation bug but I'm open to suggestions.

Dave



More information about the redland-dev mailing list