]> granicus.if.org Git - neomutt/commitdiff
tidy source
authorRichard Russon <rich@flatcap.org>
Wed, 23 Oct 2019 18:20:38 +0000 (19:20 +0100)
committerRichard Russon <rich@flatcap.org>
Sun, 27 Oct 2019 01:14:58 +0000 (01:14 +0000)
- move once-used symbol
- move statics to the top
- kill blank lines
- correct grammar in log
- reduce scope of variable
- add doxygen comments

21 files changed:
conn/ssl_gnutls.c
copy.c
enter.c
hdrline.c
keymap.c
mbox/mbox.c
mutt/charset.c
mutt/string.c
mutt_lua.c
muttlib.c
muttlib.h
ncrypt/pgpkey.c
nntp/nntp.c
notmuch/mutt_notmuch.c
pattern.c
pop/pop_lib.c
postpone.c
recvcmd.c
remailer.c
send.c
sendlib.c

index 31ccba7826aa2a10de67532faf3ac09ff4249d54..98e12bf5a910f8a6e62f98bbbd741325650df187 100644 (file)
@@ -67,6 +67,19 @@ const int dialog_row_len = 128;
 
 static int tls_socket_close(struct Connection *conn);
 
+#ifndef HAVE_GNUTLS_PRIORITY_SET_DIRECT
+/* This array needs to be large enough to hold all the possible values support
+ * by NeoMutt.  The initialized values are just placeholders--the array gets
+ * overwrriten in tls_negotiate() depending on the $ssl_use_* options.
+ *
+ * Note: gnutls_protocol_set_priority() was removed in GnuTLS version
+ * 3.4 (2015-04).  TLS 1.3 support wasn't added until version 3.6.5.
+ * Therefore, no attempt is made to support $ssl_use_tlsv1_3 in this code.
+ */
+static int protocol_priority[] = { GNUTLS_TLS1_2, GNUTLS_TLS1_1, GNUTLS_TLS1,
+                                   GNUTLS_SSL3, 0 };
+#endif
+
 /**
  * struct TlsSockData - TLS socket data
  */
@@ -952,18 +965,8 @@ cleanup:
   mutt_buffer_pool_release(&priority);
   return rv;
 }
-#else
-/* This array needs to be large enough to hold all the possible values support
- * by NeoMutt.  The initialized values are just placeholders--the array gets
- * overwrriten in tls_negotiate() depending on the $ssl_use_* options.
- *
- * Note: gnutls_protocol_set_priority() was removed in GnuTLS version
- * 3.4 (2015-04).  TLS 1.3 support wasn't added until version 3.6.5.
- * Therefore, no attempt is made to support $ssl_use_tlsv1_3 in this code.
- */
-static int protocol_priority[] = { GNUTLS_TLS1_2, GNUTLS_TLS1_1, GNUTLS_TLS1,
-                                   GNUTLS_SSL3, 0 };
 
+#else
 /**
  * tls_set_priority - Set the priority of various protocols
  * @param data TLS socket data
diff --git a/copy.c b/copy.c
index ccb25e8ac8bcfe9380cdabfaeaa6b6f627343f7b..6e6dc0c836c04be0261ca099fe31c1a14b8b8497 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -122,7 +122,6 @@ int mutt_copy_hdr(FILE *fp_in, FILE *fp_out, LOFF_T off_start, LOFF_T off_end,
         }
         else if ((chflags & CH_NOQFROM) && mutt_str_startswith(buf, ">From ", CASE_IGNORE))
           continue;
-
         else if ((buf[0] == '\n') || ((buf[0] == '\r') && (buf[1] == '\n')))
           break; /* end of header */
 
@@ -173,7 +172,7 @@ int mutt_copy_hdr(FILE *fp_in, FILE *fp_out, LOFF_T off_start, LOFF_T off_end,
     }
   }
 
