void cdb_close_databases(void);
int cdb_store(int, const void *, int, void *, int);
int cdb_delete(int, void *, int);
-struct cdbdata * cdb_fetch(int, const void *, int);
void cdb_free(struct cdbdata *);
struct cdbdata * cdb_next_item(int);
void cdb_close_cursor(int);
void cdb_chmod_data(void);
void check_handles(void *);
+extern struct cdbdata * (*cdb_fetch)(int, const void *, int);
extern void (*cdb_checkpoint)(void);
extern void (*cdb_compact)(void);
extern void (*cdb_rewind)(int);
#include "citserver.h"
#include "config.h"
-void (*cdb_compact)(void) = NULL;
-void (*cdb_checkpoint)(void) = NULL;
-void (*cdb_rewind)(int) = NULL;
+void (*cdb_compact)(void) = NULL;
+void (*cdb_checkpoint)(void) = NULL;
+void (*cdb_rewind)(int) = NULL;
+struct cdbdata * (*cdb_fetch)(int, const void *, int) = NULL;
static DB *dbp[MAXCDB]; // One DB handle for each Citadel database
static DB_ENV *dbenv; // The DB environment (global)
// Fetch a piece of data. If not found, returns NULL. Otherwise, it returns
// a struct cdbdata which it is the caller's responsibility to free later on
// using the cdb_free() routine.
-struct cdbdata *cdb_fetch(int cdb, const void *key, int keylen) {
+struct cdbdata *bdb_fetch(int cdb, const void *key, int keylen) {
if (keylen == 0) { // key length zero is impossible
return(NULL);
cdb_compact = bdb_compact;
cdb_checkpoint = bdb_checkpoint;
cdb_rewind = bdb_rewind;
+ cdb_fetch = bdb_fetch;
syslog(LOG_INFO, "db: initialized Berkeley DB backend");
}