mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-30 13:53:30 +02:00
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:
@@ -206,5 +206,32 @@ g_io_error_from_errno (gint err_no)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
/**
|
||||
* g_io_error_from_win32_error:
|
||||
* @error_code: Windows error number.
|
||||
*
|
||||
* Converts some common error codes into GIO error codes. The
|
||||
* fallback value G_IO_ERROR_FAILED is returned for error codes not
|
||||
* handled.
|
||||
*
|
||||
* Returns: #GIOErrorEnum value for the given error number.
|
||||
*
|
||||
* Since: 2.26
|
||||
**/
|
||||
GIOErrorEnum
|
||||
g_io_error_from_win32_error (gint error_code)
|
||||
{
|
||||
switch (error_code)
|
||||
{
|
||||
default:
|
||||
return G_IO_ERROR_FAILED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define __G_IO_ERROR_C__
|
||||
#include "gioaliasdef.c"
|
||||
|
Reference in New Issue
Block a user