remove a whole lot of #include mutt.h
authorPierre Habouzit <pierre.habouzit@intersec.eu>
Fri, 17 Nov 2006 12:07:25 +0000 (13:07 +0100)
committerPierre Habouzit <pierre.habouzit@intersec.eu>
Fri, 17 Nov 2006 12:07:25 +0000 (13:07 +0100)
Signed-off-by: Pierre Habouzit <pierre.habouzit@intersec.eu>
17 files changed:
charset.c
charset.def
lib-crypt/crypt-gpgme.c
lib-crypt/crypt-mod.h
lib-crypt/crypt.c
lib-crypt/crypt.h
lib-crypt/cryptglue.c
lib-crypt/gnupgparse.c
lib-crypt/pgp.c
lib-crypt/pgpinvoke.c
lib-crypt/pgpkey.c
lib-crypt/pgplib.c
lib-crypt/pgpmicalg.c
lib-crypt/smime.c
lib-mime/crypt.c
lib-mime/mime-token.sh
send.c

index 32317b1..29aa776 100644 (file)
--- a/charset.c
+++ b/charset.c
@@ -27,7 +27,6 @@
 
 #include <lib-lib/lib-lib.h>
 
 
 #include <lib-lib/lib-lib.h>
 
-#include <sys/types.h>
 #ifdef HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
 #endif
 #ifdef HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
 #endif
index 1143cf0..eb55ee2 100644 (file)
@@ -31,6 +31,9 @@ cat <<EOF | gperf -Ncharset_canonicalize_aux -m16 -l -E -t -C -F", NULL"
  * encoding name, hence you have to pass a charset stripped from its '-' and
  * '_' and truncated at the first ':' encountered.
  */
  * encoding name, hence you have to pass a charset stripped from its '-' and
  * '_' and truncated at the first ':' encountered.
  */
+
+static const struct cset_pair *
+charset_canonicalize_aux(const char *str, unsigned int len);
 %}
 struct cset_pair { const char *name; const char *pref; };
 %%
 %}
 struct cset_pair { const char *name; const char *pref; };
 %%
index 2711dd7..428b872 100644 (file)
@@ -34,7 +34,6 @@
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
-#include "mutt.h"
 #include "lib.h"
 #include "alias.h"
 #include <lib-crypt/crypt.h>
 #include "lib.h"
 #include "alias.h"
 #include <lib-crypt/crypt.h>
index 679b81e..c74081e 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef CRYPTOGRAPHY_H
 #define CRYPTOGRAPHY_H
 
 #ifndef CRYPTOGRAPHY_H
 #define CRYPTOGRAPHY_H
 
-#include "mutt.h"
+#include <lib-mime/mime.h>
 #include "crypt.h"
 
 /* 
 #include "crypt.h"
 
 /* 
index f5953bc..19d36c0 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <lib-ui/curses.h>
 
 
 #include <lib-ui/curses.h>
 
-#include "mutt.h"
+#include "mx.h"
 #include "alias.h"
 #include "handler.h"
 #include "copy.h"
 #include "alias.h"
 #include "handler.h"
 #include "copy.h"
index 3a2a207..274fbfa 100644 (file)
 #ifndef MUTT_CRYPT_H
 #define MUTT_CRYPT_H
 
 #ifndef MUTT_CRYPT_H
 #define MUTT_CRYPT_H
 
-#include "mutt.h"               /* Need this to declare BODY, address_t. STATE etc. */
+#include <lib-mime/mime.h>
 #include "state.h"
 
 /* FIXME: They should be pointer to anonymous structures for better
    information hiding. */
 
 
 #include "state.h"
 
 /* FIXME: They should be pointer to anonymous structures for better
    information hiding. */
 
 
-
 #define ENCRYPT    (1 << 0)
 #define SIGN       (1 << 1)
 #define GOODSIGN   (1 << 2)
 #define ENCRYPT    (1 << 0)
 #define SIGN       (1 << 1)
 #define GOODSIGN   (1 << 2)
index 860f8af..5ea7ace 100644 (file)
@@ -280,14 +280,6 @@ int crypt_smime_application_smime_handler (BODY * m, STATE * s)
   return (-1);
 }
 
   return (-1);
 }
 
