[redland-dev] [Raptor RDF Syntax Library 0000575]: Wrong API or wrong API documentation

Mantis Bug Tracker mantis-bug-sender at librdf.org
Sun Aug 3 17:16:34 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=575 
====================================================================== 
Reported By:                porton
Assigned To:                
====================================================================== 
Project:                    Raptor RDF Syntax Library
Issue ID:                   575
Category:                   api
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Syntax Name:                 
====================================================================== 
Date Submitted:             2014-08-03 21:16
Last Modified:              2014-08-03 21:16
====================================================================== 
Summary:                    Wrong API or wrong API documentation
Description: 
As it is clear from the following source code:

[[[[
int
raptor_iostream_write_bytes(const void *ptr, size_t size, size_t nmemb,
                            raptor_iostream *iostr)
{
  int nobj;
  
  if(iostr->flags & RAPTOR_IOSTREAM_FLAGS_EOF)
    return -1;
  if(!iostr->handler->write_bytes)
    return -1;
  if(!(iostr->mode & RAPTOR_IOSTREAM_MODE_WRITE))
    return -1;

  nobj = iostr->handler->write_bytes(iostr->user_data, ptr, size, nmemb);
  if(nobj > 0)
    iostr->offset += (size * nobj);

  return nobj;
}
]]]]

raptor_iostream_write_bytes() returns the same value as
raptor_iostream_write_bytes_func callback handler.

But the return values for these two are documented differently. This is a
contradiction between the API and its documentation:

raptor_iostream_write_bytes() - Returns: number of objects actually written,
which may be less than nmemb. <0 on failure
raptor_iostream_write_bytes_func - Returns: non-0 on failure.

I refer to this page: http://librdf.org/raptor/api/raptor2-section-iostream.html
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-08-03 21:16 porton         New Issue                                    
======================================================================



More information about the redland-dev mailing list