diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-07-10 12:51:36 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:09:59 -0500 |
commit | 35fda6c5f344e71b1ed0bd195a62161e31401149 (patch) | |
tree | 6fd96d68dceac6bdde0ddf557b66103207e7be33 /source4/lib/tdb/include | |
parent | bfc02627ceb02046fb23c62f28dc69765c8aa8f0 (diff) | |
download | samba-35fda6c5f344e71b1ed0bd195a62161e31401149.tar.gz samba-35fda6c5f344e71b1ed0bd195a62161e31401149.tar.bz2 samba-35fda6c5f344e71b1ed0bd195a62161e31401149.zip |
r16916: Implement metze's proposed changes to the tdb logging API.
This clearly links the log function with its private pointer, and
makes the argument list for tdb_open_ex a bit shorter.
Andrew Bartlett
(This used to be commit 5d5503e8d8a10ead3ef21a5ffda52cadb9a07727)
Diffstat (limited to 'source4/lib/tdb/include')
-rw-r--r-- | source4/lib/tdb/include/tdb.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/lib/tdb/include/tdb.h b/source4/lib/tdb/include/tdb.h index 785bbbe29b..296a946c42 100644 --- a/source4/lib/tdb/include/tdb.h +++ b/source4/lib/tdb/include/tdb.h @@ -83,17 +83,21 @@ typedef int (*tdb_traverse_func)(struct tdb_context *, TDB_DATA, TDB_DATA, void typedef void (*tdb_log_func)(struct tdb_context *, enum tdb_debug_level, const char *, ...) PRINTF_ATTRIBUTE(3, 4); typedef unsigned int (*tdb_hash_func)(TDB_DATA *key); +struct tdb_logging_context { + tdb_log_func log_fn; + void *log_private; +}; + struct tdb_context *tdb_open(const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode); struct 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, void *log_private, + const struct tdb_logging_context *log_ctx, tdb_hash_func hash_fn); -void *tdb_logging_private(struct tdb_context *tdb); int tdb_reopen(struct tdb_context *tdb); int tdb_reopen_all(int parent_longlived); -void tdb_logging_function(struct tdb_context *tdb, tdb_log_func log_fn, void *log_private); +void tdb_set_logging_function(struct tdb_context *tdb, const struct tdb_logging_context *log); enum TDB_ERROR tdb_error(struct tdb_context *tdb); const char *tdb_errorstr(struct tdb_context *tdb); TDB_DATA tdb_fetch(struct tdb_context *tdb, TDB_DATA key); |