From: Marc V. <vai...@fa...> - 2008-07-21 17:55:59
|
On Mon, Jul 21, 2008 at 10:27:35AM -0700, Yongwei Wu wrote: > 2008/7/21 Marc Vaillant <vai...@fa...>: > > 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 realize that funopen is not part of the any standard C API, I'm just looking for an API that does something similar. > > If the Cygwin licence (GPL or pay money) is OK for you, it may be a > good idea to use Cygwin instead of MinGW. Otherwise (or in the case > you do not want a POSIX middle layer), you should port your program to > use only the standard C API or the Win32 API. I'm not interested in a POSIX middle layer. Thanks, Marc |