-  mutt_debug(LL_DEBUG1, "WEED is %s\n", (chflags & CH_WEED) ? "Set" : "Not");
+  mutt_debug(LL_DEBUG1, "WEED is %sset\n", (chflags & CH_WEED) ? "" : "not ");
 
   headers = mutt_mem_calloc(hdr_count, sizeof(char *));
 
@@ -617,7 +616,6 @@ int mutt_copy_message_fp(FILE *fp_out, FILE *fp_in, struct Email *e,
   {
     if (cmflags & MUTT_CM_PREFIX)
       chflags |= CH_PREFIX;
-
     else if (e->attach_del && (chflags & CH_UPDATE_LEN))
     {
       int new_lines;
diff --git a/enter.c b/enter.c
index 0c86de0e8f50b44543514964173e6e20cf54762b..702ee3cc48daa5e37f40750520142ea77412bd08 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -692,7 +692,6 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col,
 
             replace_part(state, 0, buf);
           }
-
 #endif
           else
             goto self_insert;
index 815033af37d73097697827d491531c463a359c98..d8bdb77d0292c74694e197637aaca4d6de592f07 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -93,6 +93,21 @@ enum CryptChars
   FLAG_CHAR_CRYPT_NO_CRYPTO, ///< Character denoting a message has no cryptography information
 };
 
+/**
+ * enum FieldType - Header types
+ *
+ * Strings for printing headers
+ */
+enum FieldType
+{
+  DISP_TO,    ///< To: string
+  DISP_CC,    ///< Cc: string
+  DISP_BCC,   ///< Bcc: string
+  DISP_FROM,  ///< From: string
+  DISP_PLAIN, ///< Empty string
+  DISP_MAX,
+};
+
 /**
  * mutt_is_mail_list - Is this the email address of a mailing list?
  * @param addr Address to test
@@ -230,21 +245,6 @@ static size_t add_index_color(char *buf, size_t buflen, MuttFormatFlags flags, c
   return 2;
 }
 
-/**
- * enum FieldType - Header types
- *
- * Strings for printing headers
- */
-enum FieldType
-{
-  DISP_TO,    ///< To: string
-  DISP_CC,    ///< Cc: string
-  DISP_BCC,   ///< Bcc: string
-  DISP_FROM,  ///< From: string
-  DISP_PLAIN, ///< Empty string
-  DISP_MAX,
-};
-
 /**
  * get_nth_wchar - Extract one char from a multi-byte table
  * @param table  Multi-byte table
index a6b64515a3fb5f00f9ca8dfdc5a5ef8fcfc3266c..c2257667abe3612e9c8ee95b385ead3866bdfdbc 100644 (file)
--- a/keymap.c
+++ b/keymap.c
@@ -148,6 +148,53 @@ int LastKey; /**< contains the last key the user pressed */
 
 struct Keymap *Keymaps[MENU_MAX];
 
+#ifdef NCURSES_VERSION
+/**
+ * struct Extkey - Map key names from NeoMutt's style to Curses style
+ */
+struct Extkey
+{
+  const char *name;
+  const char *sym;
+};
+
+static const struct Extkey ExtKeys[] = {
+  { "<c-up>", "kUP5" },
+  { "<s-up>", "kUP" },
+  { "<a-up>", "kUP3" },
+
+  { "<s-down>", "kDN" },
+  { "<a-down>", "kDN3" },
+  { "<c-down>", "kDN5" },
+
+  { "<c-right>", "kRIT5" },
+  { "<s-right>", "kRIT" },
+  { "<a-right>", "kRIT3" },
+
+  { "<s-left>", "kLFT" },
+  { "<a-left>", "kLFT3" },
+  { "<c-left>", "kLFT5" },
+
+  { "<s-home>", "kHOM" },
+  { "<a-home>", "kHOM3" },
+  { "<c-home>", "kHOM5" },
+
+  { "<s-end>", "kEND" },
+  { "<a-end>", "kEND3" },
+  { "<c-end>", "kEND5" },
+
+  { "<s-next>", "kNXT" },
+  { "<a-next>", "kNXT3" },
+  { "<c-next>", "kNXT5" },
+
+  { "<s-prev>", "kPRV" },
+  { "<a-prev>", "kPRV3" },
+  { "<c-prev>", "kPRV5" },
+
+  { 0, 0 },
+};
+#endif
+
 /**
  * alloc_keys - Allocate space for a sequence of keys
  * @param len  Number of keys
@@ -818,51 +865,6 @@ struct Keymap *km_find_func(enum MenuType menu, int func)
 }
 
 #ifdef NCURSES_VERSION
-/**
- * struct Extkey - Map key names from NeoMutt's style to Curses style
- */
-struct Extkey
-{
-  const char *name;
-  const char *sym;
-};
-
-static const struct Extkey ExtKeys[] = {
-  { "<c-up>", "kUP5" },
-  { "<s-up>", "kUP" },
-  { "<a-up>", "kUP3" },
-
-  { "<s-down>", "kDN" },
-  { "<a-down>", "kDN3" },
-  { "<c-down>", "kDN5" },
-
-  { "<c-right>", "kRIT5" },
-  { "<s-right>", "kRIT" },
-  { "<a-right>", "kRIT3" },
-
-  { "<s-left>", "kLFT" },
-  { "<a-left>", "kLFT3" },
-  { "<c-left>", "kLFT5" },
-
-  { "<s-home>", "kHOM" },
-  { "<a-home>", "kHOM3" },
-  { "<c-home>", "kHOM5" },
-
-  { "<s-end>", "kEND" },
-  { "<a-end>", "kEND3" },
-  { "<c-end>", "kEND5" },
-
-  { "<s-next>", "kNXT" },
-  { "<a-next>", "kNXT3" },
-  { "<c-next>", "kNXT5" },
-
-  { "<s-prev>", "kPRV" },
-  { "<a-prev>", "kPRV3" },
-  { "<c-prev>", "kPRV5" },
-
-  { 0, 0 },
-};
-
 /**
  * find_ext_name - Find the curses name for a key
  * @param key Key name
index 69d5e33727eadc5fac2655d2393a3b08916f6085..57f989f09de7182efedb49010fe0557663862df0 100644 (file)
@@ -915,7 +915,7 @@ static FILE *mbox_open_readwrite(struct Mailbox *m)
 }
 
 /**
- * mbox_open_readwrite - Open an mbox read-only
+ * mbox_open_readonly - Open an mbox read-only
  * @param m Mailbox
  * @retval ptr FILE handle
  *
index 900aea32014d03fac4a1845a230c3f5027bd17d9..69fbd988af8c9bbc4a52157a2e0731e6f56a806e 100644 (file)
@@ -79,35 +79,6 @@ TAILQ_HEAD(LookupList, Lookup);
 
 static struct LookupList Lookups = TAILQ_HEAD_INITIALIZER(Lookups);
 
-/**
- * lookup_new - Create a new Lookup
- * @retval ptr New Lookup
- */
-struct Lookup *lookup_new(void)
-{
-  return mutt_mem_calloc(1, sizeof(struct Lookup));
-}
-
-/**
- * lookup_free - Free a Lookup
- * @param ptr Lookup to free
- */
-void lookup_free(struct Lookup **ptr)
-{
-  if (!ptr || !*ptr)
-    return;
-
-  struct Lookup *l = *ptr;
-  FREE(&l->replacement);
-  FREE(&l->regex.pattern);
-  if (l->regex.regex)
-    regfree(l->regex.regex);
-  FREE(&l->regex.regex);
-  FREE(&l->regex);
-
-  FREE(ptr);
-}
-
 // clang-format off
 /**
  * PreferredMimeNames - Lookup table of preferred charsets
@@ -263,6 +234,35 @@ const struct MimeNames PreferredMimeNames[] =
 };
 // clang-format on
 
+/**
+ * lookup_new - Create a new Lookup
+ * @retval ptr New Lookup
+ */
+struct Lookup *lookup_new(void)
+{
+  return mutt_mem_calloc(1, sizeof(struct Lookup));
+}
+
+/**
+ * lookup_free - Free a Lookup
+ * @param ptr Lookup to free
+ */
+void lookup_free(struct Lookup **ptr)
+{
+  if (!ptr || !*ptr)
+    return;
+
+  struct Lookup *l = *ptr;
+  FREE(&l->replacement);
+  FREE(&l->regex.pattern);
+  if (l->regex.regex)
+    regfree(l->regex.regex);
+  FREE(&l->regex.regex);
+  FREE(&l->regex);
+
+  FREE(ptr);
+}
+
 /**
  * lookup_charset - Look for a preferred character set name
  * @param type Type, e.g. #MUTT_LOOKUP_CHARSET
index 4a582d7c351a3c183f7f96518fa5a137fceb86c6..afbb91fc99c45b2f7c36ec8e22ed0e81aff756c8 100644 (file)
 #include <sysexits.h>
 #endif
 
+/**
+ * char_cmp - Pointer to a function taking two characters and returning bool
+ */
+typedef bool (*char_cmp)(char, char);
+
 /**
  * struct SysExits - Lookup table of error messages
  */
@@ -142,11 +147,6 @@ static inline bool char_cmp_lower(char a, char b)
   return tolower((unsigned char) a) == tolower((unsigned char) b);
 }
 
