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


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


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