Minor comment improvements.

2008-08-21  Tor Lillqvist  <tml@novell.com>

	* glib/giowin32.c: Minor comment improvements.


svn path=/trunk/; revision=7382
This commit is contained in:
Tor Lillqvist 2008-08-21 11:24:00 +00:00 committed by Tor Lillqvist
parent 3edee5f639
commit 2da8893a72
2 changed files with 24 additions and 14 deletions

View File

@ -1,3 +1,7 @@
2008-08-21 Tor Lillqvist <tml@novell.com>
* glib/giowin32.c: Minor comment improvements.
2008-08-21 Tor Lillqvist <tml@novell.com> 2008-08-21 Tor Lillqvist <tml@novell.com>
* glib/gmain.c: Rework the g_poll() implementation on Windows to * glib/gmain.c: Rework the g_poll() implementation on Windows to

View File

@ -93,12 +93,16 @@ typedef struct _GIOWin32Watch GIOWin32Watch;
typedef enum { typedef enum {
G_IO_WIN32_WINDOWS_MESSAGES, /* Windows messages */ G_IO_WIN32_WINDOWS_MESSAGES, /* Windows messages */
G_IO_WIN32_FILE_DESC, /* Unix-like file descriptors from G_IO_WIN32_FILE_DESC, /* Unix-like file descriptors from
* _open() or _pipe(), except for console IO. * _open() or _pipe(), except for
* Have to create separate thread to read. * console IO. Separate thread to read
* or write.
*/ */
G_IO_WIN32_CONSOLE, /* Console IO (usually stdin, stdout, stderr) */ G_IO_WIN32_CONSOLE, /* Console IO (usually stdin, stdout, stderr) */
G_IO_WIN32_SOCKET /* Sockets. No separate thread */
G_IO_WIN32_SOCKET /* Sockets. No separate thread. */
} GIOWin32ChannelType; } GIOWin32ChannelType;
struct _GIOWin32Channel { struct _GIOWin32Channel {
@ -111,32 +115,34 @@ struct _GIOWin32Channel {
gboolean debug; gboolean debug;
/* This is used by G_IO_WIN32_WINDOWS_MESSAGES channels */ /* Field used by G_IO_WIN32_WINDOWS_MESSAGES channels */
HWND hwnd; /* handle of window, or NULL */ HWND hwnd; /* Handle of window, or NULL */
/* Following fields are used by fd channels. */ /* Fields used by G_IO_WIN32_FILE_DESC channels. */
CRITICAL_SECTION mutex; CRITICAL_SECTION mutex;
int direction; /* 0 means we read from it, int direction; /* 0 means we read from it,
* 1 means we write to it. * 1 means we write to it.
*/ */
gboolean running; /* Is reader thread running. FALSE if gboolean running; /* Is reader or writer thread
* EOF has been reached. * running. FALSE if EOF has been
* reached by the reader thread.
*/ */
gboolean needs_close; /* If the channel has been closed while gboolean needs_close; /* If the channel has been closed while
* the reader thread was still running. * the reader thread was still running.
*/ */
guint thread_id; /* If non-NULL has a reader thread, or has
* had.*/ guint thread_id; /* If non-NULL the channel has or has
* had a reader or writer thread.
*/
HANDLE data_avail_event; HANDLE data_avail_event;
gushort revents; gushort revents;
/* Following fields used by fd channels for input */
/* Data is kept in a circular buffer. To be able to distinguish between /* Data is kept in a circular buffer. To be able to distinguish between
* empty and full buffer, we cannot fill it completely, but have to * empty and full buffers, we cannot fill it completely, but have to
* leave a one character gap. * leave a one character gap.
* *
* Data available is between indexes rdp and wrp-1 (modulo BUFFER_SIZE). * Data available is between indexes rdp and wrp-1 (modulo BUFFER_SIZE).
@ -149,7 +155,7 @@ struct _GIOWin32Channel {
gint wrp, rdp; /* Buffer indices for writing and reading */ gint wrp, rdp; /* Buffer indices for writing and reading */
HANDLE space_avail_event; HANDLE space_avail_event;
/* Following fields used by socket channels */ /* Fields used by G_IO_WIN32_SOCKET channels */
int event_mask; int event_mask;
int last_events; int last_events;
HANDLE event; HANDLE event;