From fc7b90fd61ac9efd35a5b506cc10679969d84cba Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sat, 10 Mar 2007 02:58:33 +0100 Subject: [PATCH 1/1] Move things around: more DT_SYS variables into the lua ! Signed-off-by: Pierre Habouzit --- Makefile.am | 7 ++----- commands.c | 2 +- compose.c | 2 +- init.h | 47 ----------------------------------------------- lib-ui/status.c | 2 +- main.c | 4 ++-- muttlib.c | 12 ++---------- protos.h | 2 +- sendlib.c | 2 +- 9 files changed, 11 insertions(+), 69 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7b375e0..371b877 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ SUBDIRS = intl m4 po $(XXXXXXXXXXXX_doc) apidoc contrib \ lib-mime lib-lib lib-lua lib-mx lib-crypt lib-hash lib-sys lib-ui \ pop imap $(NNTP_SUBDIR) -BUILT_SOURCES = keymap_defs.h version.h charset.gperf +BUILT_SOURCES = keymap_defs.h charset.gperf DISTCLEANFILES = $(BUILT_SOURCES) bin_PROGRAMS = madmutt madmutt_dotlock pgpringng pgpewrapng smime_keysng @@ -93,7 +93,7 @@ pgpewrapng_SOURCES = pgpewrap.c pgpewrapng_LDADD = pgpewrapng_DEPENDENCIES = -CLEANFILES = stamp-doc-rc makedoc keymap_defs.h version.h Madmuttrc +CLEANFILES = stamp-doc-rc makedoc keymap_defs.h Madmuttrc ACLOCAL_AMFLAGS = -I m4 @@ -109,9 +109,6 @@ smime_keysng: $(srcdir)/smime_keys.pl keymap_defs.h: OPS $(srcdir)/gen_defs $^ > keymap_defs.h -version.h: - echo "#define MUTT_REVISION \"git\"" > version.h - install-exec-hook: if test -f $(DESTDIR)$(bindir)/mutt.dotlock && test -f $(DESTDIR)$(bindir)/madmutt_dotlock ; then \ rm -f $(DESTDIR)$(bindir)/mutt.dotlock ; \ diff --git a/commands.c b/commands.c index 3590596..3493587 100644 --- a/commands.c +++ b/commands.c @@ -777,7 +777,7 @@ int mutt_save_message (HEADER * h, int delete, void mutt_version (void) { - mutt_message (mutt_make_version (1)); + mutt_message (mutt_make_version()); } void mutt_edit_content_type (HEADER * h, BODY * b, FILE * fp) diff --git a/compose.c b/compose.c index 7e74f61..c695f3b 100644 --- a/compose.c +++ b/compose.c @@ -436,7 +436,7 @@ static const char *compose_format_str (char *buf, ssize_t buflen, char op, break; case 'v': - m_strcpy(buf, buflen, mutt_make_version (0)); + m_strcpy(buf, buflen, mutt_make_version()); break; case 0: diff --git a/init.h b/init.h index a2d228b..46a2cd1 100644 --- a/init.h +++ b/init.h @@ -19,7 +19,6 @@ #include "buffy.h" #include "mutt.h" -#include "version.h" #ifndef _MAKEDOC #define DT_MASK 0x0f @@ -1367,52 +1366,6 @@ struct option_t MuttVars[] = { ** This specifies the folder into which read mail in your ``$$spoolfile'' ** folder will be appended. */ - {"madmutt_version", DT_SYS, R_NONE, 0, VERSION }, - /* - ** .pp - ** \fIThis is a read-only system property and specifies madmutt's - ** version string.\fP - */ - {"madmutt_revision", DT_SYS, R_NONE, 0, MUTT_REVISION }, - /* - ** .pp - ** \fIThis is a read-only system property and specifies madmutt's - ** subversion revision string.\fP - */ - {"madmutt_sysconfdir", DT_SYS, R_NONE, 0, SYSCONFDIR }, - /* - ** .pp - ** \fIThis is a read-only system property and specifies the - ** directory containing the madmutt system-wide configuration.\fP - */ - {"madmutt_bindir", DT_SYS, R_NONE, 0, BINDIR }, - /* - ** .pp - ** \fIThis is a read-only system property and specifies the - ** directory containing the madmutt binary.\fP - */ - {"madmutt_docdir", DT_SYS, R_NONE, 0, PKGDOCDIR }, - /* - ** .pp - ** \fIThis is a read-only system property and specifies the - ** directory containing the madmutt documentation.\fP - */ -#ifdef USE_HCACHE -#if defined(HAVE_QDBM) - {"madmutt_hcache_backend", DT_SYS, R_NONE, 0, "qdbm" }, -#elif defined(HAVE_GDBM) - {"madmutt_hcache_backend", DT_SYS, R_NONE, 0, "gdbm" }, -#elif defined(HAVE_DB4) - {"madmutt_hcache_backend", DT_SYS, R_NONE, 0, "db4" }, -#else - {"madmutt_hcache_backend", DT_SYS, R_NONE, 0, "unknown" }, -#endif - /* - ** .pp - ** \fIThis is a read-only system property and specifies the - ** header chaching's database backend.\fP - */ -#endif {"madmutt_folder_path", DT_SYS, R_NONE, 0, "" }, /* ** .pp diff --git a/lib-ui/status.c b/lib-ui/status.c index 9c4bdf9..02d38b2 100644 --- a/lib-ui/status.c +++ b/lib-ui/status.c @@ -256,7 +256,7 @@ status_format_str(char *buf, ssize_t buflen, char op, const char *src, break; case 'v': - m_strcpy(buf, buflen, mutt_make_version(0)); + m_strcpy(buf, buflen, mutt_make_version()); break; case 'V': diff --git a/main.c b/main.c index f452ba2..adb387d 100644 --- a/main.c +++ b/main.c @@ -90,7 +90,7 @@ void mutt_exit (int code) static void mutt_usage (void) { - puts (mutt_make_version (1)); + puts (mutt_make_version()); puts _("usage: madmutt [ -nRyzZ ] [ -e ] [ -F ] [ -m ] [ -f ]\n\ @@ -144,7 +144,7 @@ static void show_version (void) char buf[STRING]; #endif - puts (mutt_make_version (1)); + puts (mutt_make_version()); puts (_(Notice)); uname (&uts); diff --git a/muttlib.c b/muttlib.c index 6ff6d89..1aadda3 100644 --- a/muttlib.c +++ b/muttlib.c @@ -21,7 +21,6 @@ #include "alias.h" #include "mutt.h" #include "attach.h" -#include "version.h" /* Modified by blong to accept a "suggestion" for file name. If * that file exists, then construct one with unique name but @@ -380,17 +379,10 @@ void mutt_sleep (short s) sleep(MAX(s, SleepTime)); } -const char *mutt_make_version (int full) +const char *mutt_make_version(void) { static char vstring[STRING]; - - if (full) - snprintf (vstring, sizeof (vstring), - "Madmutt/%s-r%s (based on Mutt 1.5.11)", - MUTT_VERSION, MUTT_REVISION); - else - snprintf (vstring, sizeof (vstring), "Madmutt/%s-%s", - MUTT_VERSION, MUTT_REVISION); + snprintf(vstring, sizeof (vstring), "Madmutt/%s", MUTT_VERSION); return vstring; } diff --git a/protos.h b/protos.h index 52f9e69..6f9f5b1 100644 --- a/protos.h +++ b/protos.h @@ -45,7 +45,7 @@ const char *mutt_get_name (address_t *); const char *mutt_crypt_hook (address_t *); char *mutt_make_date (char *, ssize_t); -const char *mutt_make_version (int full); +const char *mutt_make_version(void); const char *mutt_fqdn (short); diff --git a/sendlib.c b/sendlib.c index 6ad7ed0..73d41b3 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1505,7 +1505,7 @@ int mutt_write_rfc822_header (FILE * fp, ENVELOPE * env, BODY * attach, os = (uname(&un) == -1) ? "UNIX" : un.sysname; } /* Add a vanity header */ - fprintf (fp, "User-Agent: %s (%s)\n", mutt_make_version (0), os); + fprintf (fp, "User-Agent: %s (%s)\n", mutt_make_version(), os); } return (ferror (fp) == 0 ? 0 : -1); -- 2.20.1