[redland-dev] Wrong API with certain functions
Victor Porton
porton at narod.ru
Tue Aug 5 06:55:49 EDT 2014
05.08.2014, 05:32, "Dave Beckett" <dave at dajobe.org>:
> 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.
What "are at least implemented the same way" means?
Should I assume that raptor_iostream_decimal_write() and raptor_iostream_hexadecimal_write() return the number of bytes written? (It seems quite useless for me to receive the number of bytes here.)
> So I guess I'm considering it a documentation bug but I'm open to suggestions.
>
> Dave
--
Victor Porton - http://portonvictor.org
More information about the redland-dev
mailing list