46 TCBDB *db = tcbdbnew();
49 if (!tcbdbopen(db, path, BDBOWRITER | BDBOCREAT))
51 int ecode = tcbdbecode(db);
53 tcbdberrmsg(ecode), ecode);
66 size_t klen,
size_t *vlen)
74 void *rv = tcbdbget(db, key, klen, &sp);
91 size_t klen,
void *value,
size_t vlen)
98 if (!tcbdbput(db, key, klen, value, vlen))
100 int ecode = tcbdbecode(db);
101 return ecode ? ecode : -1;
116 if (!tcbdbout(db, key, klen))
118 int ecode = tcbdbecode(db);
119 return ecode ? ecode : -1;
136 int ecode = tcbdbecode(db);
148 return "tokyocabinet " _TC_VERSION;
#define mutt_debug(LEVEL,...)
static void store_tokyocabinet_close(StoreHandle **ptr)
Close a Store connection - Implements StoreOps::close() -.
static int store_tokyocabinet_delete_record(StoreHandle *store, const char *key, size_t klen)
Delete a record from the Store - Implements StoreOps::delete_record() -.
static void * store_tokyocabinet_fetch(StoreHandle *store, const char *key, size_t klen, size_t *vlen)
Fetch a Value from the Store - Implements StoreOps::fetch() -.
static void store_tokyocabinet_free(StoreHandle *store, void **ptr)
Free a Value returned by fetch() - Implements StoreOps::free() -.
static StoreHandle * store_tokyocabinet_open(const char *path)
Open a connection to a Store - Implements StoreOps::open() -.
static int store_tokyocabinet_store(StoreHandle *store, const char *key, size_t klen, void *value, size_t vlen)
Write a Value to the Store - Implements StoreOps::store() -.
static const char * store_tokyocabinet_version(void)
Get a Store version string - Implements StoreOps::version() -.
@ LL_DEBUG2
Log at debug level 2.
Convenience wrapper for the library headers.
void StoreHandle
Opaque type for store backend.
#define STORE_BACKEND_OPS(_name)