-/**
- * char_cmp - Pointer to a function taking two characters and returning bool
- */
-typedef bool (*char_cmp)(char, char);
-
 /**
  * get_char_cmp - Retrieve the correct function to compare characters according to a case sensitivity setting
  * @param cs Case sensitivity setting
index eef3b6db06bfcfea0ec3d129c94e6bb4ea8a8cc2..2f3326e8881fa734c25b3bd68a9d577a67f30f99 100644 (file)
@@ -351,6 +351,8 @@ static void lua_expose_command(void *p, const struct Command *cmd)
   (void) luaL_dostring(l, buf);
 }
 
+lua_State *LuaState = NULL;
+
 static const luaL_Reg luaMuttDecl[] = {
   { "set", lua_mutt_set },       { "get", lua_mutt_get },
   { "call", lua_mutt_call },     { "enter", lua_mutt_enter },
@@ -423,10 +425,6 @@ static bool lua_init(lua_State **l)
   return true;
 }
 
-/* Public API --------------------------------------------------------------- */
-
-lua_State *LuaState = NULL;
-
 /**
  * mutt_lua_parse - Parse the 'lua' command - Implements ::command_t
  */
index 12fa9dc56d4465f65d5397212b392246f73a96bc..cf28d04d767306a33f9125f029e87ed701d8ba53 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
 /* These Config Variables are only used in muttlib.c */
 struct Regex *C_GecosMask; ///< Config: Regex for parsing GECOS field of /etc/passwd
 
