[cairo] Implementing cairo_read_func_t/cairo_write_func_t properly

Bill Spitzak spitzak at gmail.com
Sat Jan 2 13:34:17 PST 2016


On 01/02/2016 01:27 PM, Bernhard Fischer wrote:
> On Saturday 02 January 2016 13:01:39 Bill Spitzak wrote:

>> I think the api has to be changed to return number of bytes read, and a
>> negative number for eof.
>
> The return value should be the number of bytes read and on eof it is something
> between 0 and length. If it is called again at/after eof it returns 0 again. A
> negative value (-1) is only returned in case of error (but not EOF). This is
> exactly like read(3) behaves.

Yes you are correct, I made a typo, I meant to say "error" where I wrote 
"eof". I fully agree with your description.




More information about the cairo mailing list