Skip to content

Commit

Permalink
split up globals
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed Jul 16, 2018
1 parent 955776d commit 2ed7153
Show file tree
Hide file tree
Showing 116 changed files with 1,241 additions and 399 deletions.
4 changes: 4 additions & 0 deletions addrbook.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
#include "protos.h"
#include "sort.h"

/* These Config Variables are only used in addrbook.c */
char *AliasFormat;
short SortAlias;

#define RSORT(x) (SortAlias & SORT_REVERSE) ? -x : x

static const struct Mapping AliasHelp[] = {
Expand Down
30 changes: 30 additions & 0 deletions addrbook.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* @file
* Address book handling aliases
*
* @authors
* Copyright (C) 2018 Richard Russon <[email protected]>
*
* @copyright
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef MUTT_ADDRBOOK_H
#define MUTT_ADDRBOOK_H

/* These Config Variables are only used in addrbook.c */
extern char *AliasFormat;
extern short SortAlias;

#endif /* MUTT_ADDRBOOK_H */
3 changes: 3 additions & 0 deletions bcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#include "protos.h"
#include "url.h"

/* These Config Variables are only used in bcache.c */
char *MessageCachedir;

/**
* struct BodyCache - Local cache of email bodies
*/
Expand Down
3 changes: 3 additions & 0 deletions bcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
struct Account;
struct BodyCache;

/* These Config Variables are only used in bcache.c */
extern char *MessageCachedir;

/**
* Callback function for mutt_bcache_list
*/
Expand Down
9 changes: 9 additions & 0 deletions browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@
#include "notmuch/mutt_notmuch.h"
#endif

/* These Config Variables are only used in browser.c */
bool BrowserAbbreviateMailboxes;
char *FolderFormat;
char *GroupIndexFormat;
char *NewsgroupsCharset;
bool ShowOnlyUnread;
short SortBrowser;
char *VfolderFormat;

static const struct Mapping FolderHelp[] = {
{ N_("Exit"), OP_EXIT },
{ N_("Chdir"), OP_CHANGE_DIRECTORY },
Expand Down
9 changes: 9 additions & 0 deletions browser.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
#include <sys/types.h>
#include <time.h>

/* These Config Variables are only used in browser.c */
extern bool BrowserAbbreviateMailboxes;
extern char *FolderFormat;
extern char *GroupIndexFormat;
extern char *NewsgroupsCharset;
extern bool ShowOnlyUnread;
extern short SortBrowser;
extern char *VfolderFormat;

/**
* struct FolderFile - Browser entry representing a folder/dir
*/
Expand Down
6 changes: 6 additions & 0 deletions buffy.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
#include "notmuch/mutt_notmuch.h"
#endif

/* These Config Variables are only used in buffy.c */
short MailCheck;
bool MailCheckStats;
short MailCheckStatsInterval;
bool MaildirCheckCur;

static time_t BuffyTime = 0; /**< last time we started checking for mail */
static time_t BuffyStatsTime = 0; /**< last time we check performed mail_check_stats */
time_t BuffyDoneTime = 0; /**< last time we knew for sure how much mail there was. */
Expand Down
10 changes: 6 additions & 4 deletions buffy.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@

struct stat;

/* These Config Variables are only used in buffy.c */
extern short MailCheck;
extern bool MailCheckStats;
extern short MailCheckStatsInterval;
extern bool MaildirCheckCur;

/* parameter to mutt_parse_mailboxes */
#define MUTT_NAMED 1
#define MUTT_VIRTUAL 2
Expand Down Expand Up @@ -87,8 +93,4 @@ bool mutt_buffy_notify(void);
int mutt_parse_mailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s, unsigned long data, struct Buffer *err);

/* These variables are backing for config items */
WHERE short MailCheck;
WHERE short MailCheckStatsInterval;

#endif /* _MUTT_BUFFY_H */
10 changes: 10 additions & 0 deletions commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@
#include <libintl.h>
#endif

/* These Config Variables are only used in commands.c */
unsigned char CryptVerifySig; /* verify PGP signatures */
char * DisplayFilter;
bool PipeDecode;
char * PipeSep;
bool PipeSplit;
bool PrintDecode;
bool PrintSplit;
bool PromptAfter;

static const char *ExtPagerProgress = "all";

/** The folder the user last saved to. Used by ci_save_message() */
Expand Down
10 changes: 10 additions & 0 deletions commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ struct Context;
struct Envelope;
struct Header;

/* These Config Variables are only used in commands.c */
extern unsigned char CryptVerifySig; /* verify PGP signatures */
extern char * DisplayFilter;
extern bool PipeDecode;
extern char * PipeSep;
extern bool PipeSplit;
extern bool PrintDecode;
extern bool PrintSplit;
extern bool PromptAfter;

void ci_bounce_message(struct Header *h);
void mutt_check_stats(void);
int mutt_check_traditional_pgp(struct Header *h, int *redraw);
Expand Down
5 changes: 5 additions & 0 deletions compose.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
#include "nntp/nntp.h"
#endif

/* These Config Variables are only used in compose.c */
char * ComposeFormat;
char * Ispell;
unsigned char Postpone;

static const char *There_are_no_attachments = N_("There are no attachments.");

#define CHECK_COUNT \
Expand Down
31 changes: 31 additions & 0 deletions compose.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* @file
* GUI editor for an email's headers
*
* @authors
* Copyright (C) 2018 Richard Russon <[email protected]>
*
* @copyright
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef MUTT_COMPOSE_H
#define MUTT_COMPOSE_H

/* These Config Variables are only used in compose.c */
extern char * ComposeFormat;
extern char * Ispell;
extern unsigned char Postpone;

#endif /* MUTT_COMPOSE_H */
1 change: 1 addition & 0 deletions compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "compress.h"
#include "context.h"
#include "format_flags.h"
#include "globals.h"
#include "mailbox.h"
#include "mutt_curses.h"
#include "mx.h"
Expand Down
13 changes: 13 additions & 0 deletions conn/conn_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/

#include "config.h"
#include <stdbool.h>
#include <stdio.h>

short ConnectTimeout = 0; /**< Config: Timeout for a network connection (for IMAP, POP or SMTP) */
Expand All @@ -46,3 +47,15 @@ short SslMinDhPrimeBits = 0; /**< Config: Minimum keysize for Diffie-Hellman key
const char *Preconnect = NULL; /**< Config: Shell command to run before making a connection */
const char *Tunnel = NULL; /**< Config: Shell command to establish a tunnel */
#endif

/* These Config Variables are only used in conn/conn_raw.c */
extern bool UseIpv6;

/* These Config Variables are only used in conn/ssl_gnutls.c */
extern bool SslUseSslv3;
extern bool SslUseTlsv1;
extern bool SslUseTlsv11;
extern bool SslUseTlsv12;
extern bool SslVerifyDates;
extern bool SslVerifyHost;

2 changes: 2 additions & 0 deletions conn/conn_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#ifndef _CONN_GLOBALS_H
#define _CONN_GLOBALS_H

#include <stdbool.h>

/* These variables are backing for config items */
extern short ConnectTimeout;

Expand Down
3 changes: 3 additions & 0 deletions conn/conn_raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
#include "options.h"
#include "protos.h"

/* These Config Variables are only used in conn/conn_raw.c */
extern bool UseIpv6;

/**
* socket_connect - set up to connect to a socket fd
* @param fd File descriptor to connect with
Expand Down
8 changes: 8 additions & 0 deletions conn/ssl_gnutls.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
#include "protos.h"
#include "socket.h"

/* These Config Variables are only used in conn/ssl_gnutls.c */
bool SslUseSslv3;
bool SslUseTlsv1;
bool SslUseTlsv11;
bool SslUseTlsv12;
bool SslVerifyDates;
bool SslVerifyHost;

/* certificate error bitmap values */
#define CERTERR_VALID 0
#define CERTERR_EXPIRED 1
Expand Down
3 changes: 3 additions & 0 deletions curs_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
#include "notmuch/mutt_notmuch.h"
#endif

/* These Config Variables are only used in curs_lib.c */
bool MetaKey; /**< interpret ALT-x as ESC-x */

/* not possible to unget more than one char under some curses libs, and it
* is impossible to unget function keys in SLang, so roll our own input
* buffering routines.
Expand Down
3 changes: 3 additions & 0 deletions curs_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

struct Context;

/* These Config Variables are only used in curs_lib.c */
extern bool MetaKey; /**< interpret ALT-x as ESC-x */

bool message_is_tagged(struct Context *ctx, int index);
bool message_is_visible(struct Context *ctx, int index);
int mutt_addwch(wchar_t wc);
Expand Down
10 changes: 10 additions & 0 deletions curs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@
#include <libintl.h>
#endif

/* These Config Variables are only used in curs_main.c */
bool ChangeFolderNext;
bool CollapseAll;
bool CollapseFlagged;
bool CollapseUnread;
char *MarkMacroPrefix;
bool PgpAutoDecode;
bool UncollapseJump;
bool UncollapseNew;

static const char *No_mailbox_is_open = N_("No mailbox is open.");
static const char *There_are_no_messages = N_("There are no messages.");
static const char *Mailbox_is_read_only = N_("Mailbox is read-only.");
Expand Down
36 changes: 36 additions & 0 deletions curs_main.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* @file
* GUI manage the main index (list of emails)
*
* @authors
* Copyright (C) 2018 Richard Russon <[email protected]>
*
* @copyright
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef MUTT_CURS_MAIN_H
#define MUTT_CURS_MAIN_H

/* These Config Variables are only used in curs_main.c */
extern bool ChangeFolderNext;
extern bool CollapseAll;
extern bool CollapseFlagged;
extern bool CollapseUnread;
extern char *MarkMacroPrefix;
extern bool PgpAutoDecode;
extern bool UncollapseJump;
extern bool UncollapseNew;

#endif /* MUTT_CURS_MAIN_H */
3 changes: 3 additions & 0 deletions edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
#include "options.h"
#include "protos.h"

/* These Config Variables are only used in edit.c */
char *Escape;

/*
* SLcurses_waddnstr() can't take a "const char *", so this is only
* declared "static" (sigh)
Expand Down
29 changes: 29 additions & 0 deletions edit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @file
* GUI basic built-in text editor
*
* @authors
* Copyright (C) 2018 Richard Russon <[email protected]>
*
* @copyright
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef MUTT_EDIT_H
#define MUTT_EDIT_H

/* These Config Variables are only used in edit.c */
extern char *Escape;

#endif /* MUTT_EDIT_H */
4 changes: 3 additions & 1 deletion email/tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
#include "mutt/mutt.h"
#include "tags.h"

char *HiddenTags; /**< Config: Private tags which should not be displayed */
/* These Config Variables are only used in email/tags.c */
char *HiddenTags;

struct Hash *TagTransforms; /**< Lookup table of alternative tag names */

/**
Expand Down
Loading

0 comments on commit 2ed7153

Please sign in to comment.