-/* MIME handler for an PGP/MIME encrypted message. */
-int crypt_smime_encrypted_handler (BODY * a, STATE * s)
-{
-  if (CRYPT_MOD_CALL_CHECK (SMIME, encrypted_handler))
-    return (CRYPT_MOD_CALL (SMIME, encrypted_handler)) (a, s);
-  return (-1);
-}
-
 /* fixme: Needs documentation. */
 void crypt_smime_getkeys (ENVELOPE * env)
 {
 /* fixme: Needs documentation. */
 void crypt_smime_getkeys (ENVELOPE * env)
 {
index 5943467..d4876d6 100644 (file)
@@ -24,7 +24,6 @@
 #include <lib-sys/unix.h>
 #include <lib-ui/curses.h>
 
 #include <lib-sys/unix.h>
 #include <lib-ui/curses.h>
 
-#include "mutt.h"
 #include "pgp.h"
 #include "charset.h"
 
 #include "pgp.h"
 #include "charset.h"
 
index 8875ed9..d729bcf 100644 (file)
 #endif
 
 #include <lib-mime/mime.h>
 #endif
 
 #include <lib-mime/mime.h>
+#include <lib-sys/unix.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
-#include "mutt.h"
+#include "mx.h"
 #include "handler.h"
 #include "pgp.h"
 #include "copy.h"
 #include "handler.h"
 #include "pgp.h"
 #include "copy.h"
@@ -586,61 +587,6 @@ int pgp_verify_one (BODY * sigbdy, STATE * s, const char *tempfile)
 
 /* Extract pgp public keys from messages or attachments */
 
 
 /* Extract pgp public keys from messages or attachments */
 
-void pgp_extract_keys_from_messages (HEADER * h)
-{
-  int i;
-  char tempfname[_POSIX_PATH_MAX];
-  FILE *fpout;
-
-  if (h) {
-    mutt_parse_mime_message (Context, h);
-    if (h->security & PGPENCRYPT && !pgp_valid_passphrase ())
-      return;
-  }
-
-  mutt_mktemp (tempfname);
-  if (!(fpout = safe_fopen (tempfname, "w"))) {
-    mutt_perror (tempfname);
-    return;
-  }
-
-  set_option (OPTDONTHANDLEPGPKEYS);
-
-  if (!h) {
-    for (i = 0; i < Context->vcount; i++) {
-      if (Context->hdrs[Context->v2r[i]]->tagged) {
-        mutt_parse_mime_message (Context, Context->hdrs[Context->v2r[i]]);
-        if (Context->hdrs[Context->v2r[i]]->security & PGPENCRYPT
-            && !pgp_valid_passphrase ()) {
-          fclose (fpout);
-          goto bailout;
-        }
-        mutt_copy_message (fpout, Context, Context->hdrs[Context->v2r[i]],
-                           M_CM_DECODE | M_CM_CHARCONV, 0);
-      }
-    }
-  }
-  else {
-    mutt_parse_mime_message (Context, h);
-    if (h->security & PGPENCRYPT && !pgp_valid_passphrase ()) {
-      fclose (fpout);
-      goto bailout;
-    }
-    mutt_copy_message (fpout, Context, h, M_CM_DECODE | M_CM_CHARCONV, 0);
-  }
-
-  fclose (fpout);
-  mutt_endwin (NULL);
-  pgp_invoke_import (tempfname);
-  mutt_any_key_to_continue (NULL);
-
-bailout:
-
-  mutt_unlink (tempfname);
-  unset_option (OPTDONTHANDLEPGPKEYS);
-
-}
-
 static void pgp_extract_keys_from_attachment (FILE * fp, BODY * top)
 {
   STATE s;
 static void pgp_extract_keys_from_attachment (FILE * fp, BODY * top)
 {
   STATE s;
@@ -1078,7 +1024,7 @@ char *pgp_findKeys (address_t * to, address_t * cc, address_t * bcc)
   if (fqdn)
     rfc822_qualify (tmp, fqdn);
 
   if (fqdn)
     rfc822_qualify (tmp, fqdn);
 
-  address_list_uniq(&tmp);
+  address_list_uniq(tmp);
 
   for (p = tmp; p; p = p->next) {
     char buf[LONG_STRING];
 
   for (p = tmp; p; p = p->next) {
     char buf[LONG_STRING];
index 1428e47..b3d42a2 100644 (file)
 #include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
 #include <lib-lib/lib-lib.h>
 
 #include <lib-sys/unix.h>
-
 #include <lib-mime/mime.h>
 #include <lib-mime/mime.h>
-
 #include <lib-ui/curses.h>
 
 #include <lib-ui/curses.h>
 
-#include "mutt.h"
 #include "mutt_idna.h"
 #include "pgp.h"
 
 #include "mutt_idna.h"
 #include "pgp.h"
 
@@ -37,7 +34,7 @@ struct pgp_command_context {
 };
 
 
 };
 
 
-const char *
+static const char *
 _mutt_fmt_pgp_command(char *dest, ssize_t destlen,
                       char op, const char *src, const char *prefix,
                       const char *ifstring, const char *elsestring,
 _mutt_fmt_pgp_command(char *dest, ssize_t destlen,
                       char op, const char *src, const char *prefix,
                       const char *ifstring, const char *elsestring,
@@ -120,8 +117,9 @@ _mutt_fmt_pgp_command(char *dest, ssize_t destlen,
   return (src);
 }
 
   return (src);
 }
 
-void mutt_pgp_command (char *d, ssize_t dlen, struct pgp_command_context *cctx,
-                       const char *fmt)
+static void
+mutt_pgp_command(char *d, ssize_t dlen, struct pgp_command_context *cctx,
+                 const char *fmt)
 {
   mutt_FormatString (d, dlen, NONULL (fmt), _mutt_fmt_pgp_command,
                      (unsigned long) cctx, 0);
 {
   mutt_FormatString (d, dlen, NONULL (fmt), _mutt_fmt_pgp_command,
                      (unsigned long) cctx, 0);
index ddb8f1c..e5686a5 100644 (file)
 #include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
 #include <lib-lib/lib-lib.h>
 
 #include <lib-mime/mime.h>
+#include <lib-sys/unix.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
-#include "mutt.h"
 #include "recvattach.h"
 #include "pgp.h"
 #include "pager.h"
 #include "recvattach.h"
 #include "pgp.h"
 #include "pager.h"
index 923aa14..9213016 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <lib-lib/lib-lib.h>
 
 
 #include <lib-lib/lib-lib.h>
 
-#include "mutt.h"
 #include "lib.h"
 #include "pgplib.h"
 
 #include "lib.h"
 #include "pgplib.h"
 
@@ -97,7 +96,7 @@ short pgp_get_abilities (unsigned char type)
   return (pgp_canencrypt (type) << 1) | pgp_cansign (type);
 }
 
   return (pgp_canencrypt (type) << 1) | pgp_cansign (type);
 }
 
-void pgp_free_sig (pgp_sig_t ** sigp)
+static void pgp_free_sig (pgp_sig_t ** sigp)
 {
   pgp_sig_t *sp, *q;
 
 {
   pgp_sig_t *sp, *q;
 
@@ -112,7 +111,7 @@ void pgp_free_sig (pgp_sig_t ** sigp)
   *sigp = NULL;
 }
 
   *sigp = NULL;
 }
 
-void pgp_free_uid (pgp_uid_t ** upp)
+static void pgp_free_uid (pgp_uid_t ** upp)
 {
   pgp_uid_t *up, *q;
 
 {
   pgp_uid_t *up, *q;
 
index c070173..d2743f3 100644 (file)
 
 #include <lib-lib/lib-lib.h>
 
 
 #include <lib-lib/lib-lib.h>
 
-#include "mutt.h"
+#include <lib-mime/mime.h>
+#include <lib-ui/curses.h>
+
 #include "handler.h"
 #include "pgp.h"
 #include "pgppacket.h"
 #include "charset.h"
 
 #include "handler.h"
 #include "pgp.h"
 #include "pgppacket.h"
 #include "charset.h"
 
-#include <lib-ui/curses.h>
-
-#include <lib-mime/mime.h>
 
 static struct {
   short id;
 
 static struct {
   short id;
index 24ed09a..479fd8c 100644 (file)
 #endif
 
 #include <lib-mime/mime.h>
 #endif
 
 #include <lib-mime/mime.h>
+#include <lib-sys/unix.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.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 "alias.h"
 #include "handler.h"
 #include "copy.h"
 #include "alias.h"
+
 #include "crypt.h"
 #include "crypt.h"
+#include "smime.h"
 
 struct smime_command_context {
   const char *key;              /* %k */
 
 struct smime_command_context {
   const char *key;              /* %k */
@@ -607,15 +609,11 @@ char *smime_get_field_from_db (char *mailbox, char *query, short public,
   return m_strdup(key);
 }
 
   return m_strdup(key);
 }
 
-
-
-
 /* 
    This sets the '*ToUse' variables for an upcoming decryption, where
    the reuquired key is different from SmimeDefaultKey.
 */
 /* 
    This sets the '*ToUse' variables for an upcoming decryption, where
    the reuquired key is different from SmimeDefaultKey.
 */
-
-void _smime_getkeys (char *mailbox)
+static void _smime_getkeys (char *mailbox)
 {
   char *k = NULL;
   char buf[STRING];
 {
   char *k = NULL;
   char buf[STRING];
@@ -735,7 +733,7 @@ char *smime_findKeys (address_t * to, address_t * cc, address_t * bcc)
   if (fqdn)
     rfc822_qualify (tmp, fqdn);
 
   if (fqdn)
     rfc822_qualify (tmp, fqdn);
 
-  address_list_uniq(&tmp);
+  address_list_uniq(tmp);
 
   for (p = tmp; p; p = p->next) {
     char buf[LONG_STRING];
 
   for (p = tmp; p; p = p->next) {
     char buf[LONG_STRING];
index 919c3bb..16cbebd 100644 (file)
@@ -138,6 +138,8 @@ int mutt_is_application_pgp (BODY * m)
     return t ? t | PGPINLINE : 0;
 }
 
     return t ? t | PGPINLINE : 0;
 }
 
+#include "mutt.h"
+
 int mutt_is_application_smime (BODY * m)
 {
     char *t = NULL;
 int mutt_is_application_smime (BODY * m)
 {
     char *t = NULL;
index cfba154..229394c 100644 (file)
@@ -56,6 +56,9 @@ do_c() {
 #include <lib-lib/lib-lib.h>
 #include "mime-token.h"
 
 #include <lib-lib/lib-lib.h>
 #include "mime-token.h"
 
+static const struct tok *
+mime_which_token_aux(const char *str, unsigned int len);
+
 %}
 struct tok { const char *name; int val; };
 %%
 %}
 struct tok { const char *name; int val; };
 %%
diff --git a/send.c b/send.c
index 27db967..ace09c0 100644 (file)
--- a/send.c
+++ b/send.c
 
 #include <lib-mime/mime.h>
 #include <lib-mime/rfc3676.h>
 
 #include <lib-mime/mime.h>
 #include <lib-mime/rfc3676.h>
+#include <lib-sys/unix.h>
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 
 #include <lib-ui/curses.h>
 #include <lib-ui/enter.h>
 
-#include "mutt.h"
 #include "alias.h"
 #include "keymap.h"
 #include "copy.h"
 #include "alias.h"
 #include "keymap.h"
 #include "copy.h"
@@ -281,7 +281,7 @@ static int edit_envelope (ENVELOPE * en, int flags)
 }
 
 #ifdef USE_NNTP
 }
 
 #ifdef USE_NNTP
-char *nntp_get_header(const char *s)
+static char *nntp_get_header(const char *s)
 {
     return m_strdup(skipspaces(s));
 }
 {
     return m_strdup(skipspaces(s));
 }
@@ -577,8 +577,8 @@ void mutt_fix_reply_recipients (ENVELOPE * env)
   }
 
   /* the CC field can get cluttered, especially with lists */
   }
 
   /* the CC field can get cluttered, especially with lists */
-  address_list_uniq(&env->to);
-  address_list_uniq(&env->cc);
+  address_list_uniq(env->to);
+  address_list_uniq(env->cc);
   env->cc = mutt_remove_xrefs (env->to, env->cc);
 
   if (env->cc && !env->to) {
   env->cc = mutt_remove_xrefs (env->to, env->cc);
 
   if (env->cc && !env->to) {
@@ -904,7 +904,7 @@ void mutt_set_followup_to (ENVELOPE * e)
       }
     }
 
       }
     }
 
-    address_list_uniq(&e->mail_followup_to);
+    address_list_uniq(e->mail_followup_to);
 
   }
 }
 
   }
 }