/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
typedef struct _SockInfo SockInfo;
-#if USE_SSL
+#if USE_OPENSSL
# include "ssl.h"
#endif
CONN_LOOKUPSUCCESS,
CONN_ESTABLISHED,
CONN_LOOKUPFAILED,
- CONN_FAILED
+ CONN_FAILED,
+ CONN_DISCONNECTED,
} ConnectionState;
struct _SockInfo
gushort port;
ConnectionState state;
gpointer data;
-#if USE_SSL
+#if USE_OPENSSL
SSL *ssl;
#endif
};
G_GNUC_PRINTF(2, 3);
gint sock_read (SockInfo *sock, gchar *buf, gint len);
gint sock_write (SockInfo *sock, const gchar *buf, gint len);
+gint sock_write_all (SockInfo *sock, const gchar *buf, gint len);
gint sock_gets (SockInfo *sock, gchar *buf, gint len);
gchar *sock_getline (SockInfo *sock);
gint sock_puts (SockInfo *sock, const gchar *buf);
gint fd_read (gint sock, gchar *buf, gint len);
gint fd_write (gint sock, const gchar *buf, gint len);
+gint fd_write_all (gint sock, const gchar *buf, gint len);
gint fd_gets (gint sock, gchar *buf, gint len);
-gchar *fd_getline (gint sock);
+gint fd_getline (gint sock, gchar **str);
gint fd_close (gint sock);
/* Functions for SSL */
-#if USE_SSL
-gint ssl_read(SSL *ssl, gchar *buf, gint len);
-gint ssl_write(SSL *ssl, const gchar *buf, gint len);
-gint ssl_gets(SSL *ssl, gchar *buf, gint len);
-gchar *ssl_getline(SSL *ssl);
+#if USE_OPENSSL
+gint ssl_read (SSL *ssl, gchar *buf, gint len);
+gint ssl_write (SSL *ssl, const gchar *buf, gint len);
+gint ssl_write_all (SSL *ssl, const gchar *buf, gint len);
+gint ssl_gets (SSL *ssl, gchar *buf, gint len);
+gchar *ssl_getline (SSL *ssl);
#endif
#endif /* __SOCKET_H__ */