fmemopen
Bruce Korb
bkorb@veritas.com
Tue Mar 8 14:50:00 GMT 2005
Roland McGrath wrote:
>
> It's pretty hard to figure out what you really want.
> You seem to fundamentally misunderstand what fmemopen does.
Sorry if I was unclear. I do, indeed, understand what it does.
It did not do quite what I needed, so I rewrote it to do so
on top of either fopencookie (GNU) or on top of funopen (BSD).
I would like it to be able to behave exactly as the current
version behaves, but to switch between behaviors I would need
to tell it to behave one way or another. How do you do that?
You can't. Leastwise, not very well. I know I can recast the
"FILE*" pointer into the specialized structure that contains
the cookie, but that structure belongs to the fopencookie code
and is not exported. "fcookie" (or whatever you might want to
call it) would be the "method" for obtaining the cookie from the
FILE* pointer. Another mechanism might be "fcookieioctl" (or
another name). Or, finally, overloading "fseek" and allowing
through non-standard direction codes. (unclean, but it would
work.)
More information about the Libc-alpha
mailing list