+static FILE *fp_random;
+
+static const unsigned char base32[] = "abcdefghijklmnopqrstuvwxyz234567";
+
 static const char *xdg_env_vars[] = {
   [XDG_CONFIG_HOME] = "XDG_CONFIG_HOME",
   [XDG_CONFIG_DIRS] = "XDG_CONFIG_DIRS",
@@ -458,8 +462,6 @@ bool mutt_is_text_part(struct Body *b)
   return false;
 }
 
-static FILE *fp_random;
-
 /**
  * mutt_randbuf - Fill a buffer with randomness
  * @param buf    Buffer for result
@@ -505,8 +507,6 @@ int mutt_randbuf(void *buf, size_t buflen)
   return 0;
 }
 
-static const unsigned char base32[] = "abcdefghijklmnopqrstuvwxyz234567";
-
 /**
  * mutt_rand_base32 - Fill a buffer with a base32-encoded random string
  * @param buf    Buffer for result
index 9628421dd517beb8f74d9b560a6baf66fc34d592..2b02b0b43d801cc2b5437e820e21b3873185cb0e 100644 (file)
--- a/muttlib.h
+++ b/muttlib.h
@@ -40,8 +40,6 @@ struct stat;
 /* These Config Variables are only used in muttlib.c */
 extern struct Regex *C_GecosMask;
 
