aboutsummaryrefslogtreecommitdiff
path: root/libsylph/socket.h
diff options
context:
space:
mode:
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;