From: TAKAHASHI Tamotsu Date: Thu, 22 Sep 2005 16:38:08 +0000 (+0000) Subject: Update QDBM patch to the current state of the art. Closes: #2003 (again). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e27e53e19312ebf16abcb0629d0f4893b1ec5e1;p=neomutt Update QDBM patch to the current state of the art. Closes: #2003 (again). --- diff --git a/configure.in b/configure.in index a314297a8..237c2ac2c 100644 --- a/configure.in +++ b/configure.in @@ -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 -- diff --git a/globals.h b/globals.h index 3d4ee63b2..196594d31 100644 --- 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; diff --git a/hcache.c b/hcache.c index 440869efe..e8145bc7e 100644 --- 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 3d9b9e2b7..6b05b7cea 100644 --- 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 }, /*