From 800fcfc953f0dbbe7783277b7dc202f05fcc3e2c Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Thu, 3 Aug 2017 14:32:54 +0100 Subject: [PATCH] rename the library to libmutt - strip lib_ prefix from files - rename liblib to libmutt The only renaming complication was `lib_string.h`. It's been renamed to `string2.h` so that `#include ` still works. --- Makefile.am | 16 ++++++++-------- hcache/Makefile.am | 4 ++-- lib/Makefile.am | 7 +++---- lib/{lib_ascii.c => ascii.c} | 2 +- lib/{lib_ascii.h => ascii.h} | 0 lib/{lib_base64.c => base64.c} | 2 +- lib/{lib_base64.h => base64.h} | 0 lib/{lib_buffer.c => buffer.c} | 6 +++--- lib/{lib_buffer.h => buffer.h} | 0 lib/{lib_date.c => date.c} | 0 lib/{lib_date.h => date.h} | 0 lib/{lib_debug.c => debug.c} | 0 lib/{lib_debug.h => debug.h} | 0 lib/{lib_exit.c => exit.c} | 0 lib/{lib_exit.h => exit.h} | 0 lib/{lib_file.c => file.c} | 8 ++++---- lib/{lib_file.h => file.h} | 0 lib/{lib_hash.c => hash.c} | 6 +++--- lib/{lib_hash.h => hash.h} | 0 lib/lib.h | 26 +++++++++++++------------- lib/{lib_md5.c => md5.c} | 2 +- lib/{lib_md5.h => md5.h} | 0 lib/{lib_memory.c => memory.c} | 6 +++--- lib/{lib_memory.h => memory.h} | 0 lib/{lib_message.c => message.c} | 2 +- lib/{lib_message.h => message.h} | 0 lib/{lib_sha1.c => sha1.c} | 2 +- lib/{lib_sha1.h => sha1.h} | 0 lib/{lib_string.c => string.c} | 4 ++-- lib/{lib_string.h => string2.h} | 4 ++++ 30 files changed, 50 insertions(+), 47 deletions(-) rename lib/{lib_ascii.c => ascii.c} (99%) rename lib/{lib_ascii.h => ascii.h} (100%) rename lib/{lib_base64.c => base64.c} (99%) rename lib/{lib_base64.h => base64.h} (100%) rename lib/{lib_buffer.c => buffer.c} (98%) rename lib/{lib_buffer.h => buffer.h} (100%) rename lib/{lib_date.c => date.c} (100%) rename lib/{lib_date.h => date.h} (100%) rename lib/{lib_debug.c => debug.c} (100%) rename lib/{lib_debug.h => debug.h} (100%) rename lib/{lib_exit.c => exit.c} (100%) rename lib/{lib_exit.h => exit.h} (100%) rename lib/{lib_file.c => file.c} (99%) rename lib/{lib_file.h => file.h} (100%) rename lib/{lib_hash.c => hash.c} (99%) rename lib/{lib_hash.h => hash.h} (100%) rename lib/{lib_md5.c => md5.c} (99%) rename lib/{lib_md5.h => md5.h} (100%) rename lib/{lib_memory.c => memory.c} (97%) rename lib/{lib_memory.h => memory.h} (100%) rename lib/{lib_message.c => message.c} (99%) rename lib/{lib_message.h => message.h} (100%) rename lib/{lib_sha1.c => sha1.c} (99%) rename lib/{lib_sha1.h => sha1.h} (100%) rename lib/{lib_string.c => string.c} (99%) rename lib/{lib_string.h => string2.h} (96%) diff --git a/Makefile.am b/Makefile.am index 168d37484..d6cf7f7dc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,14 +64,14 @@ nodist_mutt_SOURCES = $(BUILT_SOURCES) LIBIMAP = -Limap -limap LIBIMAPDEPS = $(top_srcdir)/imap/imap.h imap/libimap.a -LIBLIB = -Llib -llib -LIBLIBDEPS = $(top_srcdir)/lib/lib.h lib/liblib.a +LIBMUTT = -Llib -lmutt +LIBMUTTDEPS = $(top_srcdir)/lib/lib.h lib/libmutt.a mutt_LDADD = $(MUTT_LIB_OBJECTS) $(LIBOBJS) $(HCACHE_LIBS) $(NCRYPT_LIBS) \ - $(LIBIMAP) $(LIBLIB) $(LIBICONV) $(GPGME_LIBS) $(INTLLIBS) + $(LIBIMAP) $(LIBMUTT) $(LIBICONV) $(GPGME_LIBS) $(INTLLIBS) mutt_DEPENDENCIES = $(MUTT_LIB_OBJECTS) $(LIBOBJS) $(LIBIMAPDEPS) \ - $(LIBLIBDEPS) $(HCACHE_DEPS) $(NCRYPT_DEPS) $(INTLDEPS) + $(LIBMUTTDEPS) $(HCACHE_DEPS) $(NCRYPT_DEPS) $(INTLDEPS) DEFS=-DPKGDATADIR=\"$(pkgdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \ -DBINDIR=\"$(bindir)\" -DMUTTLOCALEDIR=\"$(datadir)/locale\" @@ -99,12 +99,12 @@ EXTRA_DIST = account.h attach.h bcache.h browser.h buffy.h \ EXTRA_SCRIPTS = pgpring_SOURCES = pgppubring.c -pgpring_LDADD = $(LIBOBJS) $(NCRYPT_LIBS) $(INTLLIBS) $(LIBLIB) -pgpring_DEPENDENCIES = $(LIBOBJS) $(NCRYPT_DEPS) $(INTLDEPS) $(LIBLIBDEPS) +pgpring_LDADD = $(LIBOBJS) $(NCRYPT_LIBS) $(INTLLIBS) $(LIBMUTT) +pgpring_DEPENDENCIES = $(LIBOBJS) $(NCRYPT_DEPS) $(INTLDEPS) $(LIBMUTTDEPS) mutt_md5_SOURCES = md5.c -mutt_md5_LDADD = $(LIBLIB) -mutt_md5_DEPENDENCIES = $(LIBLIBDEPS) +mutt_md5_LDADD = $(LIBMUTT) +mutt_md5_DEPENDENCIES = $(LIBMUTTDEPS) txt2c_SOURCES = txt2c.c txt2c_LDADD = diff --git a/hcache/Makefile.am b/hcache/Makefile.am index 034c5cc3a..1db24b9be 100644 --- a/hcache/Makefile.am +++ b/hcache/Makefile.am @@ -45,12 +45,12 @@ $(top_srcdir)/keymap_defs.h: +$(MAKE) -C $(top_srcdir) keymap_defs.h hcversion.h: $(top_srcdir)/mutt.h $(top_srcdir)/address.h $(top_srcdir)/list.h \ - $(top_srcdir)/lib/lib_buffer.h $(top_srcdir)/parameter.h \ + $(top_srcdir)/lib/buffer.h $(top_srcdir)/parameter.h \ $(top_srcdir)/body.h $(top_srcdir)/envelope.h \ $(top_srcdir)/header.h $(srcdir)/hcachever.sh ../$(MUTT_MD5) ( echo '#include "config.h"'; echo '#include "mutt.h"'; \ echo '#include "address.h"'; echo '#include "list.h"'; \ - echo '#include "lib/lib_buffer.h"'; echo '#include "parameter.h"'; \ + echo '#include "lib/buffer.h"'; echo '#include "parameter.h"'; \ echo '#include "body.h"'; echo '#include "envelope.h"'; \ echo '#include "header.h"'; \ ) | $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - | sh $(srcdir)/hcachever.sh hcversion.h diff --git a/lib/Makefile.am b/lib/Makefile.am index cc07a1add..6cb05204b 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -3,12 +3,11 @@ include $(top_srcdir)/flymake.am AUTOMAKE_OPTIONS = 1.6 foreign -EXTRA_DIST = lib.h lib_ascii.h lib_base64.h lib_buffer.h lib_date.h lib_debug.h lib_exit.h lib_file.h lib_hash.h lib_md5.h lib_memory.h lib_message.h lib_sha1.h lib_string.h +EXTRA_DIST = lib.h ascii.h base64.h buffer.h date.h debug.h exit.h file.h hash.h md5.h memory.h message.h sha1.h string2.h AM_CPPFLAGS = -I$(top_srcdir) -noinst_LIBRARIES = liblib.a -noinst_HEADERS = +noinst_LIBRARIES = libmutt.a -liblib_a_SOURCES = lib_ascii.c lib_base64.c lib_buffer.c lib_date.c lib_debug.c lib_exit.c lib_file.c lib_hash.c lib_md5.c lib_memory.c lib_message.c lib_sha1.c lib_string.c +libmutt_a_SOURCES = ascii.c base64.c buffer.c date.c debug.c exit.c file.c hash.c md5.c memory.c message.c sha1.c string.c diff --git a/lib/lib_ascii.c b/lib/ascii.c similarity index 99% rename from lib/lib_ascii.c rename to lib/ascii.c index d8998e20c..2fdcb7509 100644 --- a/lib/lib_ascii.c +++ b/lib/ascii.c @@ -40,7 +40,7 @@ #include "config.h" #include #include -#include "lib_ascii.h" +#include "ascii.h" /** * ascii_strcasecmp - Compare strings, ignoring the case diff --git a/lib/lib_ascii.h b/lib/ascii.h similarity index 100% rename from lib/lib_ascii.h rename to lib/ascii.h diff --git a/lib/lib_base64.c b/lib/base64.c similarity index 99% rename from lib/lib_base64.c rename to lib/base64.c index efd5ba3bb..8fccd7b55 100644 --- a/lib/lib_base64.c +++ b/lib/base64.c @@ -37,7 +37,7 @@ */ #include "config.h" -#include "lib_base64.h" +#include "base64.h" #define BAD -1 diff --git a/lib/lib_base64.h b/lib/base64.h similarity index 100% rename from lib/lib_base64.h rename to lib/base64.h diff --git a/lib/lib_buffer.c b/lib/buffer.c similarity index 98% rename from lib/lib_buffer.c rename to lib/buffer.c index e45e2f4b7..fdc1a22c6 100644 --- a/lib/lib_buffer.c +++ b/lib/buffer.c @@ -40,9 +40,9 @@ #include #include #include -#include "lib_buffer.h" -#include "lib_memory.h" -#include "lib_string.h" +#include "buffer.h" +#include "memory.h" +#include "string2.h" /** * mutt_buffer_new - Create and initialise a Buffer diff --git a/lib/lib_buffer.h b/lib/buffer.h similarity index 100% rename from lib/lib_buffer.h rename to lib/buffer.h diff --git a/lib/lib_date.c b/lib/date.c similarity index 100% rename from lib/lib_date.c rename to lib/date.c diff --git a/lib/lib_date.h b/lib/date.h similarity index 100% rename from lib/lib_date.h rename to lib/date.h diff --git a/lib/lib_debug.c b/lib/debug.c similarity index 100% rename from lib/lib_debug.c rename to lib/debug.c diff --git a/lib/lib_debug.h b/lib/debug.h similarity index 100% rename from lib/lib_debug.h rename to lib/debug.h diff --git a/lib/lib_exit.c b/lib/exit.c similarity index 100% rename from lib/lib_exit.c rename to lib/exit.c diff --git a/lib/lib_exit.h b/lib/exit.h similarity index 100% rename from lib/lib_exit.h rename to lib/exit.h diff --git a/lib/lib_file.c b/lib/file.c similarity index 99% rename from lib/lib_file.c rename to lib/file.c index e33592872..3d6d2b504 100644 --- a/lib/lib_file.c +++ b/lib/file.c @@ -59,10 +59,10 @@ #include #include #include -#include "lib_file.h" -#include "lib_debug.h" -#include "lib_memory.h" -#include "lib_string.h" +#include "file.h" +#include "debug.h" +#include "memory.h" +#include "string2.h" /* these characters must be escaped in regular expressions */ static const char rx_special_chars[] = "^.[$()|*+?{\\"; diff --git a/lib/lib_file.h b/lib/file.h similarity index 100% rename from lib/lib_file.h rename to lib/file.h diff --git a/lib/lib_hash.c b/lib/hash.c similarity index 99% rename from lib/lib_hash.c rename to lib/hash.c index 6bdfbf5d8..36db1df71 100644 --- a/lib/lib_hash.c +++ b/lib/hash.c @@ -44,9 +44,9 @@ #include "config.h" #include #include -#include "lib_hash.h" -#include "lib_memory.h" -#include "lib_string.h" +#include "hash.h" +#include "memory.h" +#include "string2.h" #define SOMEPRIME 149711 diff --git a/lib/lib_hash.h b/lib/hash.h similarity index 100% rename from lib/lib_hash.h rename to lib/hash.h diff --git a/lib/lib.h b/lib/lib.h index 068bad8bb..7a082ec31 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -46,18 +46,18 @@ #ifndef _LIB_LIB_H #define _LIB_LIB_H -#include "lib_ascii.h" -#include "lib_base64.h" -#include "lib_buffer.h" -#include "lib_date.h" -#include "lib_debug.h" -#include "lib_exit.h" -#include "lib_file.h" -#include "lib_hash.h" -#include "lib_md5.h" -#include "lib_memory.h" -#include "lib_message.h" -#include "lib_sha1.h" -#include "lib_string.h" +#include "ascii.h" +#include "base64.h" +#include "buffer.h" +#include "date.h" +#include "debug.h" +#include "exit.h" +#include "file.h" +#include "hash.h" +#include "md5.h" +#include "memory.h" +#include "message.h" +#include "sha1.h" +#include "string2.h" #endif /* _LIB_LIB_H */ diff --git a/lib/lib_md5.c b/lib/md5.c similarity index 99% rename from lib/lib_md5.c rename to lib/md5.c index 75ae954a4..6d3ed5d55 100644 --- a/lib/lib_md5.c +++ b/lib/md5.c @@ -46,7 +46,7 @@ #include #include #include -#include "lib_md5.h" +#include "md5.h" #ifdef WORDS_BIGENDIAN #define SWAP(n) \ diff --git a/lib/lib_md5.h b/lib/md5.h similarity index 100% rename from lib/lib_md5.h rename to lib/md5.h diff --git a/lib/lib_memory.c b/lib/memory.c similarity index 97% rename from lib/lib_memory.c rename to lib/memory.c index 2385bfec2..49385129f 100644 --- a/lib/lib_memory.c +++ b/lib/memory.c @@ -39,9 +39,9 @@ #include #include #include -#include "lib_memory.h" -#include "lib_exit.h" -#include "lib_message.h" +#include "memory.h" +#include "exit.h" +#include "message.h" /** * safe_calloc - Allocate zeroed memory on the heap diff --git a/lib/lib_memory.h b/lib/memory.h similarity index 100% rename from lib/lib_memory.h rename to lib/memory.h diff --git a/lib/lib_message.c b/lib/message.c similarity index 99% rename from lib/lib_message.c rename to lib/message.c index 170510187..401c341d8 100644 --- a/lib/lib_message.c +++ b/lib/message.c @@ -39,7 +39,7 @@ #include #include #include -#include "lib_memory.h" +#include "memory.h" /** * default_error - Display an error message diff --git a/lib/lib_message.h b/lib/message.h similarity index 100% rename from lib/lib_message.h rename to lib/message.h diff --git a/lib/lib_sha1.c b/lib/sha1.c similarity index 99% rename from lib/lib_sha1.c rename to lib/sha1.c index 291cc68c8..56cfe66ec 100644 --- a/lib/lib_sha1.c +++ b/lib/sha1.c @@ -30,7 +30,7 @@ #include "config.h" #include -#include "lib_sha1.h" +#include "sha1.h" #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) diff --git a/lib/lib_sha1.h b/lib/sha1.h similarity index 100% rename from lib/lib_sha1.h rename to lib/sha1.h diff --git a/lib/lib_string.c b/lib/string.c similarity index 99% rename from lib/lib_string.c rename to lib/string.c index 79069245e..59956954e 100644 --- a/lib/lib_string.c +++ b/lib/string.c @@ -58,8 +58,8 @@ #include #include #include -#include "lib_string.h" -#include "lib_memory.h" +#include "string2.h" +#include "memory.h" /** * mutt_atol - Convert ASCII string to a long diff --git a/lib/lib_string.h b/lib/string2.h similarity index 96% rename from lib/lib_string.h rename to lib/string2.h index 95c24d609..6c027b61d 100644 --- a/lib/lib_string.h +++ b/lib/string2.h @@ -20,6 +20,10 @@ * this program. If not, see . */ +/* NOTE: This file is called string2.h so that other files can safely + * #include + */ + #ifndef _LIB_STRING_H #define _LIB_STRING_H -- 2.40.0