more fixes
[apps/madmutt.git] / mh.c
diff --git a/mh.c b/mh.c
index 4b03ef8..cfe7c36 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -24,6 +24,7 @@
 #include "copy.h"
 #include "buffy.h"
 #include "sort.h"
+#include "thread.h"
 #include "hcache.h"
 
 #include "lib/mem.h"
@@ -702,7 +703,12 @@ static int maildir_parse_dir (CONTEXT * ctx, struct maildir ***last,
 
     debug_print (2, ("parsing %s\n", de->d_name));
     maildir_parse_entry (ctx, last, subdir, de->d_name, count, is_old,
-                         de->d_ino);
+#if HAVE_DIRENT_D_INO
+                         de->d_ino
+#else
+                         0
+#endif
+                        );
   }
 
   closedir (dirp);
@@ -831,7 +837,7 @@ static struct maildir *maildir_sort_inode (struct maildir *list)
 }
 #endif /* USE_INODESORT */
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
 static size_t maildir_hcache_keylen (const char *fn)
 {
   const char *p = strchr (fn, ':');
@@ -850,7 +856,7 @@ void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
   char fn[_POSIX_PATH_MAX];
   int count;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   void *hc = NULL;
   void *data;
   struct timeval *when = NULL;
@@ -864,7 +870,7 @@ void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
     if (!(p && p->h && !p->header_parsed))
       continue;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
     data = mutt_hcache_fetch (hc, p->h->path + 3, &maildir_hcache_keylen);
     when = (struct timeval *) data;
 #endif
@@ -873,7 +879,7 @@ void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
       mutt_message (_("Reading %s... %d"), ctx->path, count);
     snprintf (fn, sizeof (fn), "%s/%s", ctx->path, p->h->path);
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
     if (option (OPTHCACHEVERIFY)) {
       ret = stat (fn, &lastchanged);
     }
@@ -891,17 +897,17 @@ void maildir_delayed_parsing (CONTEXT * ctx, struct maildir *md)
     if (maildir_parse_message (ctx->magic, fn, p->h->old, p->h)) {
       p->header_parsed = 1;
       maildir_parse_flags (p->h, fn);
-#if USE_HCACHE
+#ifdef USE_HCACHE
       mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen);
 #endif
     }
     else
       mutt_free_header (&p->h);
-#if USE_HCACHE
+#ifdef USE_HCACHE
     mem_free (&data);
 #endif
   }
-#if USE_HCACHE
+#ifdef USE_HCACHE
   mutt_hcache_close (hc);
 #endif
 }
@@ -1379,7 +1385,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int unused, int *index_hint)
   char path[_POSIX_PATH_MAX], tmp[_POSIX_PATH_MAX];
   int i, j;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   void *hc = NULL;
 #endif /* USE_HCACHE */
 
@@ -1391,7 +1397,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int unused, int *index_hint)
   if (i != 0)
     return i;
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   if (ctx->magic == M_MAILDIR)
     hc = mutt_hcache_open (HeaderCache, ctx->path);
 #endif /* USE_HCACHE */
@@ -1402,7 +1408,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int unused, int *index_hint)
       snprintf (path, sizeof (path), "%s/%s", ctx->path, ctx->hdrs[i]->path);
       if (ctx->magic == M_MAILDIR
           || (option (OPTMHPURGE) && ctx->magic == M_MH)) {
-#if USE_HCACHE
+#ifdef USE_HCACHE
         if (ctx->magic == M_MAILDIR)
           mutt_hcache_delete (hc, ctx->hdrs[i]->path + 3,
                               &maildir_hcache_keylen);
@@ -1435,7 +1441,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int unused, int *index_hint)
     }
   }
 
-#if USE_HCACHE
+#ifdef USE_HCACHE
   if (ctx->magic == M_MAILDIR)
     mutt_hcache_close (hc);
 #endif /* USE_HCACHE */
@@ -1460,7 +1466,7 @@ static int mh_sync_mailbox (CONTEXT * ctx, int unused, int *index_hint)
   return 0;
 
 err:
-#if USE_HCACHE
+#ifdef USE_HCACHE
   if (ctx->magic == M_MAILDIR)
     mutt_hcache_close (hc);
 #endif /* USE_HCACHE */