47 TCBDB *db = tcbdbnew();
50 if (!tcbdbopen(db, path, BDBOWRITER | (create ? BDBOCREAT : 0)))
52 int ecode = tcbdbecode(db);
54 tcbdberrmsg(ecode), ecode);
67 size_t klen,
size_t *vlen)
75 void *rv = tcbdbget(db, key, klen, &sp);
92 size_t klen,
void *value,
size_t vlen)
99 if (!tcbdbput(db, key, klen, value, vlen))
101 int ecode = tcbdbecode(db);
102 return ecode ? ecode : -1;
117 if (!tcbdbout(db, key, klen))
119 int ecode = tcbdbecode(db);
120 return ecode ? ecode : -1;
137 int ecode = tcbdbecode(db);
149 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, bool create)
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)