From: Richard Russon Date: Sun, 19 Aug 2018 00:17:47 +0000 (+0100) Subject: drop header-sized ifdefs X-Git-Tag: 2019-10-25~687^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abea16aca0dce7193e9d1d621cf37f0565bba543;p=neomutt drop header-sized ifdefs --- diff --git a/globals.h b/globals.h index 51c9d4c9f..0b9351837 100644 --- a/globals.h +++ b/globals.h @@ -166,12 +166,10 @@ WHERE short ImapKeepalive; ///< Config: (imap) Time to wait befo WHERE short ImapPollTimeout; ///< Config: (imap) Maximum time to wait for a server response #endif -/* -- formerly in pgp.h -- */ WHERE char *PgpDefaultKey; ///< Config: Default key to use for PGP operations WHERE char *PgpSignAs; ///< Config: Use this alternative key for signing messages WHERE char *PgpEntryFormat; ///< Config: printf-like format string for the PGP key selection menu -/* -- formerly in smime.h -- */ WHERE char *SmimeDefaultKey; ///< Config: Default key for SMIME operations WHERE char *SmimeSignAs; ///< Config: Use this alternative key for signing messages WHERE char *SmimeEncryptWith; ///< Config: Algorithm for encryption diff --git a/init.h b/init.h index cad6eae19..f1f4b1e9f 100644 --- a/init.h +++ b/init.h @@ -73,7 +73,6 @@ #include "query.h" #include "recvattach.h" #include "recvcmd.h" -#include "remailer.h" #include "rfc1524.h" #include "rfc3676.h" #include "score.h" @@ -83,6 +82,9 @@ #include "smtp.h" #include "sort.h" #include "status.h" +#ifdef MIXMASTER +#include "remailer.h" +#endif #ifdef USE_LUA #include "mutt_lua.h" #endif diff --git a/ncrypt/crypt_mod_pgp_classic.c b/ncrypt/crypt_mod_pgp_classic.c index 63474aa53..9a965f39f 100644 --- a/ncrypt/crypt_mod_pgp_classic.c +++ b/ncrypt/crypt_mod_pgp_classic.c @@ -30,9 +30,11 @@ #include #include "crypt_mod.h" #include "ncrypt.h" -#include "pgp.h" #include "pgpinvoke.h" #include "pgpkey.h" +#ifdef CRYPT_BACKEND_CLASSIC_PGP +#include "pgp.h" +#endif // clang-format off struct CryptModuleSpecs crypt_mod_pgp_classic = { diff --git a/ncrypt/crypt_mod_smime_classic.c b/ncrypt/crypt_mod_smime_classic.c index a7a23e15c..28cae5df3 100644 --- a/ncrypt/crypt_mod_smime_classic.c +++ b/ncrypt/crypt_mod_smime_classic.c @@ -30,7 +30,9 @@ #include #include "crypt_mod.h" #include "ncrypt.h" +#ifdef CRYPT_BACKEND_CLASSIC_SMIME #include "smime.h" +#endif // clang-format off struct CryptModuleSpecs crypt_mod_smime_classic = { diff --git a/ncrypt/gnupgparse.c b/ncrypt/gnupgparse.c index 9f632267f..10f0bc152 100644 --- a/ncrypt/gnupgparse.c +++ b/ncrypt/gnupgparse.c @@ -48,7 +48,9 @@ #include "ncrypt.h" #include "pgpinvoke.h" #include "pgpkey.h" +#ifdef CRYPT_BACKEND_CLASSIC_PGP #include "pgplib.h" +#endif /**************** * Read the GNUPG keys. For now we read the complete keyring by diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 3d06da3d3..9bf8dc903 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -45,7 +45,6 @@ #include "config/lib.h" #include "email/email.h" #include "mutt.h" -#include "pgp.h" #include "crypt.h" #include "cryptglue.h" #include "curs_lib.h" @@ -59,10 +58,13 @@ #include "options.h" #include "pgpinvoke.h" #include "pgpkey.h" -#include "pgplib.h" #include "pgpmicalg.h" #include "sendlib.h" #include "state.h" +#ifdef CRYPT_BACKEND_CLASSIC_PGP +#include "pgp.h" +#include "pgplib.h" +#endif /* These Config Variables are only used in ncrypt/pgp.c */ bool PgpCheckExit; ///< Config: Check the exit code of PGP subprocess diff --git a/ncrypt/pgp.h b/ncrypt/pgp.h index e141941b8..5c65ad46c 100644 --- a/ncrypt/pgp.h +++ b/ncrypt/pgp.h @@ -25,8 +25,6 @@ #ifndef _NCRYPT_PGP_H #define _NCRYPT_PGP_H -#ifdef CRYPT_BACKEND_CLASSIC_PGP - #include #include @@ -63,6 +61,4 @@ struct Body *pgp_class_sign_message(struct Body *a); int pgp_class_send_menu(struct Header *msg); -#endif /* CRYPT_BACKEND_CLASSIC_PGP */ - #endif /* _NCRYPT_PGP_H */ diff --git a/ncrypt/pgpinvoke.c b/ncrypt/pgpinvoke.c index d9980eea2..b195fd0a6 100644 --- a/ncrypt/pgpinvoke.c +++ b/ncrypt/pgpinvoke.c @@ -45,9 +45,11 @@ #include "mutt_window.h" #include "muttlib.h" #include "ncrypt.h" -#include "pgp.h" #include "pgpkey.h" #include "protos.h" +#ifdef CRYPT_BACKEND_CLASSIC_PGP +#include "pgp.h" +#endif /* These Config Variables are only used in ncrypt/pgpinvoke.c */ char *PgpClearsignCommand; ///< Config: (pgp) External command to inline-sign a messsage diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index cba0731e9..2c9c63c0e 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -56,13 +56,15 @@ #include "ncrypt.h" #include "opcodes.h" #include "options.h" -#include "pgp.h" #include "pgpinvoke.h" -#include "pgplib.h" #include "protos.h" #include "recvattach.h" #include "sendlib.h" #include "sort.h" +#ifdef CRYPT_BACKEND_CLASSIC_PGP +#include "pgp.h" +#include "pgplib.h" +#endif /** * struct PgpCache - List of cached PGP keys diff --git a/ncrypt/pgplib.c b/ncrypt/pgplib.c index 9aa68c26d..a1970f5c3 100644 --- a/ncrypt/pgplib.c +++ b/ncrypt/pgplib.c @@ -29,7 +29,9 @@ #include "config.h" #include #include "mutt/mutt.h" +#ifdef CRYPT_BACKEND_CLASSIC_PGP #include "pgplib.h" +#endif /** * pgp_pkalgbytype - Get the name of the algorithm from its ID diff --git a/ncrypt/pgplib.h b/ncrypt/pgplib.h index f31331721..124b5fc1a 100644 --- a/ncrypt/pgplib.h +++ b/ncrypt/pgplib.h @@ -24,8 +24,6 @@ #ifndef _NCRYPT_PGPLIB_H #define _NCRYPT_PGPLIB_H -#ifdef CRYPT_BACKEND_CLASSIC_PGP - #include #include @@ -72,6 +70,4 @@ struct PgpKeyInfo *pgp_remove_key(struct PgpKeyInfo **klist, struct PgpKeyInfo * struct PgpKeyInfo *pgp_new_keyinfo(void); -#endif /* CRYPT_BACKEND_CLASSIC_PGP */ - #endif /* _NCRYPT_PGPLIB_H */ diff --git a/ncrypt/smime.c b/ncrypt/smime.c index 24c95c3c5..4f74c35b9 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -39,7 +39,6 @@ #include "config/lib.h" #include "email/email.h" #include "mutt.h" -#include "smime.h" #include "alias.h" #include "copy.h" #include "crypt.h" @@ -61,6 +60,9 @@ #include "send.h" #include "sendlib.h" #include "state.h" +#ifdef CRYPT_BACKEND_CLASSIC_SMIME +#include "smime.h" +#endif /* These Config Variables are only used in ncrypt/smime.c */ bool SmimeAskCertLabel; ///< Config: Prompt the user for a label for SMIME certificates diff --git a/ncrypt/smime.h b/ncrypt/smime.h index e3d53ac29..536e66432 100644 --- a/ncrypt/smime.h +++ b/ncrypt/smime.h @@ -24,8 +24,6 @@ #ifndef _NCRYPT_SMIME_H #define _NCRYPT_SMIME_H -#ifdef CRYPT_BACKEND_CLASSIC_SMIME - #include #include @@ -62,6 +60,4 @@ int smime_class_verify_one(struct Body *sigbdy, struct State *s, const int smime_class_verify_sender(struct Header *h); void smime_class_void_passphrase(void); -#endif - #endif /* _NCRYPT_SMIME_H */ diff --git a/remailer.c b/remailer.c index e5cd659ff..06e981958 100644 --- a/remailer.c +++ b/remailer.c @@ -29,7 +29,6 @@ #include "mutt/mutt.h" #include "email/email.h" #include "mutt.h" -#include "remailer.h" #include "curs_lib.h" #include "filter.h" #include "format_flags.h" @@ -43,6 +42,9 @@ #include "protos.h" #include "recvattach.h" #include "sendlib.h" +#ifdef MIXMASTER +#include "remailer.h" +#endif /* These Config Variables are only used in remailer.c */ char *MixEntryFormat; ///< Config: (mixmaster) printf-like format string for the mixmaster chain diff --git a/remailer.h b/remailer.h index 714149bc4..a0d39ec3d 100644 --- a/remailer.h +++ b/remailer.h @@ -23,8 +23,6 @@ #ifndef _MUTT_REMAILER_H #define _MUTT_REMAILER_H -#ifdef MIXMASTER - #include struct ListHead; @@ -63,6 +61,4 @@ int mix_send_message(struct ListHead *chain, const char *tempfile); int mix_check_message(struct Header *msg); void mix_make_chain(struct ListHead *chainhead); -#endif /* MIXMASTER */ - #endif /* _MUTT_REMAILER_H */