IF(USE_HCACHE)
OPTION(WITH_TC "Use tokyocabinet for header caching [default: on]" ON)
- OPTION(WITH_QDBM "Use qdbm for header caching [default: off]" OFF)
OPTION(WITH_GDBM "Use gdbm for header caching [default: off]")
SET(USE_HCACHE)
SET(USE_HCACHE 1)
SET(HAVE_TOKYOCABINET 1)
ENDIF(WITH_TC)
- IF(WITH_QDBM)
- pkg_search_module(QDBM REQUIRED qdbm)
- ADD_DEFINITIONS(${QDBM_CFLAGS})
- SET(QDBM_LDFLAGS "${QDBM_LDFLAGS}")
- # LIST(APPEND MUTTLIBS ${QDBM_LDFLAGS})
- LIST(APPEND MUTTLIBS -lqdbm)
- SET(USE_HCACHE 1)
- SET(HAVE_QDBM 1)
- ENDIF(WITH_QDBM)
IF(NOT USE_HCACHE AND WITH_GDBM)
CHECK_LIBRARY_EXISTS(gdbm gdbm_open "" GDBM)
#if defined(HAVE_TOKYOCABINET)
#include <tcutil.h>
#include <tchdb.h>
-#elif defined(HAVE_QDBM)
-#include <depot.h>
-#include <cabin.h>
-#include <villa.h>
#elif defined(HAVE_GDBM)
#include <gdbm.h>
#else
struct hcache_t {
#if defined(HAVE_TOKYOCABINET)
TCHDB *db;
-#elif defined(HAVE_QDBM)
- VILLA *db;
#elif defined(HAVE_GDBM)
GDBM_FILE db;
#endif
tchdbdel(h->db);
h->db = NULL;
}
-#elif defined(HAVE_QDBM)
- h->db = vlopen(path, VL_OWRITER | VL_OCREAT, VL_CMPLEX);
#elif defined(HAVE_GDBM)
h->db = gdbm_open((char *) path, 16384, GDBM_WRCREAT, 00600, NULL);
#endif
#if defined(HAVE_TOKYOCABINET)
tchdbdel((*db)->db);
(*db)->db = NULL;
-#elif defined(HAVE_QDBM)
- vlclose((*db)->db);
#elif defined(HAVE_GDBM)
gdbm_close((*db)->db);
#endif
#if defined(HAVE_TOKYOCABINET)
int unused;
data = tchdbget(db->db, path, ksize, &unused);
-#elif defined(HAVE_QDBM)
- data = vlget(db->db, path, ksize, NULL);
#elif defined(HAVE_GDBM)
datum k = { .dptr = path, .dsize = ksize };
int ksize = keylen(path);
#if defined(HAVE_TOKYOCABINET)
ret = !!tchdbput(db->db, path, ksize, data->data, data->len) - 1;
-#elif defined(HAVE_QDBM)
- ret = !!vlput(db->db, path, ksize, data->data, data->len, VL_DOVER) - 1;
#elif defined(HAVE_GDBM)
datum k = { .dptr = path, .dsize = ksize };
datum v = { .dptr = data->data, .dsize = data->len };
int ksize = keylen(path);
#if defined(HAVE_TOKYOCABINET)
tchdbout(db->db, path, ksize);
-#elif defined(HAVE_QDBM)
- vlout(db->db, path, ksize);
#elif defined(HAVE_GDBM)
datum k = { .dptr = path, .dsize = ksize };
gdbm_delete(db->db, k);
#endif
#ifdef USE_HCACHE
-#if defined(HAVE_QDBM)
-#include <depot.h>
+#if defined(HAVE_TOKYOCABINET)
+#include <tcutil.h>
#elif defined(HAVE_GDBM)
#include <gdbm.h>
#endif
printf(" libidn %s\n", STRINGPREP_VERSION);
#endif
#ifdef USE_HCACHE
-#if defined(HAVE_QDBM)
- printf(" qdbm %s\n", dpversion);
+#if defined(HAVE_TOKYOCABINET)
+ printf(" tokyocabinet %s\n", tcversion);
#elif defined(HAVE_GDBM)
printf(" gdbm %s\n", gdbm_version);
#endif