From: Pietro Cerutti Date: Thu, 12 Sep 2019 13:38:31 +0000 (+0000) Subject: Unclobber mutt_parse headers X-Git-Tag: 2019-10-25~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d5e1240692b27444aaebcbbe4fa165f73df7d9f;p=neomutt Unclobber mutt_parse headers --- diff --git a/globals.h b/globals.h index fbfd896da..7ea5cd428 100644 --- a/globals.h +++ b/globals.h @@ -71,11 +71,6 @@ WHERE struct ListHead SidebarWhitelist INITVAL(STAILQ_HEAD_INITIALIZER(SidebarWh WHERE struct ListHead TempAttachmentsList INITVAL(STAILQ_HEAD_INITIALIZER(TempAttachmentsList)); ///< List of temporary files for displaying attachments WHERE struct ListHead UserHeader INITVAL(STAILQ_HEAD_INITIALIZER(UserHeader)); ///< List of custom headers to add to outgoing emails -/* Lists of AttachMatch */ -WHERE struct ListHead AttachAllow INITVAL(STAILQ_HEAD_INITIALIZER(AttachAllow)); ///< List of attachment types to be counted -WHERE struct ListHead AttachExclude INITVAL(STAILQ_HEAD_INITIALIZER(AttachExclude)); ///< List of attachment types to be ignored -WHERE struct ListHead InlineAllow INITVAL(STAILQ_HEAD_INITIALIZER(InlineAllow)); ///< List of inline types to counted -WHERE struct ListHead InlineExclude INITVAL(STAILQ_HEAD_INITIALIZER(InlineExclude)); ///< List of inline types to ignore WHERE struct RegexList Alternates INITVAL(STAILQ_HEAD_INITIALIZER(Alternates)); ///< List of regexes to match the user's alternate email addresses WHERE struct RegexList UnAlternates INITVAL(STAILQ_HEAD_INITIALIZER(UnAlternates)); ///< List of regexes to blacklist false matches in Alternates diff --git a/init.c b/init.c index 21abc5be5..0e49a753a 100644 --- a/init.c +++ b/init.c @@ -54,6 +54,7 @@ #include "keymap.h" #include "monitor.h" #include "mutt_menu.h" +#include "mutt_parse.h" #include "mutt_window.h" #include "mx.h" #include "myvar.h" diff --git a/mutt.h b/mutt.h index b765775a5..84cb22a19 100644 --- a/mutt.h +++ b/mutt.h @@ -123,19 +123,6 @@ enum MessageType int mutt_init(bool skip_sys_rc, struct ListHead *commands); struct ConfigSet *init_config(size_t size); -/** - * struct AttachMatch - An attachment matching a regex - * - * for attachment counter - */ -struct AttachMatch -{ - const char *major; - enum ContentType major_int; - const char *minor; - regex_t minor_regex; -}; - #define EXEC_SHELL "/bin/sh" char *mutt_compile_help(char *buf, size_t buflen, enum MenuType menu, const struct Mapping *items); diff --git a/mutt_parse.c b/mutt_parse.c index e7087019c..6cae4d618 100644 --- a/mutt_parse.c +++ b/mutt_parse.c @@ -32,12 +32,15 @@ #include #include "mutt/mutt.h" #include "email/lib.h" -#include "mutt.h" #include "mutt_parse.h" -#include "globals.h" #include "mx.h" #include "ncrypt/ncrypt.h" +struct ListHead AttachAllow = STAILQ_HEAD_INITIALIZER(AttachAllow); ///< List of attachment types to be counted +struct ListHead AttachExclude = STAILQ_HEAD_INITIALIZER(AttachExclude); ///< List of attachment types to be ignored +struct ListHead InlineAllow = STAILQ_HEAD_INITIALIZER(InlineAllow); ///< List of inline types to counted +struct ListHead InlineExclude = STAILQ_HEAD_INITIALIZER(InlineExclude); ///< List of inline types to ignore + /** * mutt_parse_mime_message - Parse a MIME email * @param m Mailbox diff --git a/mutt_parse.h b/mutt_parse.h index d07b82204..f4a5ab476 100644 --- a/mutt_parse.h +++ b/mutt_parse.h @@ -23,9 +23,27 @@ #ifndef MUTT_MUTT_PARSE_H #define MUTT_MUTT_PARSE_H +#include "mutt/queue.h" + struct Email; struct Mailbox; +/** + * struct AttachMatch - An attachment matching a regex for attachment counter + */ +struct AttachMatch +{ + const char *major; + enum ContentType major_int; + const char *minor; + regex_t minor_regex; +}; + +extern struct ListHead AttachAllow; +extern struct ListHead AttachExclude; +extern struct ListHead InlineAllow; +extern struct ListHead InlineExclude; + int mutt_count_body_parts(struct Mailbox *m, struct Email *e); void mutt_parse_mime_message(struct Mailbox *m, struct Email *e);