sort out some prototypes, put them where they belong.
[apps/madmutt.git] / lib-sys / mutt_ssl_gnutls.c
index a679048..7fc5eda 100644 (file)
 #include <gnutls/openssl.h>
 #endif
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-#include <lib-lib/rx.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/menu.h>
@@ -39,8 +35,8 @@ typedef struct _tlssockdata {
 } tlssockdata;
 
 /* local prototypes */
-static int tls_socket_read (CONNECTION * conn, char *buf, size_t len);
-static int tls_socket_write (CONNECTION * conn, const char *buf, size_t len);
+static int tls_socket_read (CONNECTION * conn, char *buf, ssize_t len);
+static int tls_socket_write (CONNECTION * conn, const char *buf, ssize_t len);
 static int tls_socket_open (CONNECTION * conn);
 static int tls_socket_close (CONNECTION * conn);
 static int tls_starttls_close (CONNECTION * conn);
@@ -82,7 +78,7 @@ int mutt_ssl_socket_setup (CONNECTION * conn)
   return 0;
 }
 
-static int tls_socket_read (CONNECTION * conn, char *buf, size_t len)
+static int tls_socket_read (CONNECTION * conn, char *buf, ssize_t len)
 {
   tlssockdata *data = conn->sockdata;
   int ret;
@@ -102,7 +98,7 @@ static int tls_socket_read (CONNECTION * conn, char *buf, size_t len)
   return ret;
 }
 
-static int tls_socket_write (CONNECTION * conn, const char *buf, size_t len)
+static int tls_socket_write (CONNECTION * conn, const char *buf, ssize_t len)
 {
   tlssockdata *data = conn->sockdata;
   int ret;
@@ -354,12 +350,12 @@ static void tls_fingerprint (gnutls_digest_algorithm algo,
                              char *s, int l, const gnutls_datum * data)
 {
   unsigned char md[36];
-  size_t n;
+  ssize_t n;
   int j;
 
   n = 36;
 
-  if (gnutls_fingerprint (algo, data, (char *) md, &n) < 0) {
+  if (gnutls_fingerprint(algo, data, (char *) md, &n) < 0) {
     snprintf (s, l, _("[unable to calculate]"));
   }
   else {
@@ -373,7 +369,7 @@ static void tls_fingerprint (gnutls_digest_algorithm algo,
   }
 }
 
-static char *tls_make_date (time_t t, char *s, size_t len)
+static char *tls_make_date (time_t t, char *s, ssize_t len)
 {
   struct tm *l = gmtime (&t);
 
@@ -393,7 +389,7 @@ static int tls_check_stored_hostname (const gnutls_datum * cert,
   char buf[80];
   FILE *fp;
   char *linestr = NULL;
-  size_t linestrsize;
+  ssize_t linestrsize;
   int linenum = 0;
   regex_t preg;
   regmatch_t pmatch[3];
@@ -442,7 +438,7 @@ static int tls_check_certificate (CONNECTION * conn)
   char helpstr[SHORT_STRING];
   char buf[SHORT_STRING];
   char fpbuf[SHORT_STRING];
-  size_t buflen;
+  ssize_t buflen;
   char dn_common_name[SHORT_STRING];
   char dn_email[SHORT_STRING];
   char dn_organization[SHORT_STRING];