From: Richard Russon Date: Sat, 21 Jul 2018 00:00:21 +0000 (+0100) Subject: de-dupe globals X-Git-Tag: 2019-10-25~743^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c1c3168fc8b87a7213c934fd22a796716b9fd90;p=neomutt de-dupe globals --- diff --git a/conn/conn_globals.c b/conn/conn_globals.c index ecbeda4be..712d7cc09 100644 --- a/conn/conn_globals.c +++ b/conn/conn_globals.c @@ -27,6 +27,7 @@ */ #include "config.h" +#include #include short ConnectTimeout = 0; /**< Config: Timeout for a network connection (for IMAP, POP or SMTP) */ @@ -46,3 +47,12 @@ 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 + +#ifdef USE_SSL +bool SslUseSslv3; +bool SslUseTlsv1; +bool SslUseTlsv11; +bool SslUseTlsv12; +bool SslVerifyDates; +bool SslVerifyHost; +#endif diff --git a/conn/conn_globals.h b/conn/conn_globals.h index 17688b65f..4bd9a53a2 100644 --- a/conn/conn_globals.h +++ b/conn/conn_globals.h @@ -45,14 +45,17 @@ extern const char *Tunnel; #endif /* These Config Variables are only used in conn/conn_raw.c */ +#ifdef HAVE_GETADDRINFO extern bool UseIpv6; +#endif -/* These Config Variables are only used in conn/ssl_gnutls.c */ +#ifdef USE_SSL extern bool SslUseSslv3; extern bool SslUseTlsv1; extern bool SslUseTlsv11; extern bool SslUseTlsv12; extern bool SslVerifyDates; extern bool SslVerifyHost; +#endif #endif /* _CONN_GLOBALS_H */ diff --git a/conn/conn_raw.c b/conn/conn_raw.c index 13d6fe7bb..903d2f76b 100644 --- a/conn/conn_raw.c +++ b/conn/conn_raw.c @@ -52,6 +52,11 @@ #include "globals.h" #include "options.h" +/* These Config Variables are only used in conn/conn_raw.c */ +#ifdef HAVE_GETADDRINFO +bool UseIpv6; +#endif + /** * socket_connect - set up to connect to a socket fd * @param fd File descriptor to connect with diff --git a/conn/ssl_gnutls.c b/conn/ssl_gnutls.c index ce0625c32..059cdf29a 100644 --- a/conn/ssl_gnutls.c +++ b/conn/ssl_gnutls.c @@ -50,14 +50,6 @@ #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 diff --git a/globals.h b/globals.h index 5fb1c57f5..ca59820cb 100644 --- a/globals.h +++ b/globals.h @@ -232,13 +232,7 @@ WHERE bool ImapPeek; WHERE bool SslUsesystemcerts; WHERE bool SslUseSslv2; #endif /* USE_SSL_GNUTLS */ -WHERE bool SslUseSslv3; -WHERE bool SslUseTlsv1; -WHERE bool SslUseTlsv11; -WHERE bool SslUseTlsv12; WHERE bool SslForceTls; -WHERE bool SslVerifyDates; -WHERE bool SslVerifyHost; #if defined(USE_SSL_OPENSSL) && defined(HAVE_SSL_PARTIAL_CHAIN) WHERE bool SslVerifyPartialChains; #endif /* USE_SSL_OPENSSL */ @@ -252,7 +246,6 @@ WHERE bool MessageCacheClean; WHERE bool ReadOnly; WHERE bool Resolve; WHERE bool ResumeDraftFiles; -WHERE bool ResumeEditedDraftFiles; WHERE bool SaveAddress; WHERE bool SaveEmpty; WHERE bool Score; @@ -265,9 +258,6 @@ WHERE bool Suspend; WHERE bool TextFlowed; WHERE bool TsEnabled; WHERE bool UseDomain; -#ifdef HAVE_GETADDRINFO -WHERE bool UseIpv6; -#endif WHERE bool WaitKey; WHERE bool WrapSearch; WHERE bool WriteBcc; /**< write out a bcc header? */ diff --git a/init.h b/init.h index 65c31687b..baeaebf4d 100644 --- a/init.h +++ b/init.h @@ -52,6 +52,7 @@ #include "imap/imap.h" #include "keymap.h" #include "maildir/maildir.h" +#include "main.h" #include "menu.h" #include "mutt_account.h" #include "mutt_commands.h" diff --git a/main.c b/main.c index 22b45ffa8..12ed2caf2 100644 --- a/main.c +++ b/main.c @@ -80,6 +80,9 @@ #include "nntp/nntp.h" #endif +/* These Config Variables are only used in main.c */ +bool ResumeEditedDraftFiles; + #define MUTT_IGNORE (1 << 0) /* -z */ #define MUTT_BUFFY (1 << 1) /* -Z */ #define MUTT_NOSYSRC (1 << 2) /* -n */