Tried it with a function that requires a parameter
authorArt Cancro <ajc@citadel.org>
Tue, 8 Aug 2023 21:42:35 +0000 (17:42 -0400)
committerArt Cancro <ajc@citadel.org>
Tue, 8 Aug 2023 21:42:35 +0000 (17:42 -0400)
citadel/server/database.h
citadel/server/database_bdb.c

index ff65918d776eb37358169d93db2aac8ae0aa92ca..48da24eac48257247c97f967308ba2ddec4ecaed 100644 (file)
@@ -16,7 +16,6 @@ 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 *);
-void                   cdb_rewind(int);
 struct cdbdata *       cdb_next_item(int);
 void                   cdb_close_cursor(int);
 void                   cdb_begin_transaction(void);
@@ -28,5 +27,6 @@ void                  check_handles(void *);
 
 extern void            (*cdb_checkpoint)(void);
 extern void            (*cdb_compact)(void);
+extern void            (*cdb_rewind)(int);
 
 #endif
index 25d97ef98b8667ab98540473e32a3ead62248f70..d84a497d4db5cd787a4a55b0a587dcf7ca773277 100644 (file)
@@ -32,6 +32,7 @@
 
 void (*cdb_compact)(void)      = NULL;
 void (*cdb_checkpoint)(void)   = NULL;
+void (*cdb_rewind)(int)                = NULL;
 
 static DB *dbp[MAXCDB];                // One DB handle for each Citadel database
 static DB_ENV *dbenv;          // The DB environment (global)
@@ -608,7 +609,7 @@ void cdb_close_cursor(int cdb) {
 // Prepare for a sequential search of an entire database.
 // (There is guaranteed to be no more than one traversal in
 // progress per thread at any given time.)
-void cdb_rewind(int cdb) {
+void bdb_rewind(int cdb) {
        int ret = 0;
 
        if (TSD->cursors[cdb] != NULL) {
@@ -747,5 +748,6 @@ void bdb_compact(void) {
 void cdb_init_backends(void) {
        cdb_compact = bdb_compact;
        cdb_checkpoint = bdb_checkpoint;
+       cdb_rewind = bdb_rewind;
        syslog(LOG_INFO, "db: initialized Berkeley DB backend");
 }