]> granicus.if.org Git - neomutt/commitdiff
Update QDBM patch to the current state of the art. Closes: #2003 (again).
authorTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Thu, 22 Sep 2005 16:38:08 +0000 (16:38 +0000)
committerTAKAHASHI Tamotsu <ttakah@lapis.plala.or.jp>
Thu, 22 Sep 2005 16:38:08 +0000 (16:38 +0000)
configure.in
globals.h
hcache.c
init.h

index a314297a87c3873cc73ef9e5097388420c3757d8..237c2ac2cc4aafdb10f37c62135d1074ba65a872 100644 (file)
@@ -825,7 +825,7 @@ AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching])
         LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$BDB_LIB"
         AC_DEFINE(HAVE_DB4, 1, [Sleepycat DB4 Support])
     else
-        AC_MSG_ERROR(You need Sleepycat DB4 or GDBM for --enable-hcache)
+        AC_MSG_ERROR(You need QDBM, Sleepycat DB4 or GDBM for --enable-hcache)
     fi
 fi])
 dnl -- end cache --
index 3d4ee63b242bb7eb0ed02f7ebc6cfe57ddf37e01..196594d31c7a82350f27a4e8b1fa26a0dc8fc6ef 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -69,8 +69,10 @@ WHERE char *MailcapPath;
 WHERE char *Maildir;
 #if USE_HCACHE
 WHERE char *HeaderCache;
+#if HAVE_GDBM || HAVE_DB4
 WHERE char *HeaderCachePageSize;
-#endif
+#endif /* HAVE_GDBM || HAVE_DB4 */
+#endif /* USE_HCACHE */
 WHERE char *MhFlagged;
 WHERE char *MhReplied;
 WHERE char *MhUnseen;
index 440869efe47a37271f9efbe25d03c680a9ae2634..e8145bc7e13b9c4db5000b85516d8e21c03ca995 100644 (file)
--- a/hcache.c
+++ b/hcache.c
@@ -631,10 +631,7 @@ void *
 mutt_hcache_open(const char *path, const char *folder)
 {
   struct header_cache *h = safe_calloc(1, sizeof (HEADER_CACHE));
-  int    flags = 0;
-#if 0 /* FIXME */
-  int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384;
-#endif
+  int    flags = VL_OWRITER | VL_OCREAT;
   h->db = NULL;
   h->folder = safe_strdup(folder);
   h->crc = generate_crc32();
@@ -649,10 +646,9 @@ mutt_hcache_open(const char *path, const char *folder)
   path = mutt_hcache_per_folder(path, folder);
 
   if (option(OPTHCACHECOMPRESS))
-    flags = VL_OZCOMP;
+    flags |= VL_OZCOMP;
 
   h->db = vlopen(path, flags, VL_CMPLEX);
-
   if (h->db)
     return h;
   else
diff --git a/init.h b/init.h
index 3d9b9e2b72bac0aec3054c2efbb4e1b917defe7c..6b05b7cea6b9e23034e898913f572de601d21353 100644 (file)
--- a/init.h
+++ b/init.h
@@ -1069,6 +1069,7 @@ struct option_t MuttVars[] = {
   ** files when the header cache is in use.  This incurs one stat(2) per
   ** message every time the folder is opened.
   */
+#if HAVE_GDBM || HAVE_DB4
   { "header_cache_pagesize", DT_STR, R_NONE, UL &HeaderCachePageSize, UL "16384" },
   /*
   ** .pp
@@ -1077,6 +1078,7 @@ struct option_t MuttVars[] = {
   ** or less the best you can get. For details, google for mutt header
   ** cache (first hit).
   */
+#endif /* HAVE_GDBM || HAVE_DB4 */
 #if HAVE_QDBM
   { "header_cache_compress", DT_BOOL, R_NONE, OPTHCACHECOMPRESS, 0 },
   /*