rationnalize includes a lot:
[apps/madmutt.git] / lib-mime / rfc2047.c
index 4900d7c..208d932 100644 (file)
  * please see the file GPL in the top level source directory.
  */
 
  * please see the file GPL in the top level source directory.
  */
 
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-#include <lib-lib/ascii.h>
+#include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 
 #include "charset.h"
 #include "thread.h"
 
 
 #include <lib-mime/mime.h>
 
 #include "charset.h"
 #include "thread.h"
 
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
 /* If you are debugging this file, comment out the following line. */
 /*#define NDEBUG*/
 
 /* If you are debugging this file, comment out the following line. */
 /*#define NDEBUG*/
 
@@ -73,7 +64,7 @@ convert_string(const char *from, const char *f, ssize_t flen,
 
     cd = mutt_iconv_open(to, from, 0);
 
 
     cd = mutt_iconv_open(to, from, 0);
 
-    if (cd == (iconv_t)(-1))
+    if (cd == MUTT_ICONV_ERROR)
         return -1;
 
     obl = 4 * flen + 1;
         return -1;
 
     obl = 4 * flen + 1;
@@ -157,7 +148,7 @@ char *mutt_choose_charset(const char *fromcode, const char *charsets,
             p_delete(&res);
         }
 
             p_delete(&res);
         }
 
-        mutt_canonical_charset(buf, sizeof(buf), tocode);
+        charset_canonicalize(buf, sizeof(buf), tocode);
         m_strreplace(&tocode, buf);
     }
 
         m_strreplace(&tocode, buf);
     }
 
@@ -271,7 +262,7 @@ static size_t try_block(const char *d, ssize_t dlen,
         ssize_t ibl = dlen;
         iconv_t cd = mutt_iconv_open(tocode, fromcode, 0);
 
         ssize_t ibl = dlen;
         iconv_t cd = mutt_iconv_open(tocode, fromcode, 0);
 
-        assert (cd != (iconv_t)(-1));
+        assert (cd != MUTT_ICONV_ERROR);
 
         ob = buf1;
 
 
         ob = buf1;
 
@@ -338,7 +329,7 @@ encode_block(char *s, char *d, ssize_t dlen,
 
     if (fromcode) {
         cd = mutt_iconv_open(tocode, fromcode, 0);
 
     if (fromcode) {
         cd = mutt_iconv_open(tocode, fromcode, 0);
-        assert (cd != (iconv_t) (-1));
+        assert (cd != MUTT_ICONV_ERROR);
         ib = d, ibl = dlen, ob = buf1, obl = sizeof(buf1) - m_strlen(tocode);
         n1 = my_iconv(cd, &ib, &ibl, &ob, &obl);
         n2 = my_iconv(cd, 0, 0, &ob, &obl);
         ib = d, ibl = dlen, ob = buf1, obl = sizeof(buf1) - m_strlen(tocode);
         n1 = my_iconv(cd, &ib, &ibl, &ob, &obl);
         n2 = my_iconv(cd, 0, 0, &ob, &obl);
@@ -564,7 +555,7 @@ static int rfc2047_encode(const char *d, ssize_t dlen, int col,
 }
 
 
 }
 
 
-void _rfc2047_encode_string(char **pd, int encode_specials, int col)
+static void _rfc2047_encode_string(char **pd, int encode_specials, int col)
 {
     char *e;
     ssize_t elen;
 {
     char *e;
     ssize_t elen;