This is the mail archive of the libc-alpha@sources.redhat.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]
Other format: [Raw text]

Re: fmemopen


> 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.


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