summaryrefslogtreecommitdiff
path: root/source4/lib/tdb/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-08-25 01:12:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:18 -0500
commit85d8d24d3dd5e84c465050a2440d9a21c970c826 (patch)
treee9183f144623085ff462aa156da65af4befd88bf /source4/lib/tdb/include
parentc58b64b7bfc9cab1a50c0b848b4fde310d12ddd0 (diff)
downloadsamba-85d8d24d3dd5e84c465050a2440d9a21c970c826.tar.gz
samba-85d8d24d3dd5e84c465050a2440d9a21c970c826.tar.bz2
samba-85d8d24d3dd5e84c465050a2440d9a21c970c826.zip
r2034: Allow user-selectable hash functions on open only.
Jeremy. (This used to be commit b43320ee5c9ac14c330e61ae62e0786b088e04fa)
Diffstat (limited to 'source4/lib/tdb/include')
-rw-r--r--source4/lib/tdb/include/tdb.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/lib/tdb/include/tdb.h b/source4/lib/tdb/include/tdb.h
index 73a0ea8f83..02b89087a8 100644
--- a/source4/lib/tdb/include/tdb.h
+++ b/source4/lib/tdb/include/tdb.h
@@ -102,6 +102,7 @@ typedef struct tdb_context {
dev_t device; /* uniquely identifies this tdb */
ino_t inode; /* uniquely identifies this tdb */
void (*log_fn)(struct tdb_context *tdb, int level, const char *, ...); /* logging function */
+ u32 (*hash_fn)(TDB_DATA *key);
int open_flags; /* flags used in the open - needed by reopen */
} TDB_CONTEXT;
@@ -109,12 +110,14 @@ void tdb_debug(TDB_CONTEXT *, int , const char *, ...);
typedef int (*tdb_traverse_func)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *);
typedef void (*tdb_log_func)(TDB_CONTEXT *, int , const char *, ...);
+typedef u32 (*tdb_hash_func)(TDB_DATA *key);
TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
int open_flags, mode_t mode);
TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
int open_flags, mode_t mode,
- tdb_log_func log_fn);
+ tdb_log_func log_fn,
+ tdb_hash_func hash_fn);
int tdb_reopen(TDB_CONTEXT *tdb);
int tdb_reopen_all(void);