rework includes a bit
authorPierre Habouzit <madcoder@debian.org>
Mon, 13 Nov 2006 21:53:47 +0000 (22:53 +0100)
committerPierre Habouzit <madcoder@debian.org>
Mon, 13 Nov 2006 21:53:47 +0000 (22:53 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
31 files changed:
alias.c
cflags.mk
charset.c
charset.h
commands.c
compose.c
globals.h
hcache.c
hdrline.c
headers.c
help.c
hook.c
init.c
lib-crypt/crypt-gpgme.c
lib-crypt/crypt.c
lib-crypt/smime.c
lib-mime/rfc2231.c
lib-mime/rfc822parse.c
lib-ui/curs_main.c
lib-ui/enter.c
main.c
mutt.h
muttlib.c
pager.c
pattern.c
query.c
recvcmd.c
send.c
sidebar.c
sort.c
thread.h

diff --git a/alias.c b/alias.c
index 8128587..1500dbc 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -47,6 +47,7 @@
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
+#include "alias.h"
 #include "mutt_idna.h"
 #include "sort.h"
 
 #include "mutt_idna.h"
 #include "sort.h"
 
index 257b851..911a0b4 100644 (file)
--- a/cflags.mk
+++ b/cflags.mk
@@ -44,4 +44,4 @@ CFLAGS += -Wpointer-arith
 # warn about multiple declarations
 CFLAGS += -Wredundant-decls
 # warn if the format string is not a string literal
 # warn about multiple declarations
 CFLAGS += -Wredundant-decls
 # warn if the format string is not a string literal
-CFLAGS += -Wformat-nonliteral
+#CFLAGS += -Wformat-nonliteral
index 0652ffc..bf56607 100644 (file)
--- a/charset.c
+++ b/charset.c
 #include "mutt.h"
 #include "charset.h"
 
 #include "mutt.h"
 #include "charset.h"
 
-
 #ifndef EILSEQ
 # define EILSEQ EINVAL
 #endif
 
 #ifndef EILSEQ
 # define EILSEQ EINVAL
 #endif
 
+char *Charset;
 int Charset_is_utf8 = 0;
 
 /* 
 int Charset_is_utf8 = 0;
 
 /* 
@@ -47,172 +47,136 @@ int Charset_is_utf8 = 0;
  */
 
 static struct {
  */
 
 static struct {
-  const char *key;
-  const char *pref;
+    const char *key;
+    const char *pref;
 } PreferredMIMENames[] = {
 } PreferredMIMENames[] = {
-  {
-  "ansi_x3.4-1968", "us-ascii"}, {
-  "iso-ir-6", "us-ascii"}, {
-  "iso_646.irv:1991", "us-ascii"}, {
-  "ascii", "us-ascii"}, {
-  "iso646-us", "us-ascii"}, {
-  "us", "us-ascii"}, {
-  "ibm367", "us-ascii"}, {
-  "cp367", "us-ascii"}, {
-  "csASCII", "us-ascii"}, {
-  "csISO2022KR", "iso-2022-kr"}, {
-  "csEUCKR", "euc-kr"}, {
-  "csISO2022JP", "iso-2022-jp"}, {
-  "csISO2022JP2", "iso-2022-jp-2"}, {
-  "ISO_8859-1:1987", "iso-8859-1"}, {
-  "iso-ir-100", "iso-8859-1"}, {
-  "iso_8859-1", "iso-8859-1"}, {
-  "latin1", "iso-8859-1"}, {
-  "l1", "iso-8859-1"}, {
-  "IBM819", "iso-8859-1"}, {
-  "CP819", "iso-8859-1"}, {
-  "csISOLatin1", "iso-8859-1"}, {
-  "ISO_8859-2:1987", "iso-8859-2"}, {
-  "iso-ir-101", "iso-8859-2"}, {
-  "iso_8859-2", "iso-8859-2"}, {
-  "latin2", "iso-8859-2"}, {
-  "l2", "iso-8859-2"}, {
-  "csISOLatin2", "iso-8859-2"}, {
-  "ISO_8859-3:1988", "iso-8859-3"}, {
-  "iso-ir-109", "iso-8859-3"}, {
-  "ISO_8859-3", "iso-8859-3"}, {
-  "latin3", "iso-8859-3"}, {
-  "l3", "iso-8859-3"}, {
-  "csISOLatin3", "iso-8859-3"}, {
-  "ISO_8859-4:1988", "iso-8859-4"}, {
-  "iso-ir-110", "iso-8859-4"}, {
-  "ISO_8859-4", "iso-8859-4"}, {
-  "latin4", "iso-8859-4"}, {
-  "l4", "iso-8859-4"}, {
-  "csISOLatin4", "iso-8859-4"}, {
-  "ISO_8859-6:1987", "iso-8859-6"}, {
-  "iso-ir-127", "iso-8859-6"}, {
-  "iso_8859-6", "iso-8859-6"}, {
-  "ECMA-114", "iso-8859-6"}, {
-  "ASMO-708", "iso-8859-6"}, {
-  "arabic", "iso-8859-6"}, {
-  "csISOLatinArabic", "iso-8859-6"}, {
-  "ISO_8859-7:1987", "iso-8859-7"}, {
-  "iso-ir-126", "iso-8859-7"}, {
-  "ISO_8859-7", "iso-8859-7"}, {
-  "ELOT_928", "iso-8859-7"}, {
-  "ECMA-118", "iso-8859-7"}, {
-  "greek", "iso-8859-7"}, {
-  "greek8", "iso-8859-7"}, {
-  "csISOLatinGreek", "iso-8859-7"}, {
-  "ISO_8859-8:1988", "iso-8859-8"}, {
-  "iso-ir-138", "iso-8859-8"}, {
-  "ISO_8859-8", "iso-8859-8"}, {
-  "hebrew", "iso-8859-8"}, {
-  "csISOLatinHebrew", "iso-8859-8"}, {
-  "ISO_8859-5:1988", "iso-8859-5"}, {
-  "iso-ir-144", "iso-8859-5"}, {
-  "ISO_8859-5", "iso-8859-5"}, {
-  "cyrillic", "iso-8859-5"}, {
-  "csISOLatinCyrillic", "iso8859-5"}, {
-  "ISO_8859-9:1989", "iso-8859-9"}, {
-  "iso-ir-148", "iso-8859-9"}, {
-  "ISO_8859-9", "iso-8859-9"}, {
-  "latin5", "iso-8859-9"},      /* this is not a bug */
-  {
-  "l5", "iso-8859-9"}, {
-  "csISOLatin5", "iso-8859-9"}, {
-  "ISO_8859-10:1992", "iso-8859-10"}, {
-  "iso-ir-157", "iso-8859-10"}, {
-  "latin6", "iso-8859-10"},     /* this is not a bug */
-  {
-  "l6", "iso-8859-10"}, {
-  "csISOLatin6", "iso-8859-10"}, {
-  "csKOI8r", "koi8-r"}, {
-  "MS_Kanji", "Shift_JIS"},     /* Note the underscore! */
-  {
-  "csShiftJis", "Shift_JIS"}, {
-  "Extended_UNIX_Code_Packed_Format_for_Japanese", "EUC-JP"}, {
-  "csEUCPkdFmtJapanese", "EUC-JP"}, {
-  "csGB2312", "gb2312"}, {
-  "csbig5", "big5"},
-    /* 
-     * End of official brain damage.  What follows has been taken
-     * from glibc's localedata files. 
-     */
-  {
-  "iso_8859-13", "iso-8859-13"}, {
-  "iso-ir-179", "iso-8859-13"}, {
-  "latin7", "iso-8859-13"},     /* this is not a bug */
-  {
-  "l7", "iso-8859-13"}, {
-  "iso_8859-14", "iso-8859-14"}, {
-  "latin8", "iso-8859-14"},     /* this is not a bug */
-  {
-  "l8", "iso-8859-14"}, {
-  "iso_8859-15", "iso-8859-15"}, {
-  "latin9", "iso-8859-15"},     /* this is not a bug */
-    /* Suggested by Ionel Mugurel Ciobica <tgakic@sg10.chem.tue.nl> */
-  {
-  "latin0", "iso-8859-15"},     /* this is not a bug */
-  {
-  "iso_8859-16", "iso-8859-16"}, {
-  "latin10", "iso-8859-16"},    /* this is not a bug */
-    /* 
-     * David Champion <dgc@uchicago.edu> has observed this with
-     * nl_langinfo under SunOS 5.8. 
-     */
-  {
-  "646", "us-ascii"},
-    /* 
-     * http://www.sun.com/software/white-papers/wp-unicode/
-     */
-  {
-  "eucJP", "euc-jp"}, {
-  "PCK", "Shift_JIS"}, {
-  "ko_KR-euc", "euc-kr"}, {
-  "zh_TW-big5", "big5"},
-    /* seems to be common on some systems */
-  {
-  "sjis", "Shift_JIS"}, {
-  "euc-jp-ms", "eucJP-ms"},
-    /*
-     * If you happen to encounter system-specific brain-damage with
-     * respect to character set naming, please add it above this
-     * comment, and submit a patch to <mutt-dev@mutt.org>. 
-     */
-    /* End of aliases.  Please keep this line last. */
-  {
-  NULL, NULL}
+    {"ansi_x3.4-1968", "us-ascii"},
+    {"iso-ir-6", "us-ascii"},
+    {"iso_646.irv:1991", "us-ascii"},
+    {"ascii", "us-ascii"},
+    {"iso646-us", "us-ascii"},
+    {"us", "us-ascii"},
+    {"ibm367", "us-ascii"},
+    {"cp367", "us-ascii"},
+    {"csASCII", "us-ascii"},
+    {"csISO2022KR", "iso-2022-kr"},
+    {"csEUCKR", "euc-kr"},
+    {"csISO2022JP", "iso-2022-jp"},
+    {"csISO2022JP2", "iso-2022-jp-2"},
+    {"ISO_8859-1:1987", "iso-8859-1"},
+    {"iso-ir-100", "iso-8859-1"},
+    {"iso_8859-1", "iso-8859-1"},
+    {"latin1", "iso-8859-1"},
+    {"l1", "iso-8859-1"},
+    {"IBM819", "iso-8859-1"},
+    {"CP819", "iso-8859-1"},
+    {"csISOLatin1", "iso-8859-1"},
+    {"ISO_8859-2:1987", "iso-8859-2"},
+    {"iso-ir-101", "iso-8859-2"},
+    {"iso_8859-2", "iso-8859-2"},
+    {"latin2", "iso-8859-2"},
+    {"l2", "iso-8859-2"},
+    {"csISOLatin2", "iso-8859-2"},
+    {"ISO_8859-3:1988", "iso-8859-3"},
+    {"iso-ir-109", "iso-8859-3"},
+    {"ISO_8859-3", "iso-8859-3"},
+    {"latin3", "iso-8859-3"},
+    {"l3", "iso-8859-3"},
+    {"csISOLatin3", "iso-8859-3"},
+    {"ISO_8859-4:1988", "iso-8859-4"},
+    {"iso-ir-110", "iso-8859-4"},
+    {"ISO_8859-4", "iso-8859-4"},
+    {"latin4", "iso-8859-4"},
+    {"l4", "iso-8859-4"},
+    {"csISOLatin4", "iso-8859-4"},
+    {"ISO_8859-6:1987", "iso-8859-6"},
+    {"iso-ir-127", "iso-8859-6"},
+    {"iso_8859-6", "iso-8859-6"},
+    {"ECMA-114", "iso-8859-6"},
+    {"ASMO-708", "iso-8859-6"},
+    {"arabic", "iso-8859-6"},
+    {"csISOLatinArabic", "iso-8859-6"},
+    {"ISO_8859-7:1987", "iso-8859-7"},
+    {"iso-ir-126", "iso-8859-7"},
+    {"ISO_8859-7", "iso-8859-7"},
+    {"ELOT_928", "iso-8859-7"},
+    {"ECMA-118", "iso-8859-7"},
+    {"greek", "iso-8859-7"},
+    {"greek8", "iso-8859-7"},
+    {"csISOLatinGreek", "iso-8859-7"},
+    {"ISO_8859-8:1988", "iso-8859-8"},
+    {"iso-ir-138", "iso-8859-8"},
+    {"ISO_8859-8", "iso-8859-8"},
+    {"hebrew", "iso-8859-8"},
+    {"csISOLatinHebrew", "iso-8859-8"},
+    {"ISO_8859-5:1988", "iso-8859-5"},
+    {"iso-ir-144", "iso-8859-5"},
+    {"ISO_8859-5", "iso-8859-5"},
+    {"cyrillic", "iso-8859-5"},
+    {"csISOLatinCyrillic", "iso8859-5"},
+    {"ISO_8859-9:1989", "iso-8859-9"},
+    {"iso-ir-148", "iso-8859-9"},
+    {"ISO_8859-9", "iso-8859-9"},
+    {"latin5", "iso-8859-9"},
+    {"l5", "iso-8859-9"},
+    {"csISOLatin5", "iso-8859-9"},
+    {"ISO_8859-10:1992", "iso-8859-10"},
+    {"iso-ir-157", "iso-8859-10"},
+    {"latin6", "iso-8859-10"},
+    {"l6", "iso-8859-10"},
+    {"csISOLatin6", "iso-8859-10"},
+    {"csKOI8r", "koi8-r"},
+    {"MS_Kanji", "Shift_JIS"},
+    {"csShiftJis", "Shift_JIS"},
+    {"Extended_UNIX_Code_Packed_Format_for_Japanese", "EUC-JP"},
+    {"csEUCPkdFmtJapanese", "EUC-JP"},
+    {"csGB2312", "gb2312"},
+    {"csbig5", "big5"},
+    /* End of official brain damage.
+       What follows has been taken * from glibc's localedata files.  */
+    {"iso_8859-13", "iso-8859-13"},
+    {"iso-ir-179", "iso-8859-13"},
+    {"latin7", "iso-8859-13"},
+    {"l7", "iso-8859-13"},
+    {"iso_8859-14", "iso-8859-14"},
+    {"latin8", "iso-8859-14"},
+    {"l8", "iso-8859-14"},
+    {"iso_8859-15", "iso-8859-15"},
+    {"latin9", "iso-8859-15"},
+    {"latin0", "iso-8859-15"},
+    {"iso_8859-16", "iso-8859-16"},
+    {"latin10", "iso-8859-16"},
+    {"646", "us-ascii"},
+    {"eucJP", "euc-jp"},
+    {"PCK", "Shift_JIS"},
+    {"ko_KR-euc", "euc-kr"},
+    {"zh_TW-big5", "big5"},
+    {"sjis", "Shift_JIS"},
+    {"euc-jp-ms", "eucJP-ms"},
+    {NULL, NULL}
 };
 
 #ifdef HAVE_LANGINFO_CODESET
 };
 
 #ifdef HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-
+#  include <langinfo.h>
+#endif
 
 void mutt_set_langinfo_charset (void)
 {
 
 void mutt_set_langinfo_charset (void)
 {
-  char buff[LONG_STRING];
-  char buff2[LONG_STRING];
-
-  m_strcpy(buff, sizeof(buff), nl_langinfo(CODESET));
-  mutt_canonical_charset (buff2, sizeof (buff2), buff);
-
-  /* finally, set $charset */
-  if (!(Charset = m_strdup(buff2)))
-    Charset = m_strdup("iso-8859-1");
-}
+#ifdef HAVE_LANGINFO_CODESET
+    char buff[LONG_STRING];
+    char buff2[LONG_STRING];
 
 
-#else
+    m_strcpy(buff, sizeof(buff), nl_langinfo(CODESET));
+    mutt_canonical_charset (buff2, sizeof (buff2), buff);
 
 
-void mutt_set_langinfo_charset (void)
-{
-  Charset = m_strdup("iso-8859-1");
+    /* finally, set $charset */
+    if (!(Charset = m_strdup(buff2)))
+#endif
+        Charset = m_strdup("iso-8859-1");
 }
 
 }
 
-#endif
 
 
-void mutt_canonical_charset (char *dest, ssize_t dlen, const char *name)
+void mutt_canonical_charset(char *dest, ssize_t dlen, const char *name)
 {
   ssize_t i;
   char *p;
 {
   ssize_t i;
   char *p;
@@ -630,7 +594,7 @@ void mutt_set_charset (char *charset)
 #endif
 }
 
 #endif
 }
 
-wchar_t replacement_char (void)
+wchar_t replacement_char(void)
 {
     return Charset_is_utf8 ? 0xfffd : '?';
 }
 {
     return Charset_is_utf8 ? 0xfffd : '?';
 }
index fd85199..4640b80 100644 (file)
--- a/charset.h
+++ b/charset.h
 #include "config.h"
 #endif
 
 #include "config.h"
 #endif
 
-#include "mutt.h"
-
 #ifdef HAVE_ICONV_H
 #include <iconv.h>
 #endif
 
 #ifdef HAVE_ICONV_H
 #include <iconv.h>
 #endif
 
+extern char *Charset;
+extern int Charset_is_utf8;
+
 #ifndef HAVE_ICONV_T_DEF
 typedef void *iconv_t;
 #endif
 #ifndef HAVE_ICONV_T_DEF
 typedef void *iconv_t;
 #endif
@@ -56,8 +57,6 @@ void mutt_set_langinfo_charset (void);
 #define M_ICONV_HOOK_FROM 1
 #define M_ICONV_HOOK_TO   2
 
 #define M_ICONV_HOOK_FROM 1
 #define M_ICONV_HOOK_TO   2
 
-extern int Charset_is_utf8;
-
 void mutt_set_charset(char *charset);
 wchar_t replacement_char(void);
 
 void mutt_set_charset(char *charset);
 wchar_t replacement_char(void);
 
index 492dd2c..b53fb3d 100644 (file)
@@ -37,6 +37,7 @@
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "recvattach.h"
 #include "sort.h"
 #include "copy.h"
 #include "recvattach.h"
 #include "sort.h"
 #include "copy.h"
index 4bf5cf1..23ba10f 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -37,6 +37,7 @@
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "mutt_idna.h"
 #include "rfc1524.h"
 #include "attach.h"
 #include "mutt_idna.h"
 #include "rfc1524.h"
 #include "attach.h"
index 6fc4da3..f404850 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -9,8 +9,6 @@
 #ifndef _GLOBALS_H
 #define _GLOBALS_H
 
 #ifndef _GLOBALS_H
 #define _GLOBALS_H
 
-#include "alias.h"
-
 #include <lib-lib/str.h>
 #include <lib-lib/date.h>
 #include <lib-lib/rx.h>
 #include <lib-lib/str.h>
 #include <lib-lib/date.h>
 #include <lib-lib/rx.h>
@@ -36,7 +34,6 @@ WHERE char *AssumedCharset;
 WHERE char *AttachSep;
 WHERE char *Attribution;
 WHERE char *AttachFormat;
 WHERE char *AttachSep;
 WHERE char *Attribution;
 WHERE char *AttachFormat;
-WHERE char *Charset;
 WHERE char *ComposeFormat;
 WHERE char *ConfigCharset;
 WHERE char *ContentType;
 WHERE char *ComposeFormat;
 WHERE char *ConfigCharset;
 WHERE char *ContentType;
index 496fd09..5dc14e5 100644 (file)
--- a/hcache.c
+++ b/hcache.c
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
+#include "charset.h"
 #include "mutt.h"
 #include <imap/message.h>
 #include "mx.h"
 #include "lib.h"
 
 #include "mutt.h"
 #include <imap/message.h>
 #include "mx.h"
 #include "lib.h"
 
-static struct header_cache {
+struct header_cache {
 #if defined(HAVE_QDBM)
   VILLA *db;
   char *folder;
 #if defined(HAVE_QDBM)
   VILLA *db;
   char *folder;
@@ -67,7 +68,7 @@ static struct header_cache {
   int fd;
   char lockfile[_POSIX_PATH_MAX];
 #endif
   int fd;
   char lockfile[_POSIX_PATH_MAX];
 #endif
-} HEADER_CACHE;
+};
 
 typedef union {
   struct timeval timeval;
 
 typedef union {
   struct timeval timeval;
@@ -857,7 +858,7 @@ void *mutt_hcache_open (const char *path, const char *folder)
   struct stat sb;
   u_int32_t createflags = DB_CREATE;
   int ret;
   struct stat sb;
   u_int32_t createflags = DB_CREATE;
   int ret;
-  struct header_cache *h = calloc (1, sizeof (HEADER_CACHE));
+  struct header_cache *h = p_new(struct header_cache, 1);
   int pagesize = atoi (HeaderCachePageSize);
 
 
   int pagesize = atoi (HeaderCachePageSize);
 
 
index 765a2fa..2bc1bed 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -24,6 +24,7 @@
 #include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include <lib-ui/curses.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "sort.h"
 #include "thread.h"
 #include "charset.h"
 #include "sort.h"
 #include "thread.h"
 #include "charset.h"
index 193a122..e05a7ea 100644 (file)
--- a/headers.c
+++ b/headers.c
@@ -21,6 +21,7 @@
 #include <lib-lib/debug.h>
 
 #include "mutt.h"
 #include <lib-lib/debug.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include <lib-crypt/crypt.h>
 #include "mutt_idna.h"
 
 #include <lib-crypt/crypt.h>
 #include "mutt_idna.h"
 
diff --git a/help.c b/help.c
index 0199398..67d8855 100644 (file)
--- a/help.c
+++ b/help.c
@@ -26,6 +26,7 @@
 #include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include <lib-ui/curses.h>
 
 #include "mutt.h"
+#include "charset.h"
 #include "keymap.h"
 #include "pager.h"
 
 #include "keymap.h"
 #include "pager.h"
 
diff --git a/hook.c b/hook.c
index bb8e30f..aaf1c7c 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -25,6 +25,7 @@
 #include <lib-lib/rx.h>
 
 #include "mutt.h"
 #include <lib-lib/rx.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "mx.h"
 #include <lib-crypt/crypt.h>
 #include "compress.h"
 #include "mx.h"
 #include <lib-crypt/crypt.h>
 #include "compress.h"
diff --git a/init.c b/init.c
index c55a0da..e9e1cf6 100644 (file)
--- a/init.c
+++ b/init.c
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/utsname.h>
+#include <errno.h>
+#include <sys/wait.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/file.h>
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/file.h>
@@ -25,6 +33,7 @@
 #include <lib-lib/rx.h>
 
 #include <lib-sys/unix.h>
 #include <lib-lib/rx.h>
 
 #include <lib-sys/unix.h>
+#include <lib-sys/mutt_ssl.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/history.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/history.h>
 #include <lib-crypt/crypt.h>
 #include "mutt_idna.h"
 
 #include <lib-crypt/crypt.h>
 #include "mutt_idna.h"
 
-#if defined(USE_SSL) || defined(USE_GNUTLS)
-#include <lib-sys/mutt_ssl.h>
-#endif
-
 #if defined (USE_LIBESMTP) && (defined (USE_SSL) || defined (USE_GNUTLS))
 #include "mutt_libesmtp.h"
 #endif
 
 #if defined (USE_LIBESMTP) && (defined (USE_SSL) || defined (USE_GNUTLS))
 #include "mutt_libesmtp.h"
 #endif
 
+#include "alias.h"
 #include "mx.h"
 #include "init.h"
 
 #include "lib/list.h"
 
 #include "mx.h"
 #include "init.h"
 
 #include "lib/list.h"
 
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/utsname.h>
-#include <errno.h>
-#include <sys/wait.h>
-
 /*
  * prototypes
  */
 /*
  * prototypes
  */
index accd171..3c2ded8 100644 (file)
 
 #ifdef CRYPT_BACKEND_GPGME
 
 
 #ifdef CRYPT_BACKEND_GPGME
 
+#include <sys/wait.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <ctype.h>
+
+#ifdef HAVE_LOCALE_H
+#  include <locale.h>
+#endif
+#ifdef HAVE_LANGINFO_D_T_FMT
+#  include <langinfo.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#  include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
+#  include <sys/resource.h>
+#endif
+
+#include <gpgme.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/ascii.h>
@@ -32,6 +55,7 @@
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include <lib-crypt/crypt.h>
 #include "handler.h"
 #include "copy.h"
 #include <lib-crypt/crypt.h>
 #include "handler.h"
 #include "copy.h"
 #include "recvattach.h"
 #include "sort.h"
 
 #include "recvattach.h"
 #include "sort.h"
 
-
-#include <sys/wait.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <ctype.h>
-
-#include <gpgme.h>
-
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif
-#ifdef HAVE_LANGINFO_D_T_FMT
-#include <langinfo.h>
-#endif
-
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-
-#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
-#endif
-
 /*
  * Helper macros.
  */
 /*
  * Helper macros.
  */
index e4457a8..194c48f 100644 (file)
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
-#include <lib-lib/str.h>
-#include <lib-lib/file.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/mem.h>
-#include <lib-lib/macros.h>
-
-#include <lib-mime/mime.h>
-
-#include <lib-ui/curses.h>
-
-#include "mutt.h"
-#include "handler.h"
-#include "copy.h"
-#include "crypt.h"
-#include "pgp.h"
-
-
 #include <sys/wait.h>
 #include <string.h>
 #include <stdlib.h>
 #include <sys/wait.h>
 #include <string.h>
 #include <stdlib.h>
 #include <ctype.h>
 
 #ifdef HAVE_LOCALE_H
 #include <ctype.h>
 
 #ifdef HAVE_LOCALE_H
-#include <locale.h>
+#  include <locale.h>
 #endif
 #endif
-
 #ifdef HAVE_SYS_TIME_H
 #ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
+#  include <sys/time.h>
 #endif
 #endif
-
 #ifdef HAVE_SYS_RESOURCE_H
 #ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
+#  include <sys/resource.h>
 #endif
 
 #endif
 
+#include <lib-lib/str.h>
+#include <lib-lib/file.h>
+#include <lib-lib/ascii.h>
+#include <lib-lib/mem.h>
+#include <lib-lib/macros.h>
+
+#include <lib-mime/mime.h>
+
+#include <lib-ui/curses.h>
+
+#include "mutt.h"
+#include "alias.h"
+#include "handler.h"
+#include "copy.h"
+#include "crypt.h"
+#include "pgp.h"
 
 /* print the current time to avoid spoofing of the signature output */
 void crypt_current_time (STATE * s, const char *app_name)
 
 /* print the current time to avoid spoofing of the signature output */
 void crypt_current_time (STATE * s, const char *app_name)
index eb554e9..5d773cd 100644 (file)
 # include "config.h"
 #endif
 
 # include "config.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/debug.h>
-
-#include <lib-mime/mime.h>
-
-#include <lib-ui/curses.h>
-#include <lib-ui/enter.h>
-#include <lib-ui/menu.h>
-
-#include "mutt.h"
-#include "handler.h"
-#include "copy.h"
-
-
 #include <sys/wait.h>
 #include <string.h>
 #include <stdlib.h>
 #include <sys/wait.h>
 #include <string.h>
 #include <stdlib.h>
 #include <ctype.h>
 
 #ifdef HAVE_LOCALE_H
 #include <ctype.h>
 
 #ifdef HAVE_LOCALE_H
-#include <locale.h>
+#  include <locale.h>
 #endif
 #endif
-
 #ifdef HAVE_SYS_TIME_H
 #ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
+#  include <sys/time.h>
 #endif
 #endif
-
 #ifdef HAVE_SYS_RESOURCE_H
 #ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
+#  include <sys/resource.h>
 #endif
 
 #endif
 
+#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
+#include <lib-lib/file.h>
+#include <lib-lib/debug.h>
+
+#include <lib-mime/mime.h>
+
+#include <lib-ui/curses.h>
+#include <lib-ui/enter.h>
+#include <lib-ui/menu.h>
+
+#include "mutt.h"
+#include "alias.h"
+#include "handler.h"
+#include "copy.h"
+#include "alias.h"
 #include "crypt.h"
 
 struct smime_command_context {
 #include "crypt.h"
 
 struct smime_command_context {
index e1eec1e..bf05bef 100644 (file)
@@ -47,6 +47,7 @@
 #include <lib-mime/mime.h>
 
 #include "charset.h"
 #include <lib-mime/mime.h>
 
 #include "charset.h"
+#include "mutt.h"
 
 typedef struct rfc2231_param {
     struct rfc2231_param *next;
 
 typedef struct rfc2231_param {
     struct rfc2231_param *next;
index 9643aee..d4e18c1 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "recvattach.h"
 
 
 #include "recvattach.h"
 
+#include "charset.h"
 #include "mime.h"
 
 /* Reads an arbitrarily long header field, and looks ahead for continuation
 #include "mime.h"
 
 /* Reads an arbitrarily long header field, and looks ahead for continuation
index 60da260..5b40ceb 100644 (file)
@@ -34,6 +34,7 @@
 #include "menu.h"
 
 #include "mutt.h"
 #include "menu.h"
 
 #include "mutt.h"
+#include "alias.h"
 #include "mx.h"
 #include "sort.h"
 #include "recvattach.h"
 #include "mx.h"
 #include "sort.h"
 #include "recvattach.h"
index 0d5b12e..2e048b1 100644 (file)
@@ -21,6 +21,7 @@
 #include "menu.h"
 
 #include "mutt.h"
 #include "menu.h"
 
 #include "mutt.h"
+#include "alias.h"
 #include "keymap.h"
 #include "history.h"
 #include "buffy.h"
 #include "keymap.h"
 #include "history.h"
 #include "buffy.h"
diff --git a/main.c b/main.c
index 8451c72..8f1c8b4 100644 (file)
--- a/main.c
+++ b/main.c
@@ -41,6 +41,7 @@
 #include <lib-ui/curses.h>
 
 #include "mutt.h"
 #include <lib-ui/curses.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "mx.h"
 #include "buffy.h"
 #include "sort.h"
 #include "mx.h"
 #include "buffy.h"
 #include "sort.h"
diff --git a/mutt.h b/mutt.h
index a75b99a..6e1726a 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -18,9 +18,6 @@
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>            /* needed for SEEK_SET */
 #endif
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>            /* needed for SEEK_SET */
 #endif
-#ifdef HAVE_UNIX_H
-# include <unix.h>              /* needed for snprintf on QNX. */
-#endif
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <time.h>
 
 #include <lib-mime/mime.h>
 
 
 #include <lib-mime/mime.h>
 
-#include "charset.h"
-
-#ifndef HAVE_WC_FUNCS
-# ifdef MB_LEN_MAX
-#  undef MB_LEN_MAX
-# endif
-# define MB_LEN_MAX 16
-#endif
-
-# define MUTT_VERSION (VERSION)
+#define MUTT_VERSION (VERSION)
 
 /* nifty trick I stole from ELM 2.5alpha. */
 #ifdef MAIN_C
 
 /* nifty trick I stole from ELM 2.5alpha. */
 #ifdef MAIN_C
@@ -495,7 +483,7 @@ enum {
   OPTMAX
 };
 
   OPTMAX
 };
 
-#define mutt_bit_alloc(n) calloc ((n + 7) / 8, sizeof (char))
+#define mutt_bit_alloc(n) p_new(char, (n + 7) / 8)
 #define mutt_bit_set(v,n) v[n/8] |= (1 << (n % 8))
 #define mutt_bit_unset(v,n) v[n/8] &= ~(1 << (n % 8))
 #define mutt_bit_toggle(v,n) v[n/8] ^= (1 << (n % 8))
 #define mutt_bit_set(v,n) v[n/8] |= (1 << (n % 8))
 #define mutt_bit_unset(v,n) v[n/8] &= ~(1 << (n % 8))
 #define mutt_bit_toggle(v,n) v[n/8] ^= (1 << (n % 8))
index 2938066..b130f8e 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -38,6 +38,7 @@
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 
+#include "alias.h"
 #include "mutt.h"
 #include "mx.h"
 #include "attach.h"
 #include "mutt.h"
 #include "mx.h"
 #include "attach.h"
diff --git a/pager.c b/pager.c
index ea07331..6b99c6e 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -36,6 +36,7 @@
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "keymap.h"
 #include "sort.h"
 #include "pager.h"
 #include "keymap.h"
 #include "sort.h"
 #include "pager.h"
index e07377f..cef1722 100644 (file)
--- a/pattern.c
+++ b/pattern.c
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <stdarg.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/mem.h>
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
@@ -24,6 +31,7 @@
 #include <lib-ui/enter.h>
 
 #include "mutt.h"
 #include <lib-ui/enter.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "handler.h"
 #include "mx.h"
 #include "keymap.h"
 #include "handler.h"
 #include "mx.h"
 #include "keymap.h"
 
 #include <imap/imap.h>
 
 
 #include <imap/imap.h>
 
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdarg.h>
-
 #include <lib-crypt/crypt.h>
 
 static int eat_regexp (pattern_t * pat, BUFFER *, BUFFER *);
 #include <lib-crypt/crypt.h>
 
 static int eat_regexp (pattern_t * pat, BUFFER *, BUFFER *);
@@ -49,59 +50,56 @@ struct pattern_flags {
   int tag;                      /* character used to represent this op */
   int op;                       /* operation to perform */
   int class;
   int tag;                      /* character used to represent this op */
   int op;                       /* operation to perform */
   int class;
-  int (*eat_arg) (pattern_t *, BUFFER *, BUFFER *);
+  int (*eat_arg)(pattern_t *, BUFFER *, BUFFER *);
 } Flags[] = {
 } Flags[] = {
-  {
-  'A', M_ALL, 0, NULL}, {
-  'b', M_BODY, M_FULL_MSG, eat_regexp}, {
-  'B', M_WHOLE_MSG, M_FULL_MSG, eat_regexp}, {
-  'c', M_CC, 0, eat_regexp}, {
-  'C', M_RECIPIENT, 0, eat_regexp}, {
-  'd', M_DATE, 0, eat_date}, {
-  'D', M_DELETED, 0, NULL}, {
-  'e', M_SENDER, 0, eat_regexp}, {
-  'E', M_EXPIRED, 0, NULL}, {
-  'f', M_FROM, 0, eat_regexp}, {
-  'F', M_FLAG, 0, NULL}, {
-  'g', M_CRYPT_SIGN, 0, NULL}, {
-  'G', M_CRYPT_ENCRYPT, 0, NULL}, {
-  'h', M_HEADER, M_FULL_MSG, eat_regexp}, {
-  'H', M_HORMEL, 0, eat_regexp}, {
-  'i', M_ID, 0, eat_regexp}, {
-  'k', M_PGP_KEY, 0, NULL}, {
-  'L', M_ADDRESS, 0, eat_regexp}, {
-  'l', M_LIST, 0, NULL}, {
-  'm', M_MESSAGE, 0, eat_range}, {
-  'M', M_MULTIPART, 0, NULL}, {
-  'n', M_SCORE, 0, eat_range}, {
-  'N', M_NEW, 0, NULL}, {
-  'O', M_OLD, 0, NULL}, {
-  'p', M_PERSONAL_RECIP, 0, NULL}, {
-  'P', M_PERSONAL_FROM, 0, NULL}, {
-  'Q', M_REPLIED, 0, NULL}, {
-  'R', M_READ, 0, NULL}, {
-  'r', M_DATE_RECEIVED, 0, eat_date}, {
-  's', M_SUBJECT, 0, eat_regexp}, {
-  'S', M_SUPERSEDED, 0, NULL}, {
-  'T', M_TAG, 0, NULL}, {
-  't', M_TO, 0, eat_regexp}, {
-  'U', M_UNREAD, 0, NULL}, {
-  'u', M_SUBSCRIBED_LIST, 0, NULL}, {
-  'v', M_COLLAPSED, 0, NULL}, {
-  'V', M_CRYPT_VERIFIED, 0, NULL},
+  {'A', M_ALL, 0, NULL},
+  {'b', M_BODY, M_FULL_MSG, eat_regexp},
+  {'B', M_WHOLE_MSG, M_FULL_MSG, eat_regexp},
+  {'c', M_CC, 0, eat_regexp},
+  {'C', M_RECIPIENT, 0, eat_regexp},
+  {'d', M_DATE, 0, eat_date},
+  {'D', M_DELETED, 0, NULL},
+  {'e', M_SENDER, 0, eat_regexp},
+  {'E', M_EXPIRED, 0, NULL},
+  {'f', M_FROM, 0, eat_regexp},
+  {'F', M_FLAG, 0, NULL},
+  {'g', M_CRYPT_SIGN, 0, NULL},
+  {'G', M_CRYPT_ENCRYPT, 0, NULL},
+  {'h', M_HEADER, M_FULL_MSG, eat_regexp},
+  {'H', M_HORMEL, 0, eat_regexp},
+  {'i', M_ID, 0, eat_regexp},
+  {'k', M_PGP_KEY, 0, NULL},
+  {'L', M_ADDRESS, 0, eat_regexp},
+  {'l', M_LIST, 0, NULL},
+  {'m', M_MESSAGE, 0, eat_range},
+  {'M', M_MULTIPART, 0, NULL},
+  {'n', M_SCORE, 0, eat_range},
+  {'N', M_NEW, 0, NULL},
+  {'O', M_OLD, 0, NULL},
+  {'p', M_PERSONAL_RECIP, 0, NULL},
+  {'P', M_PERSONAL_FROM, 0, NULL},
+  {'Q', M_REPLIED, 0, NULL},
+  {'R', M_READ, 0, NULL},
+  {'r', M_DATE_RECEIVED, 0, eat_date},
+  {'s', M_SUBJECT, 0, eat_regexp},
+  {'S', M_SUPERSEDED, 0, NULL},
+  {'T', M_TAG, 0, NULL},
+  {'t', M_TO, 0, eat_regexp},
+  {'U', M_UNREAD, 0, NULL},
+  {'u', M_SUBSCRIBED_LIST, 0, NULL},
+  {'v', M_COLLAPSED, 0, NULL},
+  {'V', M_CRYPT_VERIFIED, 0, NULL},
 #ifdef USE_NNTP
 #ifdef USE_NNTP
-  {
-  'w', M_NEWSGROUPS, 0, eat_regexp},
+  {'w', M_NEWSGROUPS, 0, eat_regexp},
 #endif
 #endif
-  {
-  'x', M_REFERENCE, 0, eat_regexp}, {
-  'X', M_MIMEATTACH, 0, eat_range}, {
-  'y', M_XLABEL, 0, eat_regexp}, {
-  'z', M_SIZE, 0, eat_range}, {
-  '=', M_DUPLICATED, 0, NULL}, {
-  '$', M_UNREFERENCED, 0, NULL}, {
-  '*', M_REALNAME, 0, NULL}, {
-  0, 0, 0, NULL}
+  {'x', M_REFERENCE, 0, eat_regexp},
+  {'X', M_MIMEATTACH, 0, eat_range},
+  {'y', M_XLABEL, 0, eat_regexp},
+  {'z', M_SIZE, 0, eat_range},
+  {'=', M_DUPLICATED, 0, NULL},
+  {'$', M_UNREFERENCED, 0, NULL},
+  {'*', M_REALNAME, 0, NULL},
+  {0, 0, 0, NULL}
 };
 
 static pattern_t *SearchPattern = NULL; /* current search pattern */
 };
 
 static pattern_t *SearchPattern = NULL; /* current search pattern */
diff --git a/query.c b/query.c
index be1ac47..ce1f052 100644 (file)
--- a/query.c
+++ b/query.c
@@ -25,6 +25,7 @@
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "mutt_idna.h"
 #include "sort.h"
 
 #include "mutt_idna.h"
 #include "sort.h"
 
index b403044..821dfbb 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -24,6 +24,7 @@
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "state.h"
 #include "handler.h"
 #include "recvattach.h"
 #include "state.h"
 #include "handler.h"
 #include "recvattach.h"
diff --git a/send.c b/send.c
index 6821f01..bbebca3 100644 (file)
--- a/send.c
+++ b/send.c
@@ -37,6 +37,7 @@
 #include <lib-ui/enter.h>
 
 #include "mutt.h"
 #include <lib-ui/enter.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "rfc3676.h"
 #include "keymap.h"
 #include "copy.h"
 #include "rfc3676.h"
 #include "keymap.h"
 #include "copy.h"
index caa8538..15a2eef 100644 (file)
--- a/sidebar.c
+++ b/sidebar.c
@@ -12,6 +12,9 @@
  * please see the file GPL in the top level source directory.
  */
 
  * please see the file GPL in the top level source directory.
  */
 
+#include <libgen.h>
+#include <ctype.h>
+
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-lib/mem.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
 #include <lib-ui/menu.h>
 
 #include "mutt.h"
+#include "charset.h"
 #include "sidebar.h"
 #include "buffy.h"
 #include "keymap.h"
 
 #include "sidebar.h"
 #include "buffy.h"
 #include "keymap.h"
 
-
-#include <libgen.h>
-#include <ctype.h>
-
 static int TopBuffy = 0;
 static int CurBuffy = 0;
 static int known_lines = 0;
 static int TopBuffy = 0;
 static int CurBuffy = 0;
 static int known_lines = 0;
diff --git a/sort.c b/sort.c
index 028630b..6b6d737 100644 (file)
--- a/sort.c
+++ b/sort.c
 # include "config.h"
 #endif
 
 # include "config.h"
 #endif
 
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <unistd.h>
+
 #include <lib-lib/macros.h>
 #include <lib-lib/str.h>
 
 #include "mutt.h"
 #include <lib-lib/macros.h>
 #include <lib-lib/str.h>
 
 #include "mutt.h"
+#include "alias.h"
 #include "sort.h"
 #include "thread.h"
 #include "mutt_idna.h"
 
 #include "sort.h"
 #include "thread.h"
 #include "mutt_idna.h"
 
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-
 #define SORTCODE(x) (Sort & SORT_REVERSE) ? -(x) : x
 
 /* function to use as discriminator when normal sort method is equal */
 #define SORTCODE(x) (Sort & SORT_REVERSE) ? -(x) : x
 
 /* function to use as discriminator when normal sort method is equal */
index 4af9027..9522d26 100644 (file)
--- a/thread.h
+++ b/thread.h
@@ -9,6 +9,8 @@
 #ifndef _MUTT_THREAD_H
 #define _MUTT_THREAD_H
 
 #ifndef _MUTT_THREAD_H
 #define _MUTT_THREAD_H
 
+#include "mutt.h"
+
 #define mutt_next_thread(x) _mutt_aside_thread(x,1,0)
 #define mutt_previous_thread(x) _mutt_aside_thread(x,0,0)
 #define mutt_next_subthread(x) _mutt_aside_thread(x,1,1)
 #define mutt_next_thread(x) _mutt_aside_thread(x,1,0)
 #define mutt_previous_thread(x) _mutt_aside_thread(x,0,0)
 #define mutt_next_subthread(x) _mutt_aside_thread(x,1,1)