#define CTDLUSERIP (IsEmptyStr(CC->cs_addr) ? CC->cs_clientinfo: CC->cs_addr)
+void cdb_init_backends(void);
void master_startup (void);
int master_cleanup (int exitcode);
void set_wtmpsupp (char *newtext);
-// Copyright (c) 1987-2017 by the citadel.org team
+// Copyright (c) 1987-2023 by the citadel.org team
// This program is open source software. Use, duplication, or disclosure
// are subject to the terms of the GNU General Public License, version 3.
-// We expect these functions to act as an internal API that remains identical
-// across multiple database back ends.
+// These functions comprise an interface between Citadel Server and a database backend.
#ifndef DATABASE_H
#define DATABASE_H
-void cdb_init_backends(void);
-
extern void (*cdb_open_databases)(void);
extern void (*cdb_close_databases)(void);
extern int (*cdb_store)(int, const void *, int, void *, int);
}
-void cdb_init_backends(void) {
+// Calling this function activates the Berkeley DB back end.
+void bdb_init_backend(void) {
cdb_compact = bdb_compact;
cdb_checkpoint = bdb_checkpoint;
cdb_rewind = bdb_rewind;
syslog(LOG_INFO, "db: initialized Berkeley DB backend");
}
+
+
+// This will get split out into a separate file. It will act as a marshal for multiple database backends.
+void cdb_init_backends(void) {
+ bdb_init_backend(); // For now, Berkeley DB is the only backend, so we always initialize it.
+}