This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

small doc-bugs in fopencookie() (Re: fmemopen implementation)


> As part of a bug report, Hanno send us a implementation of fmemopen.


I'd like to report three small documentation bugs in the cookie type
definiton for the fopencookie() hook functions as well:


* The READER and WRITER functions are implemented using a char* buffer
parameter, but the documentation describes a void* buffer. (The latter
seems to make more sense to me.)


* The SEEKER function behaves completely different than described in the
documentation.

The doc says:

	int SEEKER (void *COOKIE, fpos_t *POSITION, int WHENCE)

	- POSITION is used to return the actual absolute file position
          after seeking
	- the return value is used to report success (0) or failure (-1)

But the actual implementation is:

	int SEEKER (void *COOKIE, fpos_t POSITION, int WHENCE)

	- the return value reports the actual absolute file position
	  after seeking (>=0) or failure (-1)

There's nothing wrong with that, but shouldn't the return type be fpos_t?


Greetings,

Hanno



P.S.: I have written a fopenblob() function for my own use, it is similar
to fmemopen() except that it doesn't add the string specific null byte
character when writing. Let me know if you're interested.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]