fmemopen
Roland McGrath
roland@redhat.com
Wed Mar 9 05:17:00 GMT 2005
> 1. I wanted it to work on BSD systems which do not have fopencookie.
> They have funopen, which is completely equivalent.
If you want something portable, then you should not assume you can diddle
with the stdio buffer directly at all.
> 2. the "output" area should be extensible instead of requiring
> a presupposed maximum size
Use open_memstream.
> 3. It ought to be possible to obtain the current buffer address
> without requiring that the client allocate stable storage for
> the information. The client need only track the FILE* pointer.
This is outside the scope of the cookie-style interface, which explicitly
knows nothing about stdio internals like its buffers.
> 4. The original implementation assumed the buffer had to be a
> NUL terminated string. I assume binary data if the "b" flag
> is in the open mode string.
There is no content constraint on open_memstream's streams.
More information about the Libc-alpha
mailing list