-#define MUTT_RANDTAG_LEN 16
-
 void        mutt_adv_mktemp(struct Buffer *buf);
 void        mutt_buffer_mktemp_full(struct Buffer *buf, const char *prefix, const char *suffix, const char *src, int line);
 void        mutt_buffer_encode_path(struct Buffer *buf, const char *src);
index 9a39ad6b68b58cef0cd86854321f362c0fb607ec..70e8b2102163c225b1902820076147e8344b07f1 100644 (file)
@@ -79,6 +79,15 @@ struct PgpCache
   struct PgpCache *next;
 };
 
+/**
+ * struct PgpEntry - An entry in a PGP key menu
+ */
+struct PgpEntry
+{
+  size_t num;
+  struct PgpUid *uid;
+};
+
 static struct PgpCache *id_defaults = NULL;
 
 static const char trust_flags[] = "?- +";
@@ -156,15 +165,6 @@ static struct PgpKeyInfo *pgp_principal_key(struct PgpKeyInfo *key)
     return key;
 }
 
-/**
- * struct PgpEntry - An entry in a PGP key menu
- */
-struct PgpEntry
-{
-  size_t num;
-  struct PgpUid *uid;
-};
-
 /**
  * pgp_entry_fmt - Format an entry on the PGP key selection menu - Implements ::format_t
  *
index 0ced104130443f53fa8f775c2de85f37533b9c63..299e8263bf87cc1b2a79ee26d6ce00d138d8963c 100644 (file)
@@ -629,7 +629,6 @@ static int nntp_auth(struct NntpAccountData *adata)
         if (*buf == '5')
           continue;
       }
-
       else
       {
 #ifdef USE_SASL
index 3e55dac126cc5bf2add82e565c0e2189ace1f863..f23d3e98dd2c1ddebd5037b7c00edfae7c4fd61d 100644 (file)
@@ -511,7 +511,6 @@ static char *get_query_string(struct NmMboxData *mdata, bool window)
     }
     else if (strcmp(item->name, "type") == 0)
       mdata->query_type = string_to_query_type(item->value);
-
     else if (strcmp(item->name, "query") == 0)
       mdata->db_query = mutt_str_strdup(item->value);
   }
index 6fcfccb4a3f49e14a77fda423a35f6a12a734bf8..d9527f7a2bf3f34d98bc6ff380fe580e838edbbc 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -199,6 +199,13 @@ static struct PatternList *SearchPattern = NULL; /**< current search pattern */
 static char LastSearch[256] = { 0 };      /**< last pattern searched for */
 static char LastSearchExpn[1024] = { 0 }; /**< expanded version of LastSearch */
 
+/**
+ * typedef addr_predicate_t - Test an Address for some condition
+ * @param a Address to test
+ * @retval bool True if Address matches the test
+ */
+typedef bool (*addr_predicate_t)(const struct Address *a);
+
 /**
  * eat_regex - Parse a regex - Implements ::pattern_eat_t
  */
@@ -1725,13 +1732,6 @@ static bool match_reference(struct Pattern *pat, struct ListHead *refs)
   return false;
 }
 
