From: Richard Russon Date: Tue, 31 Oct 2017 13:41:32 +0000 (+0000) Subject: move all config variables to the end of the file X-Git-Tag: neomutt-20180223~57^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ffe82e2e92649744359dd3f7ded42b7a40c44b96;p=neomutt move all config variables to the end of the file --- diff --git a/buffy.h b/buffy.h index ae88193a1..11864471b 100644 --- a/buffy.h +++ b/buffy.h @@ -61,8 +61,6 @@ struct Buffy }; WHERE struct Buffy *Incoming; -WHERE short MailCheck; -WHERE short MailCheckStatsInterval; #ifdef USE_NOTMUCH void mutt_buffy_vfolder(char *s, size_t slen); @@ -82,4 +80,8 @@ void mutt_buffy_setnotified(const char *path); bool mh_buffy(struct Buffy *mailbox, bool check_stats); +/* These variables are backing for config items */ +WHERE short MailCheck; +WHERE short MailCheckStatsInterval; + #endif /* _MUTT_BUFFY_H */ diff --git a/conn/conn_globals.h b/conn/conn_globals.h index 5b8d4e163..23d3d64c8 100644 --- a/conn/conn_globals.h +++ b/conn/conn_globals.h @@ -23,6 +23,7 @@ #ifndef _CONN_GLOBALS_H #define _CONN_GLOBALS_H +/* These variables are backing for config items */ short ConnectTimeout; #ifdef USE_SSL diff --git a/globals.h b/globals.h index aef3edcae..9118394ff 100644 --- a/globals.h +++ b/globals.h @@ -40,6 +40,75 @@ WHERE struct Context *Context; WHERE char ErrorBuf[STRING]; WHERE char AttachmentMarker[STRING]; +WHERE char *HomeDir; +WHERE char *ShortHostname; + +WHERE struct ListHead Muttrc INITVAL(STAILQ_HEAD_INITIALIZER(Muttrc)); + +WHERE short TSSupported; +WHERE char *Username; + +WHERE char *CurrentFolder; +WHERE char *LastFolder; + +WHERE const char *GitVer; + +WHERE struct Hash *Groups; +WHERE struct Hash *ReverseAliases; +WHERE struct Hash *TagTransforms; +WHERE struct Hash *TagFormats; + +WHERE struct ListHead AutoViewList INITVAL(STAILQ_HEAD_INITIALIZER(AutoViewList)); +WHERE struct ListHead AlternativeOrderList INITVAL(STAILQ_HEAD_INITIALIZER(AlternativeOrderList)); +WHERE struct ListHead AttachAllow INITVAL(STAILQ_HEAD_INITIALIZER(AttachAllow)); +WHERE struct ListHead AttachExclude INITVAL(STAILQ_HEAD_INITIALIZER(AttachExclude)); +WHERE struct ListHead InlineAllow INITVAL(STAILQ_HEAD_INITIALIZER(InlineAllow)); +WHERE struct ListHead InlineExclude INITVAL(STAILQ_HEAD_INITIALIZER(InlineExclude)); +WHERE struct ListHead HeaderOrderList INITVAL(STAILQ_HEAD_INITIALIZER(HeaderOrderList)); +WHERE struct ListHead Ignore INITVAL(STAILQ_HEAD_INITIALIZER(Ignore)); +WHERE struct ListHead MailToAllow INITVAL(STAILQ_HEAD_INITIALIZER(MailToAllow)); +WHERE struct ListHead MimeLookupList INITVAL(STAILQ_HEAD_INITIALIZER(MimeLookupList)); +WHERE struct ListHead UnIgnore INITVAL(STAILQ_HEAD_INITIALIZER(UnIgnore)); + +WHERE struct RegexList *Alternates; +WHERE struct RegexList *UnAlternates; +WHERE struct RegexList *MailLists; +WHERE struct RegexList *UnMailLists; +WHERE struct RegexList *SubscribedLists; +WHERE struct RegexList *UnSubscribedLists; +WHERE struct ReplaceList *SpamList; +WHERE struct RegexList *NoSpamList; +WHERE struct ReplaceList *SubjectRegexList; + +WHERE unsigned short Counter; + +#ifdef USE_SIDEBAR +WHERE struct ListHead SidebarWhitelist INITVAL(STAILQ_HEAD_INITIALIZER(SidebarWhitelist)); +#endif + +/* flags for received signals */ +WHERE SIG_ATOMIC_VOLATILE_T SigAlrm; +WHERE SIG_ATOMIC_VOLATILE_T SigInt; +WHERE SIG_ATOMIC_VOLATILE_T SigWinch; + +WHERE int CurrentMenu; + +WHERE struct Alias *Aliases; +WHERE struct ListHead UserHeader INITVAL(STAILQ_HEAD_INITIALIZER(UserHeader)); + +#ifdef MAIN_C +const char *const BodyTypes[] = { + "x-unknown", "audio", "application", "image", "message", + "model", "multipart", "text", "video", "*", +}; +const char *const BodyEncodings[] = { + "x-unknown", "7bit", "8bit", "quoted-printable", + "base64", "binary", "x-uuencoded", +}; +#endif + +/* All the variables below are backing for config items */ + WHERE struct Address *EnvelopeFromAddress; WHERE struct Address *From; @@ -70,8 +139,7 @@ WHERE char *Hostname; WHERE struct MbTable *FromChars; WHERE char *IndexFormat; WHERE char *HistoryFile; -WHERE char *HomeDir; -WHERE char *ShortHostname; + #ifdef USE_IMAP WHERE char *ImapAuthenticators; WHERE char *ImapDelimChars; @@ -110,7 +178,6 @@ WHERE char *Mixmaster; WHERE char *MixEntryFormat; #endif -WHERE struct ListHead Muttrc INITVAL(STAILQ_HEAD_INITIALIZER(Muttrc)); #ifdef USE_NNTP WHERE char *GroupIndexFormat; WHERE char *Inews; @@ -170,42 +237,9 @@ WHERE struct MbTable *FlagChars; WHERE char *Trash; WHERE char *TSStatusFormat; WHERE char *TSIconFormat; -WHERE short TSSupported; -WHERE char *Username; WHERE char *Visual; -WHERE char *CurrentFolder; -WHERE char *LastFolder; - -WHERE const char *GitVer; - -WHERE struct Hash *Groups; -WHERE struct Hash *ReverseAliases; -WHERE struct Hash *TagFormats; - -WHERE struct ListHead AutoViewList INITVAL(STAILQ_HEAD_INITIALIZER(AutoViewList)); -WHERE struct ListHead AlternativeOrderList INITVAL(STAILQ_HEAD_INITIALIZER(AlternativeOrderList)); -WHERE struct ListHead AttachAllow INITVAL(STAILQ_HEAD_INITIALIZER(AttachAllow)); -WHERE struct ListHead AttachExclude INITVAL(STAILQ_HEAD_INITIALIZER(AttachExclude)); -WHERE struct ListHead InlineAllow INITVAL(STAILQ_HEAD_INITIALIZER(InlineAllow)); -WHERE struct ListHead InlineExclude INITVAL(STAILQ_HEAD_INITIALIZER(InlineExclude)); -WHERE struct ListHead HeaderOrderList INITVAL(STAILQ_HEAD_INITIALIZER(HeaderOrderList)); -WHERE struct ListHead Ignore INITVAL(STAILQ_HEAD_INITIALIZER(Ignore)); -WHERE struct ListHead MailToAllow INITVAL(STAILQ_HEAD_INITIALIZER(MailToAllow)); -WHERE struct ListHead MimeLookupList INITVAL(STAILQ_HEAD_INITIALIZER(MimeLookupList)); -WHERE struct ListHead UnIgnore INITVAL(STAILQ_HEAD_INITIALIZER(UnIgnore)); - -WHERE struct RegexList *Alternates; -WHERE struct RegexList *UnAlternates; -WHERE struct RegexList *MailLists; -WHERE struct RegexList *UnMailLists; -WHERE struct RegexList *SubscribedLists; -WHERE struct RegexList *UnSubscribedLists; -WHERE struct ReplaceList *SpamList; -WHERE struct RegexList *NoSpamList; -WHERE struct ReplaceList *SubjectRegexList; - -WHERE unsigned short Counter; +WHERE char *HiddenTags; #ifdef USE_NNTP WHERE short NntpPoll; @@ -238,25 +272,13 @@ WHERE short ScoreThresholdFlag; #ifdef USE_SIDEBAR WHERE short SidebarComponentDepth; WHERE short SidebarWidth; -WHERE struct ListHead SidebarWhitelist INITVAL(STAILQ_HEAD_INITIALIZER(SidebarWhitelist)); #endif - #ifdef USE_IMAP WHERE short ImapKeepalive; WHERE short ImapPipelineDepth; WHERE short ImapPollTimeout; #endif -/* flags for received signals */ -WHERE SIG_ATOMIC_VOLATILE_T SigAlrm; -WHERE SIG_ATOMIC_VOLATILE_T SigInt; -WHERE SIG_ATOMIC_VOLATILE_T SigWinch; - -WHERE int CurrentMenu; - -WHERE struct Alias *Aliases; -WHERE struct ListHead UserHeader INITVAL(STAILQ_HEAD_INITIALIZER(UserHeader)); - /* -- formerly in pgp.h -- */ WHERE struct Regex *PgpGoodSign; WHERE struct Regex *PgpDecryptionOkay; @@ -320,15 +342,4 @@ WHERE struct Regex *QuoteRegexp; WHERE struct Regex *ReplyRegexp; WHERE struct Regex *Smileys; -#ifdef MAIN_C -const char *const BodyTypes[] = { - "x-unknown", "audio", "application", "image", "message", - "model", "multipart", "text", "video", "*", -}; -const char *const BodyEncodings[] = { - "x-unknown", "7bit", "8bit", "quoted-printable", - "base64", "binary", "x-uuencoded", -}; -#endif - #endif /* _MUTT_GLOBALS_H */ diff --git a/mutt.h b/mutt.h index 4bcc13220..0f6c760d6 100644 --- a/mutt.h +++ b/mutt.h @@ -229,42 +229,6 @@ enum QuadOptionResponse MUTT_ASKYES }; -/* Quad-options */ -WHERE unsigned char AbortUnmodified; -WHERE unsigned char Bounce; -WHERE unsigned char Copy; -WHERE unsigned char Delete; -WHERE unsigned char ForwardEdit; -WHERE unsigned char FccAttach; -WHERE unsigned char Include; -WHERE unsigned char HonorFollowupTo; -WHERE unsigned char MimeForward; -WHERE unsigned char MimeForwardRest; -WHERE unsigned char Move; -WHERE unsigned char PgpMimeAuto; /* ask to revert to PGP/MIME when inline fails */ -WHERE unsigned char SmimeEncryptSelf; -WHERE unsigned char PgpEncryptSelf; -#ifdef USE_POP -WHERE unsigned char PopDelete; -WHERE unsigned char PopReconnect; -#endif -WHERE unsigned char Postpone; -WHERE unsigned char Print; -WHERE unsigned char Quit; -WHERE unsigned char ReplyTo; -WHERE unsigned char Recall; -#ifdef USE_SSL -WHERE unsigned char SslStarttls; -#endif -WHERE unsigned char AbortNosubject; -WHERE unsigned char CryptVerifySig; /* verify PGP signatures */ -#ifdef USE_NNTP -WHERE unsigned char PostModerated; -WHERE unsigned char CatchupNewsgroup; -WHERE unsigned char FollowupToPoster; -#endif -WHERE unsigned char AbortNoattach; /* forgotten attachment detector */ - /* flags to ci_send_message() */ #define SENDREPLY (1 << 0) #define SENDGROUPREPLY (1 << 1) @@ -336,4 +300,42 @@ extern int debuglevel; extern char *debugfile_cmdline; extern int debuglevel_cmdline; +/* All the variables below are backing for config items */ + +/* Quad-options */ +WHERE unsigned char AbortUnmodified; +WHERE unsigned char Bounce; +WHERE unsigned char Copy; +WHERE unsigned char Delete; +WHERE unsigned char ForwardEdit; +WHERE unsigned char FccAttach; +WHERE unsigned char Include; +WHERE unsigned char HonorFollowupTo; +WHERE unsigned char MimeForward; +WHERE unsigned char MimeForwardRest; +WHERE unsigned char Move; +WHERE unsigned char PgpMimeAuto; /* ask to revert to PGP/MIME when inline fails */ +WHERE unsigned char SmimeEncryptSelf; +WHERE unsigned char PgpEncryptSelf; +#ifdef USE_POP +WHERE unsigned char PopDelete; +WHERE unsigned char PopReconnect; +#endif +WHERE unsigned char Postpone; +WHERE unsigned char Print; +WHERE unsigned char Quit; +WHERE unsigned char ReplyTo; +WHERE unsigned char Recall; +#ifdef USE_SSL +WHERE unsigned char SslStarttls; +#endif +WHERE unsigned char AbortNosubject; +WHERE unsigned char CryptVerifySig; /* verify PGP signatures */ +#ifdef USE_NNTP +WHERE unsigned char PostModerated; +WHERE unsigned char CatchupNewsgroup; +WHERE unsigned char FollowupToPoster; +#endif +WHERE unsigned char AbortNoattach; /* forgotten attachment detector */ + #endif /* _MUTT_H */ diff --git a/mx.h b/mx.h index b358e7632..0a27f41a0 100644 --- a/mx.h +++ b/mx.h @@ -83,8 +83,6 @@ enum MailboxFormat MUTT_COMPRESSED, }; -WHERE short MboxType; - #define MMDF_SEP "\001\001\001\001\n" void mbox_reset_atime(struct Context *ctx, struct stat *st); @@ -127,4 +125,7 @@ extern struct MxOps mx_mbox_ops; extern struct MxOps mx_mh_ops; extern struct MxOps mx_mmdf_ops; +/* This variable is backing for a config item */ +WHERE short MboxType; + #endif /* _MUTT_MX_H */ diff --git a/options.h b/options.h index 4a3c313fd..2f8116527 100644 --- a/options.h +++ b/options.h @@ -26,6 +26,42 @@ #include #include "where.h" +/* pseudo options */ + +WHERE bool OPT_AUX_SORT; /**< (pseudo) using auxiliary sort function */ +WHERE bool OPT_FORCE_REFRESH; /**< (pseudo) refresh even during macros */ +WHERE bool OPT_NO_CURSES; /**< (pseudo) when sending in batch mode */ +WHERE bool OPT_SEARCH_REVERSE; /**< (pseudo) used by ci_search_command */ +WHERE bool OPT_MSG_ERR; /**< (pseudo) used by mutt_error/mutt_message */ +WHERE bool OPT_SEARCH_INVALID; /**< (pseudo) used to invalidate the search pat */ +WHERE bool OPT_SIGNALS_BLOCKED; /**< (pseudo) using by mutt_block_signals () */ +WHERE bool OPT_SYS_SIGNALS_BLOCKED; /**< (pseudo) using by mutt_block_signals_system () */ +WHERE bool OPT_NEED_RESORT; /**< (pseudo) used to force a re-sort */ +WHERE bool OPT_RESORT_INIT; /**< (pseudo) used to force the next resort to be from scratch */ +WHERE bool OPT_VIEW_ATTACH; /**< (pseudo) signals that we are viewing attachments */ +WHERE bool OPT_SORT_SUBTHREADS; /**< (pseudo) used when $sort_aux changes */ +WHERE bool OPT_NEED_RESCORE; /**< (pseudo) set when the `score' command is used */ +WHERE bool OPT_ATTACH_MSG; /**< (pseudo) used by attach-message */ +WHERE bool OPT_HIDE_READ; /**< (pseudo) whether or not hide read messages */ +WHERE bool OPT_KEEP_QUIET; /**< (pseudo) shut up the message and refresh functions while we are executing an external program. */ +WHERE bool OPT_MENU_CALLER; /**< (pseudo) tell menu to give caller a take */ +WHERE bool OPT_REDRAW_TREE; /**< (pseudo) redraw the thread tree */ +WHERE bool OPT_PGP_CHECK_TRUST; /**< (pseudo) used by pgp_select_key () */ +WHERE bool OPT_DONT_HANDLE_PGP_KEYS; /**< (pseudo) used to extract PGP keys */ +WHERE bool OPT_IGNORE_MACRO_EVENTS; /**< (pseudo) don't process macro/push/exec events while set */ + +#ifdef USE_NNTP +WHERE bool OPT_NEWS; /**< (pseudo) used to change reader mode */ +WHERE bool OPT_NEWS_SEND; /**< (pseudo) used to change behavior when posting */ +#endif + +#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_isset(v, n) (v[n / 8] & (1 << (n % 8))) + +/* All the variables below are backing for config items */ + WHERE bool Allow8bit; WHERE bool AllowAnsi; WHERE bool ArrowCursor; @@ -239,41 +275,9 @@ WHERE bool NntpLoadDescription; WHERE bool XCommentTo; #endif -/* pseudo options */ - -WHERE bool OPT_AUX_SORT; /**< (pseudo) using auxiliary sort function */ -WHERE bool OPT_FORCE_REFRESH; /**< (pseudo) refresh even during macros */ -WHERE bool OPT_NO_CURSES; /**< (pseudo) when sending in batch mode */ -WHERE bool OPT_SEARCH_REVERSE; /**< (pseudo) used by ci_search_command */ -WHERE bool OPT_MSG_ERR; /**< (pseudo) used by mutt_error/mutt_message */ -WHERE bool OPT_SEARCH_INVALID; /**< (pseudo) used to invalidate the search pat */ -WHERE bool OPT_NEED_RESORT; /**< (pseudo) used to force a re-sort */ -WHERE bool OPT_RESORT_INIT; /**< (pseudo) used to force the next resort to be from scratch */ -WHERE bool OPT_VIEW_ATTACH; /**< (pseudo) signals that we are viewing attachments */ -WHERE bool OPT_SORT_SUBTHREADS; /**< (pseudo) used when $sort_aux changes */ -WHERE bool OPT_NEED_RESCORE; /**< (pseudo) set when the `score' command is used */ -WHERE bool OPT_ATTACH_MSG; /**< (pseudo) used by attach-message */ -WHERE bool OPT_HIDE_READ; /**< (pseudo) whether or not hide read messages */ -WHERE bool OPT_KEEP_QUIET; /**< (pseudo) shut up the message and refresh functions while we are executing an external program. */ -WHERE bool OPT_MENU_CALLER; /**< (pseudo) tell menu to give caller a take */ -WHERE bool OPT_REDRAW_TREE; /**< (pseudo) redraw the thread tree */ -WHERE bool OPT_PGP_CHECK_TRUST; /**< (pseudo) used by pgp_select_key () */ -WHERE bool OPT_DONT_HANDLE_PGP_KEYS; /**< (pseudo) used to extract PGP keys */ -WHERE bool OPT_IGNORE_MACRO_EVENTS; /**< (pseudo) don't process macro/push/exec events while set */ - -#ifdef USE_NNTP -WHERE bool OPT_NEWS; /**< (pseudo) used to change reader mode */ -WHERE bool OPT_NEWS_SEND; /**< (pseudo) used to change behavior when posting */ -#endif #ifdef USE_NOTMUCH WHERE bool VirtualSpoolfile; WHERE bool NmRecord; #endif - -#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_isset(v, n) (v[n / 8] & (1 << (n % 8))) - #endif /* _MUTT_OPTIONS_H_ */ diff --git a/sort.h b/sort.h index 18c66a721..5da3fab27 100644 --- a/sort.h +++ b/sort.h @@ -73,6 +73,11 @@ sort_t *mutt_get_sort_func(int method); void mutt_sort_headers(struct Context *ctx, int init); int mutt_select_sort(int reverse); +extern const struct Mapping SortMethods[]; + +const char *mutt_get_name(struct Address *a); + +/* These variables are backing for config items */ WHERE short SortBrowser; WHERE short Sort; WHERE short SortAux; /* auxiliary sorting method */ @@ -82,8 +87,4 @@ WHERE short SidebarSortMethod; /* FIXME: This one does not belong to here */ WHERE short PgpSortKeys; -extern const struct Mapping SortMethods[]; - -const char *mutt_get_name(struct Address *a); - #endif /* _MUTT_SORT_H */