summaryrefslogtreecommitdiff
path: root/source4/lib/tdb
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/tdb')
-rw-r--r--source4/lib/tdb/tdb.c4
-rw-r--r--source4/lib/tdb/tdb.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/source4/lib/tdb/tdb.c b/source4/lib/tdb/tdb.c
index 1fef5d54fa..8fbf128914 100644
--- a/source4/lib/tdb/tdb.c
+++ b/source4/lib/tdb/tdb.c
@@ -1292,7 +1292,7 @@ static int tdb_next_lock(TDB_CONTEXT *tdb, struct tdb_traverse_lock *tlock,
if fn is NULL then it is not called
a non-zero return value from fn() indicates that the traversal should stop
*/
-int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn)
+int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *private)
{
TDB_DATA key, dbuf;
struct list_struct rec;
@@ -1330,7 +1330,7 @@ int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn)
ret = -1;
goto out;
}
- if (fn && fn(tdb, key, dbuf)) {
+ if (fn && fn(tdb, key, dbuf, private)) {
/* They want us to terminate traversal */
ret = count;
if (unlock_record(tdb, tl.off) != 0) {
diff --git a/source4/lib/tdb/tdb.h b/source4/lib/tdb/tdb.h
index d20f4cd677..b3a28b7440 100644
--- a/source4/lib/tdb/tdb.h
+++ b/source4/lib/tdb/tdb.h
@@ -98,7 +98,7 @@ typedef struct tdb_context {
int open_flags; /* flags used in the open - needed by reopen */
} TDB_CONTEXT;
-typedef int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA);
+typedef int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *);
typedef void (*tdb_log_func)(TDB_CONTEXT *, int , const char *, ...);
TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
@@ -119,7 +119,7 @@ int tdb_append(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA new_dbuf);
int tdb_close(TDB_CONTEXT *tdb);
TDB_DATA tdb_firstkey(TDB_CONTEXT *tdb);
TDB_DATA tdb_nextkey(TDB_CONTEXT *tdb, TDB_DATA key);
-int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn);
+int tdb_traverse(TDB_CONTEXT *tdb, tdb_traverse_func fn, void *);
int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);
int tdb_lockkeys(TDB_CONTEXT *tdb, u32 number, TDB_DATA keys[]);
void tdb_unlockkeys(TDB_CONTEXT *tdb);