2005-09-14 [paul] 1.9.14cvs26
[claws.git] / src / common / socket.h
index 2f0cbd9c932d958e3d69642fca0c4c140b2b76fa..75136fd159ec39e521607fee90173701920ddb22 100644 (file)
@@ -25,7 +25,9 @@
 #endif
 
 #include <glib.h>
-#include <netdb.h>
+#if HAVE_NETDB_H
+#  include <netdb.h>
+#endif
 
 typedef struct _SockInfo       SockInfo;
 
@@ -40,7 +42,7 @@ typedef enum
        CONN_ESTABLISHED,
        CONN_LOOKUPFAILED,
        CONN_FAILED,
-       CONN_DISCONNECTED,
+       CONN_DISCONNECTED
 } ConnectionState;
 
 typedef gint (*SockConnectFunc)                (SockInfo       *sock,
@@ -67,6 +69,9 @@ struct _SockInfo
        GIOCondition condition;
 };
 
+gint sock_init                         (void);
+gint sock_cleanup                      (void);
+
 gint sock_set_io_timeout               (guint sec);
 
 gint sock_set_nonblocking_mode         (SockInfo *sock, gboolean nonblock);
@@ -79,9 +84,11 @@ struct hostent *my_gethostbyname     (const gchar *hostname);
 
 SockInfo *sock_connect                 (const gchar *hostname, gushort port);
 SockInfo *sock_connect_cmd             (const gchar *hostname, const gchar *tunnelcmd);
+#ifdef G_OS_UNIX
 gint sock_connect_async                        (const gchar *hostname, gushort port,
                                         SockConnectFunc func, gpointer data);
 gint sock_connect_async_cancel         (gint id);
+#endif
 
 /* Basic I/O functions */
 gint sock_printf       (SockInfo *sock, const gchar *format, ...)