cdb_init_backends() just calls bdb_init_backend() for now
authorArt Cancro <ajc@citadel.org>
Tue, 8 Aug 2023 22:03:40 +0000 (18:03 -0400)
committerArt Cancro <ajc@citadel.org>
Tue, 8 Aug 2023 22:03:40 +0000 (18:03 -0400)
citadel/server/citserver.h
citadel/server/database.h
citadel/server/database_bdb.c

index 09412b0524364d09d502bbff7a13b5c607c8ed70..b92a06173dc97e397ddc8c9328cd4a878ef3b900 100644 (file)
@@ -25,6 +25,7 @@ struct UserProcList {
 
 #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);
index ae7df39631046820783d2bf69c97279ee94ab795..418a2f5de8aa58bcb10d61a620c6d5b8fde920e6 100644 (file)
@@ -1,15 +1,12 @@
-// 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);
index 95b90d7e890ffe84c00ee1de17bbfc634cf7f9a9..ac275264075066819c7ca2962eb806d9fdab0cfc 100644 (file)
@@ -759,7 +759,8 @@ void bdb_compact(void) {
 }
 
 
-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;
@@ -779,3 +780,9 @@ void cdb_init_backends(void) {
 
        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.
+}