From 35fda6c5f344e71b1ed0bd195a62161e31401149 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 10 Jul 2006 12:51:36 +0000 Subject: 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) --- source4/lib/tdb/include/tdb.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source4/lib/tdb/include') 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); -- cgit