always use compressed mode.
authorPierre Habouzit <madcoder@debian.org>
Sat, 4 Nov 2006 22:50:16 +0000 (23:50 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sat, 4 Nov 2006 22:50:16 +0000 (23:50 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
compress.c
curs_main.c
doconfig.sh
hook.c
init.h
main.c
mbox.c
mutt.h
mx.c
mx.h
status.c

index 01be9d3..87d8e4f 100644 (file)
@@ -14,8 +14,6 @@
 
 #include "mutt.h"
 
-#ifdef USE_COMPRESSED
-
 #include "mx.h"
 #include "mbox.h"
 #include "mutt_curses.h"
@@ -487,5 +485,3 @@ mx_t* compress_reg_mx (void) {
   fmt->mx_open_mailbox = mutt_open_read_compressed;
   return (fmt);
 }
-
-#endif /* USE_COMPRESSED */
index 53b11c5..80872d0 100644 (file)
@@ -1238,12 +1238,9 @@ int mutt_index_menu (void)
       if (Context) {
         int check;
 
-#ifdef USE_COMPRESSED
         if (Context->compressinfo && Context->realpath)
           m_strreplace(&LastFolder, Context->realpath);
         else
-#endif
-
           m_strreplace(&LastFolder, Context->path);
         oldcount = Context ? Context->msgcount : 0;
 
index 2d110a9..2d0d469 100755 (executable)
@@ -1,2 +1,2 @@
 ./autogen.sh
-./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --with-sharedir=/usr/share/mutt-ng --with-docdir=/usr/share/doc/mutt-ng --with-mailpath=/var/mail --enable-fcntl --enable-pop --enable-imap --with-mixmaster --with-sasl2 --with-idn --with-curses --enable-nntp --enable-debug --enable-compressed --with-gnutls --enable-gpgme
+./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --with-sharedir=/usr/share/mutt-ng --with-docdir=/usr/share/doc/mutt-ng --with-mailpath=/var/mail --enable-fcntl --enable-pop --enable-imap --with-mixmaster --with-sasl2 --with-idn --with-curses --enable-nntp --enable-debug --with-gnutls --enable-gpgme
diff --git a/hook.c b/hook.c
index afa528d..836a882 100644 (file)
--- a/hook.c
+++ b/hook.c
 #include "mutt.h"
 #include "mx.h"
 #include "mutt_crypt.h"
-
-#ifdef USE_COMPRESSED
 #include "compress.h"
-#endif
 
 #include "lib/rx.h"
 
@@ -94,14 +91,12 @@ int mutt_parse_hook (BUFFER * buf __attribute__ ((unused)), BUFFER * s, unsigned
     p_clear(&pattern, 1);
     pattern.data = m_strdup(path);
   }
-#ifdef USE_COMPRESSED
   else if (data & (M_APPENDHOOK | M_OPENHOOK | M_CLOSEHOOK)) {
     if (mutt_test_compress_command (command.data)) {
       m_strcpy(err->data, err->dsize, _("bad formatted command string"));
       return (-1);
     }
   }
-#endif
   else if (DefaultHook && !(data & (M_CHARSETHOOK | M_ACCOUNTHOOK))
            && !(data & M_CRYPTHOOK))
   {
diff --git a/init.h b/init.h
index 92d2a54..e106401 100644 (file)
--- a/init.h
+++ b/init.h
@@ -3891,9 +3891,6 @@ static const char* Features[] = {
 #ifdef USE_LIBESMTP
   "libesmtp",
 #endif
-#ifdef USE_COMPRESSED
-  "compessed",
-#endif
 #ifdef HAVE_COLOR
   "color",
 #endif
@@ -4026,11 +4023,9 @@ struct command_t Commands[] = {
   {"fcc-hook", mutt_parse_hook, M_FCCHOOK},
   {"fcc-save-hook", mutt_parse_hook, M_FCCHOOK|M_SAVEHOOK},
   {"folder-hook", mutt_parse_hook, M_FOLDERHOOK},
-#ifdef USE_COMPRESSED
   {"open-hook", mutt_parse_hook, M_OPENHOOK},
   {"close-hook", mutt_parse_hook, M_CLOSEHOOK},
   {"append-hook", mutt_parse_hook, M_APPENDHOOK},
-#endif
   {"hdr_order", parse_list, UL &HeaderOrderList},
   {"ifdef", parse_ifdef, 1},
   {"ifndef", parse_ifdef, 0},
diff --git a/main.c b/main.c
index b01058b..2e29d02 100644 (file)
--- a/main.c
+++ b/main.c
@@ -356,11 +356,6 @@ static void show_version (void)
          "+USE_GNU_REGEX  "
 #else
          "-USE_GNU_REGEX  "
-#endif
-#ifdef USE_COMPRESSED
-         "+COMPRESSED  "
-#else
-         "-COMPRESSED  "
 #endif
          "\n  "
 #ifdef HAVE_COLOR
diff --git a/mbox.c b/mbox.c
index 7207ea7..cd171b3 100644 (file)
--- a/mbox.c
+++ b/mbox.c
 #include "sort.h"
 #include "thread.h"
 #include "copy.h"
-
-#ifdef USE_COMPRESSED
 #include "compress.h"
-#endif
 
 #include "lib/debug.h"
 
@@ -888,10 +885,8 @@ int mbox_close_mailbox (CONTEXT * ctx)
 {
   mx_unlock_file (ctx->path, fileno (ctx->fp), 1);
 
-#ifdef USE_COMPRESSED
   if (ctx->compressinfo)
     mutt_slow_close_compressed (ctx);
-#endif
 
   mutt_unblock_signals ();
   mx_fastclose_mailbox (ctx);
@@ -1113,10 +1108,8 @@ int mbox_is_magic (const char* path, struct stat* st) {
     return (-1);         /* fopen failed */
   }
 
-#ifdef USE_COMPRESSED
   if (magic == -1 && mutt_can_read_compressed (path))
     return (M_COMPRESSED);
-#endif
   return (magic);
 }
 
diff --git a/mutt.h b/mutt.h
index e0b9fb3..41005f2 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -101,11 +101,9 @@ typedef enum {
 #define M_REPLYHOOK    (1<<10)
 #define M_SEND2HOOK     (1<<11)
 
-#ifdef USE_COMPRESSED
 #define M_OPENHOOK     (1<<12)
 #define M_APPENDHOOK   (1<<13)
 #define M_CLOSEHOOK    (1<<14)
-#endif
 
 /* tree characters for linearize_tree and print_enriched_string */
 #define M_TREE_LLCORNER                1
@@ -778,10 +776,8 @@ typedef struct {
 
   short magic;                  /* mailbox type */
 
-#ifdef USE_COMPRESSED
   void *compressinfo;           /* compressed mbox module private data */
   char *realpath;               /* path to compressed mailbox */
-#endif                          /* USE_COMPRESSED */
 
   unsigned int locked:1;        /* is the mailbox locked? */
   unsigned int changed:1;       /* mailbox has been modified */
diff --git a/mx.c b/mx.c
index 05f0552..760b1dc 100644 (file)
--- a/mx.c
+++ b/mx.c
 #include "keymap.h"
 #include "url.h"
 #include "sidebar.h"
-
-#ifdef USE_COMPRESSED
 #include "compress.h"
-#endif
 
 #ifdef USE_IMAP
 #include "imap/imap.h"
@@ -385,12 +382,10 @@ static int mx_open_mailbox_append (CONTEXT * ctx, int flags)
 {
   struct stat sb;
 
-#ifdef USE_COMPRESSED
   /* special case for appending to compressed folders -
    * even if we can not open them for reading */
   if (mutt_can_append_compressed (ctx->path))
     mutt_open_append_compressed (ctx);
-#endif
 
   ctx->append = 1;
 
@@ -540,10 +535,8 @@ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT * pctx)
   if (!MX_IDX(ctx->magic-1))
     ctx->magic = mx_get_magic (path);
 
-#ifdef USE_COMPRESSED
   if (ctx->magic == M_COMPRESSED)
     mutt_open_read_compressed (ctx);
-#endif
 
   if (ctx->magic == 0)
     mutt_error (_("%s is not a mailbox."), path);
@@ -610,10 +603,10 @@ void mx_fastclose_mailbox (CONTEXT * ctx)
     mutt_free_header (&ctx->hdrs[i]);
   p_delete(&ctx->hdrs);
   p_delete(&ctx->v2r);
-#ifdef USE_COMPRESSED
+
   if (ctx->compressinfo)
     mutt_fast_close_compressed (ctx);
-#endif
+
   p_delete(&ctx->path);
   p_delete(&ctx->pattern);
   if (ctx->limit_pattern)
@@ -634,10 +627,8 @@ static int sync_mailbox (CONTEXT * ctx, int *index_hint)
     /* the 1 is only of interest for IMAP and means EXPUNGE */
     rc = MX_COMMAND(ctx->magic-1,mx_sync_mailbox(ctx,1,index_hint));
 
-#ifdef USE_COMPRESSED
   if (rc == 0 && ctx->compressinfo)
     return mutt_sync_compressed (ctx);
-#endif
 
   return rc;
 }
@@ -884,10 +875,8 @@ static int _mx_close_mailbox (CONTEXT * ctx, int *index_hint)
       !mutt_is_spool (ctx->path) && !option (OPTSAVEEMPTY))
     mx_unlink_empty (ctx->path);
 
-#ifdef USE_COMPRESSED
   if (ctx->compressinfo && mutt_slow_close_compressed (ctx))
     return (-1);
-#endif
 
   mx_fastclose_mailbox (ctx);
 
@@ -1162,10 +1151,8 @@ MESSAGE *mx_open_new_message (CONTEXT * dest, HEADER * hdr, int flags)
 
 /* check for new mail */
 int mx_check_mailbox (CONTEXT * ctx, int *index_hint, int lock) {
-#ifdef USE_COMPRESSED
   if (ctx->compressinfo)
     return mutt_check_mailbox_compressed (ctx);
-#endif
 
   if (ctx) {
     if (ctx->locked)
@@ -1421,9 +1408,7 @@ void mx_init (void) {
 #ifdef USE_NNTP
   list_push_back (&MailboxFormats, (void*) nntp_reg_mx ());
 #endif
-#ifdef USE_COMPRESSED
   list_push_back (&MailboxFormats, (void*) compress_reg_mx ());
-#endif
 #ifdef DEBUG
   /* check module registration for completeness with debug versions */
 #define EXITWITHERR(m) do { fprintf(stderr, "error: incomplete mx module: %s is missing for type %i\n",m,i);exit(1); } while (0)
diff --git a/mx.h b/mx.h
index 74f02f1..b5fdd6b 100644 (file)
--- a/mx.h
+++ b/mx.h
  * in mx_init() the registration order must be exactly as given here!!!1!
  */
 enum {
-  M_MBOX = 1,
-  M_MMDF,
-  M_MH,
-  M_MAILDIR
+    M_MBOX = 1,
+    M_MMDF,
+    M_MH,
+    M_MAILDIR,
 #ifdef USE_IMAP
-    , M_IMAP
+    M_IMAP,
 #endif
 #ifdef USE_POP
-    , M_POP
+    M_POP,
 #endif
 #ifdef USE_NNTP
-    , M_NNTP
-#endif
-#ifdef USE_COMPRESSED
-    , M_COMPRESSED
+    M_NNTP,
 #endif
+    M_COMPRESSED
 };
 
 enum {
index f8ffd92..47abf57 100644 (file)
--- a/status.c
+++ b/status.c
@@ -81,7 +81,6 @@ static const char *status_format_str (char *buf, size_t buflen, char op,
 
   case 'B':
     snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
-#ifdef USE_COMPRESSED
     if (Context && Context->compressinfo && Context->realpath) {
       if ((p = strrchr (Context->realpath, '/')))
         m_strcpy(tmp, sizeof(tmp), p + 1);
@@ -89,7 +88,6 @@ static const char *status_format_str (char *buf, size_t buflen, char op,
         m_strcpy(tmp, sizeof(tmp), Context->realpath);
     }
     else
-#endif
     if (Context && Context->path) {
       if ((p = strrchr (Context->path, '/')))
         m_strcpy(tmp, sizeof(tmp), p + 1);
@@ -117,13 +115,11 @@ static const char *status_format_str (char *buf, size_t buflen, char op,
 
   case 'f':
     snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
-#ifdef USE_COMPRESSED
     if (Context && Context->compressinfo && Context->realpath) {
       m_strcpy(tmp, sizeof(tmp), Context->realpath);
       mutt_pretty_mailbox (tmp);
     }
     else
-#endif
     if (Context && Context->path) {
       m_strcpy(tmp, sizeof(tmp), Context->path);
       mutt_pretty_mailbox (tmp);