-/**
- * typedef addr_predicate_t - Test an Address for some condition
- * @param a Address to test
- * @retval bool True if Address matches the test
- */
-typedef bool (*addr_predicate_t)(const struct Address *a);
-
 /**
  * mutt_is_predicate_recipient - Test an Envelopes Addresses using a predicate function
  * @param all_addr If true, ALL Addresses must match
index 6ac6baaeaba4ac6969990139f716ff5fe7659c40..e20708c9d28f881c0b72773349e72ebc39d63786 100644 (file)
@@ -132,16 +132,12 @@ static int fetch_capa(const char *line, void *data)
     const char *c = mutt_str_skip_email_wsp(line + 4);
     mutt_buffer_strcpy(&adata->auth_list, c);
   }
-
   else if (mutt_str_startswith(line, "STLS", CASE_IGNORE))
     adata->cmd_stls = true;
-
   else if (mutt_str_startswith(line, "USER", CASE_IGNORE))
     adata->cmd_user = 1;
-
   else if (mutt_str_startswith(line, "UIDL", CASE_IGNORE))
     adata->cmd_uidl = 1;
-
   else if (mutt_str_startswith(line, "TOP", CASE_IGNORE))
     adata->cmd_top = 1;
 
index 1661c132366b5ff7bbff584efde539fae5259d12..6d54c987451e1c8d5fd718a5e0fd3fe6bf55b8be 100644 (file)
@@ -409,7 +409,6 @@ int mutt_get_postponed(struct Context *ctx, struct Email *hdr,
       hdr->security = mutt_parse_crypt_hdr(strchr(np->data, ':') + 1, true, APPLICATION_SMIME);
       hdr->security |= APPLICATION_SMIME;
     }
-
 #ifdef MIXMASTER
     else if (mutt_str_startswith(np->data, "X-Mutt-Mix:", CASE_MATCH))
     {
@@ -423,7 +422,6 @@ int mutt_get_postponed(struct Context *ctx, struct Email *hdr,
       }
     }
 #endif
-
     else
     {
       // skip header removal
index 00c655479f29f53d5fbdd4a3f9d21ff9aeff17f6..381febe3c909b8ec75159adc04ce2581e38d1b0a 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -910,7 +910,6 @@ void mutt_attach_reply(FILE *fp, struct Email *e, struct AttachCtx *actx,
   struct Email *e_parent = NULL;
   FILE *fp_parent = NULL;
   struct Email *e_tmp = NULL;
-  struct State st;
   FILE *fp_tmp = NULL;
   struct Buffer *tmpbody = NULL;
 
@@ -987,6 +986,7 @@ void mutt_attach_reply(FILE *fp, struct Email *e, struct AttachCtx *actx,
   {
     mutt_make_attribution(Context->mailbox, e_parent, fp_tmp);
 
+    struct State st;
     memset(&st, 0, sizeof(struct State));
     st.fp_out = fp_tmp;
 
index f31a027c58ee8df264bd56a698c74e736ea7922a..5cd5799e5045e8d3e8f67dfcd25188a76e8307ac 100644 (file)
@@ -72,6 +72,12 @@ struct Coord
   short c; /**< column */
 };
 
