From 5953839b1890eaf36a3d9a3fd7febe65524a9980 Mon Sep 17 00:00:00 2001 From: Gregor Beck Date: Mon, 4 Jul 2011 10:27:17 +0200 Subject: s3:dbwrap: add specific dbwrap_exists() implementation to dbwrap_tdb Signed-off-by: Michael Adam --- source3/lib/dbwrap/dbwrap_tdb.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/dbwrap/dbwrap_tdb.c b/source3/lib/dbwrap/dbwrap_tdb.c index 63d27296a6..8964510c15 100644 --- a/source3/lib/dbwrap/dbwrap_tdb.c +++ b/source3/lib/dbwrap/dbwrap_tdb.c @@ -181,6 +181,13 @@ static int db_tdb_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, return 0; } +static int db_tdb_exists(struct db_context *db, TDB_DATA key) +{ + struct db_tdb_ctx *ctx = talloc_get_type_abort( + db->private_data, struct db_tdb_ctx); + return tdb_exists(ctx->wtdb->tdb, key); +} + static int db_tdb_parse(struct db_context *db, TDB_DATA key, int (*parser)(TDB_DATA key, TDB_DATA data, void *private_data), @@ -375,6 +382,7 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx, result->transaction_start = db_tdb_transaction_start; result->transaction_commit = db_tdb_transaction_commit; result->transaction_cancel = db_tdb_transaction_cancel; + result->exists = db_tdb_exists; return result; fail: -- cgit