2008/7/21 Marc Vaillant <vaillant@...>:
> On Mon, Jul 21, 2008 at 10:27:35AM -0700, Yongwei Wu wrote:
>> 2008/7/21 Marc Vaillant <vaillant@...>:
>> > Hi,
>> > I'm wondering if there is an equivalent to funopen (available on BSD
>> > systems) for mingw? funopen lets you create custom file streams by
>> > creating a FILE* that's associated to callback functions. E.g., this
>> > would be very helpful for porting apps that use BSD sockets to winsock.
>> MinGW is not a POSIX layer (which Cygwin is), and does not support
>> such things in general. On the other hand, funopen is declared in
>> Cygwin's stdio.h, so it should be usable there.
> FILE* is ANSI C not POSIX so I'm not sure what you are necessarily tying
> it to POSIX compliance?
I made a mistake in assuming funopen was POSIX. It seems not the
> I realize that funopen is not part of the any standard C API,
That was what I meant. MinGW supports standard C89, some C99, and
Win32. It does not support, in general, UNIX/POSIX APIs.
> I'm just looking for an API that does something similar.
No idea. You may start by looking at the source code of the Cygwin
funopen implementation. There should be no patents enforceable:-).