+static const struct Mapping RemailerHelp[] = {
+  { N_("Append"), OP_MIX_APPEND }, { N_("Insert"), OP_MIX_INSERT },
+  { N_("Delete"), OP_MIX_DELETE }, { N_("Abort"), OP_EXIT },
+  { N_("OK"), OP_MIX_USE },        { NULL, 0 },
+};
+
 /**
  * mix_get_caps - Get Mixmaster Capabilities
  * @param capstr Capability string to parse
@@ -552,12 +558,6 @@ static int mix_chain_add(struct MixChain *chain, const char *s, struct Remailer
   return 0;
 }
 
-static const struct Mapping RemailerHelp[] = {
-  { N_("Append"), OP_MIX_APPEND }, { N_("Insert"), OP_MIX_INSERT },
-  { N_("Delete"), OP_MIX_DELETE }, { N_("Abort"), OP_EXIT },
-  { N_("OK"), OP_MIX_USE },        { NULL, 0 },
-};
-
 /**
  * mix_make_chain - Create a Mixmaster chain
  * @param win       Window
diff --git a/send.c b/send.c
index 55cf05f42d6c8b99b6f76d3c3fbb19bdad0752a7..b2abd6de3d4b03a72c49ff34a460519dd4122016 100644 (file)
--- a/send.c
+++ b/send.c
@@ -704,6 +704,12 @@ static int include_reply(struct Mailbox *m, struct Email *e, FILE *fp_out)
   return 0;
 }
 
+/**
+ * choose_default_to - Pick the best 'to:' value
+ * @param from From Address
+ * @param env  Envelope
+ * @retval ptr Addresses to use
+ */
 static const struct AddressList *choose_default_to(const struct Address *from,
                                                    const struct Envelope *env)
 {
index 56b55d2c873872d8c69ae890d25350de3aa4d9ef..b13d3691a7a6c8d9282e636b22ff2d2593429768 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -97,6 +97,51 @@ bool C_UseEnvelopeFrom; ///< Config: Set the envelope sender of the message
 bool C_UserAgent;       ///< Config: Add a 'User-Agent' head to outgoing mail
 short C_WrapHeaders;    ///< Config: Width to wrap headers in outgoing messages
 
+#define MUTT_RANDTAG_LEN 16
+
+/**
+ * struct B64Context - Cursor for the Base64 conversion
+ */
+struct B64Context
+{
+  char buffer[3];
+  short size;
+  short linelen;
+};
+
+/**
+ * struct ContentState - Info about the body of an email
+ */
+struct ContentState
+{
+  bool from;
+  int whitespace;
+  bool dot;
+  int linelen;
+  bool was_cr;
+};
+
+/**
+ * The next array/enum pair is used to to keep track of user headers that
+ * override pre-defined headers NeoMutt would emit. Keep the array sorted and
+ * in sync with the enum.
+ */
+static const char *const userhdrs_override_headers[] = {
+  "content-type:",
+  "user-agent:",
+};
+
+enum UserHdrsOverrideIdx
+{
+  USERHDRS_OVERRIDE_CONTENT_TYPE,
+  USERHDRS_OVERRIDE_USER_AGENT,
+};
+
+struct UserHdrsOverride
+{
+  bool is_overridden[mutt_array_size(userhdrs_override_headers)];
+};
+
 /**
  * encode_quoted - Encode text as quoted printable
  * @param fc     Cursor for converting a file's encoding
@@ -231,16 +276,6 @@ static void encode_quoted(struct FgetConv *fc, FILE *fp_out, bool istext)
   }
 }
 
-/**
- * struct B64Context - Cursor for the Base64 conversion
- */
-struct B64Context
-{
-  char buffer[3];
-  short size;
-  short linelen;
-};
-
 /**
  * b64_init - Set up the base64 conversion
  * @param bctx Cursor for the base64 conversion
@@ -610,18 +645,6 @@ void mutt_generate_boundary(struct ParameterList *pl)
   mutt_param_set(pl, "boundary", rs);
 }
 
-/**
- * struct ContentState - Info about the body of an email
- */
-struct ContentState
-{
-  bool from;
-  int whitespace;
-  bool dot;
-  int linelen;
-  bool was_cr;
-};
-
 /**
  * update_content_info - Cache some info about an email
  * @param info   Info about an Attachment
@@ -2209,27 +2232,6 @@ out:
   return rc;
 }
 
-/**
- * The next array/enum pair is used to to keep track of user headers that
- * override pre-defined headers NeoMutt would emit. Keep the array sorted and
- * in sync with the enum.
- */
-static const char *const userhdrs_override_headers[] = {
-  "content-type:",
-  "user-agent:",
-};
-
-enum UserHdrsOverrideIdx
-{
-  USERHDRS_OVERRIDE_CONTENT_TYPE,
-  USERHDRS_OVERRIDE_USER_AGENT,
-};
-
-struct UserHdrsOverride
-{
-  bool is_overridden[mutt_array_size(userhdrs_override_headers)];
-};
-
 /**
  * userhdrs_override_cmp - Compare a user-defined header with an element of the userhdrs_override_headers list
  * @param a Pointer to the string containing the user-defined header