From: Richard Russon Date: Sun, 8 Jul 2018 14:18:26 +0000 (+0100) Subject: split mutt.h X-Git-Tag: 2019-10-25~758^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c734eb2764fdc75bd06bc975c65b768a6a869721;p=neomutt split mutt.h --- diff --git a/browser.h b/browser.h index be1b87156..d95948389 100644 --- a/browser.h +++ b/browser.h @@ -36,6 +36,12 @@ extern bool ShowOnlyUnread; extern short SortBrowser; extern char *VfolderFormat; +/* flags to mutt_select_file() */ +#define MUTT_SEL_BUFFY (1 << 0) +#define MUTT_SEL_MULTI (1 << 1) +#define MUTT_SEL_FOLDER (1 << 2) +#define MUTT_SEL_VFOLDER (1 << 3) + /** * struct FolderFile - Browser entry representing a folder/dir */ diff --git a/compose.c b/compose.c index 47bf8aac9..1316d057c 100644 --- a/compose.c +++ b/compose.c @@ -33,7 +33,9 @@ #include "email/email.h" #include "conn/conn.h" #include "mutt.h" +#include "compose.h" #include "alias.h" +#include "browser.h" #include "context.h" #include "curs_lib.h" #include "curs_main.h" diff --git a/compose.h b/compose.h index 54dc8e023..edda97f9e 100644 --- a/compose.h +++ b/compose.h @@ -32,6 +32,9 @@ extern char * ComposeFormat; extern char * Ispell; extern unsigned char Postpone; +/* flags for mutt_compose_menu() */ +#define MUTT_COMPOSE_NOFREEHEADER (1 << 0) + int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, struct Header *cur, int flags); #endif /* MUTT_COMPOSE_H */ diff --git a/curs_lib.h b/curs_lib.h index a16f02327..d0121aef6 100644 --- a/curs_lib.h +++ b/curs_lib.h @@ -33,6 +33,11 @@ struct Pager; /* These Config Variables are only used in curs_lib.c */ extern bool MetaKey; /**< interpret ALT-x as ESC-x */ +/* For mutt_simple_format() justifications */ +#define FMT_LEFT -1 +#define FMT_CENTER 0 +#define FMT_RIGHT 1 + bool message_is_tagged(struct Context *ctx, int index); bool message_is_visible(struct Context *ctx, int index); int mutt_addwch(wchar_t wc); diff --git a/curs_main.c b/curs_main.c index 6d46a3be1..d4793e15d 100644 --- a/curs_main.c +++ b/curs_main.c @@ -61,6 +61,7 @@ #include "query.h" #include "recvattach.h" #include "score.h" +#include "send.h" #include "sort.h" #include "status.h" #include "terminal.h" diff --git a/hdrline.c b/hdrline.c index e41db6e3f..c4ff6c0e5 100644 --- a/hdrline.c +++ b/hdrline.c @@ -32,6 +32,7 @@ #include "mutt/mutt.h" #include "email/email.h" #include "mutt.h" +#include "hdrline.h" #include "alias.h" #include "context.h" #include "format_flags.h" diff --git a/hdrline.h b/hdrline.h index 2863b99ab..1023383e9 100644 --- a/hdrline.h +++ b/hdrline.h @@ -37,6 +37,16 @@ extern struct MbTable *FlagChars; extern struct MbTable *FromChars; extern struct MbTable *ToChars; +/** + * struct HdrFormatInfo - Data passed to index_format_str() + */ +struct HdrFormatInfo +{ + struct Context *ctx; + struct Header *hdr; + const char *pager_progress; +}; + bool mutt_is_mail_list(struct Address *addr); bool mutt_is_subscribed_list(struct Address *addr); void mutt_make_string_flags(char *buf, size_t buflen, const char *s, struct Context *ctx, struct Header *hdr, enum FormatFlag flags); diff --git a/main.c b/main.c index 20fad6f73..e7737ae77 100644 --- a/main.c +++ b/main.c @@ -61,6 +61,7 @@ #include "ncrypt/ncrypt.h" #include "options.h" #include "protos.h" +#include "send.h" #include "terminal.h" #include "url.h" #include "version.h" diff --git a/mutt.h b/mutt.h index e198d9d36..fda61329b 100644 --- a/mutt.h +++ b/mutt.h @@ -121,13 +121,6 @@ struct Mapping; #define MUTT_SPECIAL_INDEX MUTT_TREE_MAX -#define MUTT_THREAD_COLLAPSE (1 << 0) -#define MUTT_THREAD_UNCOLLAPSE (1 << 1) -#define MUTT_THREAD_GET_HIDDEN (1 << 2) -#define MUTT_THREAD_UNREAD (1 << 3) -#define MUTT_THREAD_NEXT_UNREAD (1 << 4) -#define MUTT_THREAD_FLAGGED (1 << 5) - /** * enum MuttMisc - Unsorted flags */ @@ -232,39 +225,12 @@ enum QuadOptionResponse MUTT_ASKYES }; -/* flags to ci_send_message() */ -#define SENDREPLY (1 << 0) -#define SENDGROUPREPLY (1 << 1) -#define SENDLISTREPLY (1 << 2) -#define SENDFORWARD (1 << 3) -#define SENDPOSTPONED (1 << 4) -#define SENDBATCH (1 << 5) -#define SENDMAILX (1 << 6) -#define SENDKEY (1 << 7) -#define SENDRESEND (1 << 8) -#define SENDPOSTPONEDFCC (1 << 9) /**< used by mutt_get_postponed() to signal that the x-mutt-fcc header field was present */ -#define SENDNOFREEHEADER (1 << 10) /**< Used by the -E flag */ -#define SENDDRAFTFILE (1 << 11) /**< Used by the -H flag */ -#define SENDNEWS (1 << 12) - -/* flags for mutt_compose_menu() */ -#define MUTT_COMPOSE_NOFREEHEADER (1 << 0) - -/* flags to mutt_select_file() */ -#define MUTT_SEL_BUFFY (1 << 0) -#define MUTT_SEL_MULTI (1 << 1) -#define MUTT_SEL_FOLDER (1 << 2) -#define MUTT_SEL_VFOLDER (1 << 3) - /* flags for parse_spam_list */ #define MUTT_SPAM 1 #define MUTT_NOSPAM 2 int mutt_init(bool skip_sys_rc, struct ListHead *commands); -/* flag to mutt_pattern_comp() */ -#define MUTT_FULL_MSG (1 << 0) /* enable body and header matching */ - /** * struct AttachMatch - An attachment matching a regex * @@ -278,15 +244,8 @@ struct AttachMatch regex_t minor_regex; }; -#define MUTT_PARTS_TOPLEVEL (1 << 0) /* is the top-level part */ - #define EXECSHELL "/bin/sh" -/* For mutt_simple_format() justifications */ -#define FMT_LEFT -1 -#define FMT_CENTER 0 -#define FMT_RIGHT 1 - int safe_asprintf(char **, const char *, ...); char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct Mapping *items); @@ -307,6 +266,4 @@ int mutt_query_variables(struct ListHead *queries); bool set_default_value(const char *name, intptr_t value); void reset_value(const char *name); -/* All the variables below are backing for config items */ - #endif /* _MUTT_H */ diff --git a/mutt_thread.h b/mutt_thread.h index e3b52fa10..6aa34312b 100644 --- a/mutt_thread.h +++ b/mutt_thread.h @@ -41,6 +41,13 @@ extern bool SortRe; extern bool StrictThreads; extern bool ThreadReceived; +#define MUTT_THREAD_COLLAPSE (1 << 0) +#define MUTT_THREAD_UNCOLLAPSE (1 << 1) +#define MUTT_THREAD_GET_HIDDEN (1 << 2) +#define MUTT_THREAD_UNREAD (1 << 3) +#define MUTT_THREAD_NEXT_UNREAD (1 << 4) +#define MUTT_THREAD_FLAGGED (1 << 5) + int mutt_aside_thread(struct Header *hdr, short dir, short subthreads); #define mutt_next_thread(x) mutt_aside_thread(x, 1, 0) #define mutt_previous_thread(x) mutt_aside_thread(x, 0, 0) diff --git a/pager.c b/pager.c index 5c88916d1..79bdf4bb0 100644 --- a/pager.c +++ b/pager.c @@ -59,6 +59,7 @@ #include "protos.h" #include "recvattach.h" #include "recvcmd.h" +#include "send.h" #include "sort.h" #include "status.h" #include "terminal.h" diff --git a/parse.c b/parse.c index 02c7be884..280f2c2fd 100644 --- a/parse.c +++ b/parse.c @@ -31,6 +31,7 @@ #include "mutt/mutt.h" #include "email/email.h" #include "mutt.h" +#include "parse.h" #include "globals.h" #include "mailbox.h" #include "muttlib.h" diff --git a/parse.h b/parse.h index 5fd0f77ba..44ffcfeca 100644 --- a/parse.h +++ b/parse.h @@ -34,6 +34,8 @@ struct Header; /* These Config Variables are only used in parse.c */ extern char *SpamSeparator; +#define MUTT_PARTS_TOPLEVEL (1 << 0) /* is the top-level part */ + int mutt_check_encoding(const char *c); int mutt_check_mime_type(const char *s); int mutt_count_body_parts(struct Context *ctx, struct Header *hdr); diff --git a/pattern.h b/pattern.h index 68b02c217..91044ccc9 100644 --- a/pattern.h +++ b/pattern.h @@ -35,6 +35,9 @@ struct Context; /* These Config Variables are only used in pattern.c */ extern bool ThoroughSearch; +/* flag to mutt_pattern_comp() */ +#define MUTT_FULL_MSG (1 << 0) /* enable body and header matching */ + /** * struct Pattern - A simple (non-regex) pattern */ diff --git a/postpone.c b/postpone.c index eb918081e..a23ab90b4 100644 --- a/postpone.c +++ b/postpone.c @@ -53,6 +53,7 @@ #include "opcodes.h" #include "options.h" #include "protos.h" +#include "send.h" #include "sort.h" #include "state.h" #ifdef USE_IMAP diff --git a/protos.h b/protos.h index 3fb7120de..0f87ad430 100644 --- a/protos.h +++ b/protos.h @@ -45,16 +45,6 @@ struct ParameterList; struct stat; struct passwd; -/** - * struct HdrFormatInfo - Data passed to index_format_str() - */ -struct HdrFormatInfo -{ - struct Context *ctx; - struct Header *hdr; - const char *pager_progress; -}; - /** * enum XdgType - XDG variable types */ diff --git a/recvattach.c b/recvattach.c index 80c3edff3..fccbf68c7 100644 --- a/recvattach.c +++ b/recvattach.c @@ -54,6 +54,7 @@ #include "protos.h" #include "recvcmd.h" #include "rfc1524.h" +#include "send.h" #include "state.h" #ifdef ENABLE_NLS #include diff --git a/recvcmd.c b/recvcmd.c index 3ff1a5ad4..5fefa0ce1 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -30,6 +30,7 @@ #include "mutt.h" #include "alias.h" #include "copy.h" +#include "curs_lib.h" #include "globals.h" #include "handler.h" #include "hdrline.h" @@ -39,6 +40,7 @@ #include "options.h" #include "protos.h" #include "recvattach.h" +#include "send.h" #include "state.h" #ifdef ENABLE_NLS #include diff --git a/send.c b/send.c index 9afcac7cb..b583c47db 100644 --- a/send.c +++ b/send.c @@ -34,6 +34,7 @@ #include "mutt/mutt.h" #include "email/email.h" #include "mutt.h" +#include "send.h" #include "alias.h" #include "compose.h" #include "context.h" diff --git a/send.h b/send.h index 2b5a933d4..436097b4e 100644 --- a/send.h +++ b/send.h @@ -78,6 +78,21 @@ extern char * Signature; extern bool SigOnTop; extern bool UseFrom; +/* flags to ci_send_message() */ +#define SENDREPLY (1 << 0) +#define SENDGROUPREPLY (1 << 1) +#define SENDLISTREPLY (1 << 2) +#define SENDFORWARD (1 << 3) +#define SENDPOSTPONED (1 << 4) +#define SENDBATCH (1 << 5) +#define SENDMAILX (1 << 6) +#define SENDKEY (1 << 7) +#define SENDRESEND (1 << 8) +#define SENDPOSTPONEDFCC (1 << 9) /**< used by mutt_get_postponed() to signal that the x-mutt-fcc header field was present */ +#define SENDNOFREEHEADER (1 << 10) /**< Used by the -E flag */ +#define SENDDRAFTFILE (1 << 11) /**< Used by the -H flag */ +#define SENDNEWS (1 << 12) + int ci_send_message(int flags, struct Header *msg, char *tempfile, struct Context *ctx, struct Header *cur); void mutt_add_to_reference_headers(struct Envelope *env, struct Envelope *curenv); int mutt_compose_to_sender(struct Header *hdr);