From 4761fa78a6dfc9437caa6e6e0aac806e50e01c83 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 5 Nov 2006 01:40:46 +0100 Subject: [PATCH] reorganize code a lot: create a lib-crypt with everything smime or gpg related Signed-off-by: Pierre Habouzit --- Makefile.am | 26 ++++++++----------- attach.c | 2 +- commands.c | 2 +- compose.c | 2 +- configure.ac | 1 + copy.c | 2 +- crypt-gpgme.c | 2 +- crypt-gpgme.h | 2 +- crypt-mod-pgp-gpgme.c | 2 +- crypt-mod-smime-gpgme.c | 2 +- curs_main.c | 2 +- handler.c | 2 +- hdrline.c | 2 +- headers.c | 2 +- hook.c | 2 +- init.c | 2 +- keymap.c | 2 +- .../crypt-mod-pgp-classic.c | 0 .../crypt-mod-smime-classic.c | 0 crypt-mod.c => lib-crypt/crypt-mod.c | 0 crypt-mod.h => lib-crypt/crypt-mod.h | 2 +- crypt.c => lib-crypt/crypt.c | 2 +- mutt_crypt.h => lib-crypt/crypt.h | 0 cryptglue.c => lib-crypt/cryptglue.c | 4 +-- gnupgparse.c => lib-crypt/gnupgparse.c | 0 pgp.c => lib-crypt/pgp.c | 2 +- pgp.h => lib-crypt/pgp.h | 2 +- pgpinvoke.c => lib-crypt/pgpinvoke.c | 0 pgpkey.c => lib-crypt/pgpkey.c | 0 pgplib.c => lib-crypt/pgplib.c | 0 pgplib.h => lib-crypt/pgplib.h | 2 +- pgpmicalg.c => lib-crypt/pgpmicalg.c | 0 pgppacket.c => lib-crypt/pgppacket.c | 0 pgppacket.h => lib-crypt/pgppacket.h | 0 smime.c => lib-crypt/smime.c | 2 +- smime.h => lib-crypt/smime.h | 2 +- main.c | 2 +- muttlib.c | 2 +- mx.c | 2 +- nntp/nntp.c | 2 +- pager.c | 2 +- parse.c | 2 +- pattern.c | 2 +- pgppubring.c | 4 +-- pop/pop.c | 2 +- postpone.c | 2 +- recvattach.c | 2 +- send.c | 2 +- sendlib.c | 2 +- 49 files changed, 49 insertions(+), 54 deletions(-) rename crypt-mod-pgp-classic.c => lib-crypt/crypt-mod-pgp-classic.c (100%) rename crypt-mod-smime-classic.c => lib-crypt/crypt-mod-smime-classic.c (100%) rename crypt-mod.c => lib-crypt/crypt-mod.c (100%) rename crypt-mod.h => lib-crypt/crypt-mod.h (99%) rename crypt.c => lib-crypt/crypt.c (99%) rename mutt_crypt.h => lib-crypt/crypt.h (100%) rename cryptglue.c => lib-crypt/cryptglue.c (99%) rename gnupgparse.c => lib-crypt/gnupgparse.c (100%) rename pgp.c => lib-crypt/pgp.c (99%) rename pgp.h => lib-crypt/pgp.h (99%) rename pgpinvoke.c => lib-crypt/pgpinvoke.c (100%) rename pgpkey.c => lib-crypt/pgpkey.c (100%) rename pgplib.c => lib-crypt/pgplib.c (100%) rename pgplib.h => lib-crypt/pgplib.h (98%) rename pgpmicalg.c => lib-crypt/pgpmicalg.c (100%) rename pgppacket.c => lib-crypt/pgppacket.c (100%) rename pgppacket.h => lib-crypt/pgppacket.h (100%) rename smime.c => lib-crypt/smime.c (99%) rename smime.h => lib-crypt/smime.h (97%) diff --git a/Makefile.am b/Makefile.am index fbb9ded..a0cf9fe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,7 @@ NNTP_INCLUDES = -I$(top_srcdir)/nntp endif SUBDIRS = intl m4 po doc contrib \ - lib-lib lib-mime lib-hash lib \ + lib-lib lib-mime lib-crypt lib-hash lib \ pop imap $(NNTP_SUBDIR) bin_SCRIPTS = muttngbug fleang @@ -20,8 +20,8 @@ BUILT_SOURCES = keymap_defs.h version.h bin_PROGRAMS = muttng muttng_dotlock pgpringng pgpewrapng smime_keysng muttng_SOURCES = $(BUILT_SOURCES) \ alias.c attach.c base64.c browser.c buffy.c \ - charset.c color.c compress.c crypt.c cryptglue.c commands.c complete.c \ - compose.c copy.c curs_lib.c curs_main.c crypt-mod.c crypt-mod.h \ + charset.c color.c compress.c commands.c complete.c \ + compose.c copy.c curs_lib.c curs_main.c \ date.c edit.c editmsg.c enter.c \ flags.c filter.c from.c getdomain.c \ handler.c hcache.c hdrline.c headers.c help.c history.c hook.c \ @@ -31,19 +31,17 @@ muttng_SOURCES = $(BUILT_SOURCES) \ recvattach.c recvcmd.c rfc1524.c rfc3676.c \ score.c send.c sendlib.c sidebar.c signal.c sort.c state.c status.c system.c \ thread.c url.c utf8.c wcwidth.c \ - account.c mutt_socket.c mutt_tunnel.c \ - pgp.c pgpinvoke.c pgpkey.c pgplib.c gnupgparse.c pgpmicalg.c pgppacket.c \ - crypt-mod-pgp-classic.c smime.c crypt-mod-smime-classic.c - + account.c mutt_socket.c mutt_tunnel.c muttng_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \ -Limap -limap -Lpop -lpop $(LIBNNTP) \ - -Llib-lib -llib -Llib-mime -lmime -Llib-hash -lhash \ + -Llib-lib -llib -Llib-mime -lmime -Llib-crypt -lcrypt -Llib-hash -lhash \ -Llib -lsane $(MUTTLIBS) $(INTLLIBS) $(LIBICONV) muttng_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ \ $(top_builddir)/lib-lib/liblib.a \ $(top_builddir)/lib-mime/libmime.a \ + $(top_builddir)/lib-crypt/libcrypt.a \ $(top_builddir)/lib-hash/libhash.a \ $(top_builddir)/lib/libsane.a \ \ @@ -67,8 +65,7 @@ CPPFLAGS=@CPPFLAGS@ -I$(includedir) EXTRA_muttng_SOURCES = \ account.c mutt_sasl.c mutt_socket.c mutt_ssl.c \ - mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c \ - pgplib.c pgpmicalg.c gnupgparse.c resize.c dotlock.c remailer.c \ + mutt_tunnel.c resize.c dotlock.c remailer.c \ alias.h browser.h enter.h \ mbyte.h remailer.h url.h state.h \ mutt_idna.h mutt_libesmtp.c sidebar.h state.h @@ -82,9 +79,8 @@ EXTRA_DIST = config.rpath COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO \ globals.h history.h init.h keymap.h mutt_crypt.h \ mime.h mutt.h mutt_curses.h mutt_menu.h \ mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \ - mbox.h mh.h mx.h pager.h pgp.h protos.h rfc1524.h \ - rfc3676.h \ - sort.h mime.types autogen.sh \ + mbox.h mh.h mx.h pager.h protos.h rfc1524.h \ + rfc3676.h sort.h mime.types autogen.sh \ _regex.h OPS.MIX remailer.c remailer.h browser.h state.h \ mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttngrc.head Muttngrc \ makedoc.c stamp-doc-rc README.SSL smime.h\ @@ -96,9 +92,9 @@ muttng_dotlock_SOURCES = dotlock.c muttng_dotlock_LDADD = -Llib-lib -llib @LIBOBJS@ muttng_dotlock_DEPENDENCIES = @LIBOBJS@ $(top_builddir)/lib-lib/liblib.a -pgpringng_SOURCES = pgppubring.c pgplib.c lib.c extlib.c pgppacket.c +pgpringng_SOURCES = pgppubring.c lib.c extlib.c pgpringng_LDADD = @LIBOBJS@ $(INTLLIBS) \ - -Llib-lib -llib -Llib-hash -lhash -Llib -lsane + -Llib-lib -llib -Llib-hash -lhash -Llib-crypt -lcrypt -Llib -lsane pgpringng_DEPENDENCIES = @LIBOBJS@ $(INTLDEPS) \ $(top_builddir)/lib-lib/liblib.a \ $(top_builddir)/lib-hash/libhash.a diff --git a/attach.c b/attach.c index c311ba2..3f6a9ac 100644 --- a/attach.c +++ b/attach.c @@ -30,7 +30,7 @@ #include "pager.h" #include "copy.h" #include "mx.h" -#include "mutt_crypt.h" +#include #include "lib/debug.h" diff --git a/commands.c b/commands.c index a9f3298..83604ca 100644 --- a/commands.c +++ b/commands.c @@ -28,7 +28,7 @@ #include "copy.h" #include "mx.h" #include "pager.h" -#include "mutt_crypt.h" +#include #include "mutt_idna.h" #include "rfc1524.h" #include diff --git a/compose.c b/compose.c index f449b1e..d99a850 100644 --- a/compose.c +++ b/compose.c @@ -142,7 +142,7 @@ static void snd_entry (char *b, ssize_t blen, MUTTMENU * menu, int num) { M_FORMAT_STAT_FILE | M_FORMAT_ARROWCURSOR); } -#include "mutt_crypt.h" +#include static void redraw_crypt_lines (HEADER * msg) { diff --git a/configure.ac b/configure.ac index 84b2142..db07ae4 100644 --- a/configure.ac +++ b/configure.ac @@ -999,6 +999,7 @@ AC_OUTPUT(Makefile intl/Makefile m4/Makefile muttbug.sh lib-lib/Makefile lib-mime/Makefile + lib-crypt/Makefile lib-hash/Makefile lib/Makefile imap/Makefile diff --git a/copy.c b/copy.c index 989f3ce..97b73c0 100644 --- a/copy.c +++ b/copy.c @@ -23,7 +23,7 @@ #include "handler.h" #include "mx.h" #include "copy.h" -#include "mutt_crypt.h" +#include #include "mutt_idna.h" #include "lib/debug.h" diff --git a/crypt-gpgme.c b/crypt-gpgme.c index a3dedae..145a6e0 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -27,7 +27,7 @@ #include #include "mutt.h" -#include "mutt_crypt.h" +#include #include "mutt_menu.h" #include "mutt_curses.h" #include "handler.h" diff --git a/crypt-gpgme.h b/crypt-gpgme.h index db048be..74e5a38 100644 --- a/crypt-gpgme.h +++ b/crypt-gpgme.h @@ -10,7 +10,7 @@ #ifndef CRYPT_GPGME_H #define CRYPT_GPGME_H -#include "mutt_crypt.h" +#include void pgp_gpgme_init (void); void smime_gpgme_init (void); diff --git a/crypt-mod-pgp-gpgme.c b/crypt-mod-pgp-gpgme.c index cd18717..977a8c1 100644 --- a/crypt-mod-pgp-gpgme.c +++ b/crypt-mod-pgp-gpgme.c @@ -17,7 +17,7 @@ #ifdef CRYPT_BACKEND_GPGME -#include "crypt-mod.h" +#include #include "crypt-gpgme.h" static void crypt_mod_pgp_init (void) diff --git a/crypt-mod-smime-gpgme.c b/crypt-mod-smime-gpgme.c index fdf391b..31e882f 100644 --- a/crypt-mod-smime-gpgme.c +++ b/crypt-mod-smime-gpgme.c @@ -17,7 +17,7 @@ #ifdef CRYPT_BACKEND_GPGME -#include "crypt-mod.h" +#include #include "crypt-gpgme.h" static void crypt_mod_smime_init (void) diff --git a/curs_main.c b/curs_main.c index c241ff6..4341a71 100644 --- a/curs_main.c +++ b/curs_main.c @@ -35,7 +35,7 @@ #include -#include "mutt_crypt.h" +#include #ifdef USE_NNTP #include "nntp.h" diff --git a/handler.c b/handler.c index abde630..a693fe6 100644 --- a/handler.c +++ b/handler.c @@ -35,7 +35,7 @@ #include "keymap.h" #include "copy.h" #include "charset.h" -#include "mutt_crypt.h" +#include #include "state.h" #include "attach.h" #include "lib.h" diff --git a/hdrline.c b/hdrline.c index 79b3ea5..72a1674 100644 --- a/hdrline.c +++ b/hdrline.c @@ -16,7 +16,7 @@ #include "sort.h" #include "thread.h" #include "charset.h" -#include "mutt_crypt.h" +#include #include "mutt_idna.h" #include diff --git a/headers.c b/headers.c index 1e95ed6..3ffd819 100644 --- a/headers.c +++ b/headers.c @@ -16,7 +16,7 @@ #include #include "mutt.h" -#include "mutt_crypt.h" +#include #include "mutt_idna.h" #include "lib/debug.h" diff --git a/hook.c b/hook.c index 4eb6e01..7347939 100644 --- a/hook.c +++ b/hook.c @@ -19,7 +19,7 @@ #include "mutt.h" #include "mx.h" -#include "mutt_crypt.h" +#include #include "compress.h" #include "lib/rx.h" diff --git a/init.c b/init.c index 1c32270..fd047b6 100644 --- a/init.c +++ b/init.c @@ -29,7 +29,7 @@ #include "mbyte.h" #include "charset.h" #include "thread.h" -#include "mutt_crypt.h" +#include #include "mutt_idna.h" #if defined(USE_SSL) || defined(USE_GNUTLS) diff --git a/keymap.c b/keymap.c index 272fe0a..6205bae 100644 --- a/keymap.c +++ b/keymap.c @@ -22,7 +22,7 @@ #include "mutt_menu.h" #include "mutt_curses.h" #include "keymap.h" -#include "mutt_crypt.h" +#include #include diff --git a/crypt-mod-pgp-classic.c b/lib-crypt/crypt-mod-pgp-classic.c similarity index 100% rename from crypt-mod-pgp-classic.c rename to lib-crypt/crypt-mod-pgp-classic.c diff --git a/crypt-mod-smime-classic.c b/lib-crypt/crypt-mod-smime-classic.c similarity index 100% rename from crypt-mod-smime-classic.c rename to lib-crypt/crypt-mod-smime-classic.c diff --git a/crypt-mod.c b/lib-crypt/crypt-mod.c similarity index 100% rename from crypt-mod.c rename to lib-crypt/crypt-mod.c diff --git a/crypt-mod.h b/lib-crypt/crypt-mod.h similarity index 99% rename from crypt-mod.h rename to lib-crypt/crypt-mod.h index c6846f6..679b81e 100644 --- a/crypt-mod.h +++ b/lib-crypt/crypt-mod.h @@ -11,7 +11,7 @@ #define CRYPTOGRAPHY_H #include "mutt.h" -#include "mutt_crypt.h" +#include "crypt.h" /* Type defintions for crypto module functions. diff --git a/crypt.c b/lib-crypt/crypt.c similarity index 99% rename from crypt.c rename to lib-crypt/crypt.c index bc44714..66b8531 100644 --- a/crypt.c +++ b/lib-crypt/crypt.c @@ -28,7 +28,7 @@ #include "handler.h" #include "mutt_curses.h" #include "copy.h" -#include "mutt_crypt.h" +#include "crypt.h" #include "pgp.h" diff --git a/mutt_crypt.h b/lib-crypt/crypt.h similarity index 100% rename from mutt_crypt.h rename to lib-crypt/crypt.h diff --git a/cryptglue.c b/lib-crypt/cryptglue.c similarity index 99% rename from cryptglue.c rename to lib-crypt/cryptglue.c index d76fa44..151cbad 100644 --- a/cryptglue.c +++ b/lib-crypt/cryptglue.c @@ -26,15 +26,13 @@ #include #include "mutt.h" -#include "mutt_crypt.h" +#include "crypt.h" #include "crypt-mod.h" /* - Generic - */ extern struct crypt_module_specs crypt_mod_pgp_classic; diff --git a/gnupgparse.c b/lib-crypt/gnupgparse.c similarity index 100% rename from gnupgparse.c rename to lib-crypt/gnupgparse.c diff --git a/pgp.c b/lib-crypt/pgp.c similarity index 99% rename from pgp.c rename to lib-crypt/pgp.c index c6e19e6..26f79d9 100644 --- a/pgp.c +++ b/lib-crypt/pgp.c @@ -59,7 +59,7 @@ # include #endif -#include "mutt_crypt.h" +#include "crypt.h" #include "mutt_menu.h" diff --git a/pgp.h b/lib-crypt/pgp.h similarity index 99% rename from pgp.h rename to lib-crypt/pgp.h index 26bdbb0..30e17b8 100644 --- a/pgp.h +++ b/lib-crypt/pgp.h @@ -9,7 +9,7 @@ * please see the file GPL in the top level source directory. */ -#include "mutt_crypt.h" +#include "crypt.h" #include "pgplib.h" diff --git a/pgpinvoke.c b/lib-crypt/pgpinvoke.c similarity index 100% rename from pgpinvoke.c rename to lib-crypt/pgpinvoke.c diff --git a/pgpkey.c b/lib-crypt/pgpkey.c similarity index 100% rename from pgpkey.c rename to lib-crypt/pgpkey.c diff --git a/pgplib.c b/lib-crypt/pgplib.c similarity index 100% rename from pgplib.c rename to lib-crypt/pgplib.c diff --git a/pgplib.h b/lib-crypt/pgplib.h similarity index 98% rename from pgplib.h rename to lib-crypt/pgplib.h index a5f5362..ace0e3d 100644 --- a/pgplib.h +++ b/lib-crypt/pgplib.h @@ -8,7 +8,7 @@ * please see the file GPL in the top level source directory. */ -#include "mutt_crypt.h" +#include "crypt.h" typedef struct pgp_signature { struct pgp_signature *next; diff --git a/pgpmicalg.c b/lib-crypt/pgpmicalg.c similarity index 100% rename from pgpmicalg.c rename to lib-crypt/pgpmicalg.c diff --git a/pgppacket.c b/lib-crypt/pgppacket.c similarity index 100% rename from pgppacket.c rename to lib-crypt/pgppacket.c diff --git a/pgppacket.h b/lib-crypt/pgppacket.h similarity index 100% rename from pgppacket.h rename to lib-crypt/pgppacket.h diff --git a/smime.c b/lib-crypt/smime.c similarity index 99% rename from smime.c rename to lib-crypt/smime.c index e9f64f1..3040268 100644 --- a/smime.c +++ b/lib-crypt/smime.c @@ -49,7 +49,7 @@ # include #endif -#include "mutt_crypt.h" +#include "crypt.h" struct smime_command_context { const char *key; /* %k */ diff --git a/smime.h b/lib-crypt/smime.h similarity index 97% rename from smime.h rename to lib-crypt/smime.h index dbf9a3f..452946f 100644 --- a/smime.h +++ b/lib-crypt/smime.h @@ -9,7 +9,7 @@ */ -#include "mutt_crypt.h" +#include "crypt.h" void smime_void_passphrase (void); int smime_valid_passphrase (void); diff --git a/main.c b/main.c index 3596712..32669b1 100644 --- a/main.c +++ b/main.c @@ -28,7 +28,7 @@ #include "mx.h" #include "buffy.h" #include "sort.h" -#include "mutt_crypt.h" +#include #include "mutt_curses.h" #include "keymap.h" #include "url.h" diff --git a/muttlib.c b/muttlib.c index 6892168..e3a7cad 100644 --- a/muttlib.c +++ b/muttlib.c @@ -33,7 +33,7 @@ #include #include -#include "mutt_crypt.h" +#include #include "lib/debug.h" diff --git a/mx.c b/mx.c index 28ba348..b1efdce 100644 --- a/mx.c +++ b/mx.c @@ -48,7 +48,7 @@ #include "dotlock.h" #endif -#include "mutt_crypt.h" +#include #include "lib/list.h" #include "lib/debug.h" diff --git a/nntp/nntp.c b/nntp/nntp.c index 34d7746..0c7af82 100644 --- a/nntp/nntp.c +++ b/nntp/nntp.c @@ -30,7 +30,7 @@ #include "sidebar.h" #include "buffy.h" -#include "mutt_crypt.h" +#include #include "lib/debug.h" diff --git a/pager.c b/pager.c index ce473ed..9f3dc2a 100644 --- a/pager.c +++ b/pager.c @@ -37,7 +37,7 @@ #include -#include "mutt_crypt.h" +#include #include "lib/rx.h" #include "lib/debug.h" diff --git a/parse.c b/parse.c index cd78866..c998fc3 100644 --- a/parse.c +++ b/parse.c @@ -23,7 +23,7 @@ #include "enter.h" #include "recvattach.h" #include "mx.h" -#include "mutt_crypt.h" +#include #include "url.h" #include "lib/rx.h" diff --git a/pattern.c b/pattern.c index a61e7e9..6f5e66a 100644 --- a/pattern.c +++ b/pattern.c @@ -37,7 +37,7 @@ #include #include -#include "mutt_crypt.h" +#include static int eat_regexp (pattern_t * pat, BUFFER *, BUFFER *); static int eat_date (pattern_t * pat, BUFFER *, BUFFER *); diff --git a/pgppubring.c b/pgppubring.c index bb27da1..7b297ed 100644 --- a/pgppubring.c +++ b/pgppubring.c @@ -46,8 +46,8 @@ extern int optind; short Umask; /* dirty hack because we need Umask in lib.c but don't want globals.h there */ #include "lib.h" -#include "pgplib.h" -#include "pgppacket.h" +#include +#include #define MD5_DIGEST_LENGTH 16 diff --git a/pop/pop.c b/pop/pop.c index 73936d1..904f122 100644 --- a/pop/pop.c +++ b/pop/pop.c @@ -19,7 +19,7 @@ #include "mutt.h" #include "mx.h" #include "pop.h" -#include "mutt_crypt.h" +#include #include "mutt_curses.h" #include "lib/debug.h" diff --git a/postpone.c b/postpone.c index 4d34734..e73b39b 100644 --- a/postpone.c +++ b/postpone.c @@ -29,7 +29,7 @@ #include "sort.h" #include "thread.h" #include "mx.h" -#include "mutt_crypt.h" +#include #include #include diff --git a/recvattach.c b/recvattach.c index ea535ef..ec57733 100644 --- a/recvattach.c +++ b/recvattach.c @@ -31,7 +31,7 @@ #include "attach.h" #include "mx.h" #include "copy.h" -#include "mutt_crypt.h" +#include #include diff --git a/send.c b/send.c index 3609f77..cf15950 100644 --- a/send.c +++ b/send.c @@ -26,7 +26,7 @@ #include "keymap.h" #include "copy.h" #include "mx.h" -#include "mutt_crypt.h" +#include #include "mutt_idna.h" #include "url.h" #include "attach.h" diff --git a/sendlib.c b/sendlib.c index fc8462d..03dd11a 100644 --- a/sendlib.c +++ b/sendlib.c @@ -29,7 +29,7 @@ #include "copy.h" #include "pager.h" #include "charset.h" -#include "mutt_crypt.h" +#include #include "mutt_idna.h" #include "lib/debug.h" -- 2.20.1