Add GWin32InputStream and GWin32OutputStream classes

Correspond to GUnixInputStream and GUnixOutputStream. No true async
support though. But that is how the Win32 API is, for files not
explicitly opened for so-called overlapped IO.

The API to create these streams takes Win32 HANDLEs. Not file
descriptors, because file descriptors are specific to the C library
used. The user code and GLib might be using different C libraries.

Also add a test program for the new classes, and a gio-windows-2.0.pc
file.
This commit is contained in:
Tor Lillqvist
2010-04-19 11:32:05 +03:00
parent 48cd4cbba5
commit 9af8b83211
15 changed files with 1265 additions and 1 deletions

View File

@@ -47,6 +47,10 @@ if OS_UNIX
TEST_PROGS += live-g-file desktop-app-info unix-fd #unix-streams
endif
if OS_WIN32
TEST_PROGS += win32-streams
endif
memory_input_stream_SOURCES = memory-input-stream.c
memory_input_stream_LDADD = $(progs_ldadd)
@@ -90,6 +94,10 @@ unix_streams_SOURCES = unix-streams.c
unix_streams_LDADD = $(progs_ldadd) \
$(top_builddir)/gthread/libgthread-2.0.la
win32_streams_SOURCES = win32-streams.c
win32_streams_LDADD = $(progs_ldadd) \
$(top_builddir)/gthread/libgthread-2.0.la
unix_fd_SOURCES = unix-fd.c
unix_fd_LDADD = $(progs_ldadd)