aboutsummaryrefslogtreecommitdiff
path: root/libsylph/socket.h
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-01-22 08:10:11 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-01-22 08:10:11 +0000
commit2a1835bfa4813590131f9da2d511bbbcdad15717 (patch)
tree73c58f4ac769cbe75554408d655dfde5bc1071fa /libsylph/socket.h
parent3145665c922ead3c2de272eb0ad54c30c228046b (diff)
prevented WSAEWOULDBLOCK on sending/receiving in Win32.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1500 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/socket.h')
-rw-r--r--libsylph/socket.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/libsylph/socket.h b/libsylph/socket.h
index aaa6b895..384f61a4 100644
--- a/libsylph/socket.h
+++ b/libsylph/socket.h
@@ -1,6 +1,6 @@
/*
* LibSylph -- E-Mail client library
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2007 Hiroyuki Yamamoto
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -44,6 +44,17 @@ typedef enum
CONN_FAILED
} ConnectionState;
+typedef enum
+{
+ SOCK_NONBLOCK = 1 << 0,
+ SOCK_CHECK_IO = 1 << 1
+} SockFlags;
+
+#define SOCK_SET_FLAGS(flags, set) { (flags) |= (set); }
+#define SOCK_UNSET_FLAGS(flags, set) { (flags) &= ~(set); }
+#define SOCK_IS_NONBLOCK(flags) ((flags & SOCK_NONBLOCK) != 0)
+#define SOCK_IS_CHECK_IO(flags) ((flags & SOCK_CHECK_IO) != 0)
+
typedef gint (*SockConnectFunc) (SockInfo *sock,
gpointer data);
typedef gboolean (*SockFunc) (SockInfo *sock,
@@ -63,7 +74,7 @@ struct _SockInfo
gchar *hostname;
gushort port;
ConnectionState state;
- gboolean nonblock;
+ SockFlags flags;
gpointer data;
SockFunc callback;