From bfed62c1695391076c1d82b312030adca8d971e5 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 19 Aug 2011 10:50:20 +0200 Subject: s3:dbwrap: add get-functions for db_record key, value and private_data --- source3/lib/dbwrap/dbwrap.c | 15 +++++++++++++++ source3/lib/dbwrap/dbwrap.h | 4 ++++ 2 files changed, 19 insertions(+) (limited to 'source3') diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c index 361c786880..75d38b5920 100644 --- a/source3/lib/dbwrap/dbwrap.c +++ b/source3/lib/dbwrap/dbwrap.c @@ -98,6 +98,21 @@ int dbwrap_fallback_wipe(struct db_context *db) * Wrapper functions for the backend methods */ +TDB_DATA dbwrap_record_get_key(const struct db_record *rec) +{ + return rec->key; +} + +TDB_DATA dbwrap_record_get_value(const struct db_record *rec) +{ + return rec->value; +} + +void *dbwrap_record_get_private_data(const struct db_record *rec) +{ + return rec->private_data; +} + TDB_DATA dbwrap_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, TDB_DATA key) { diff --git a/source3/lib/dbwrap/dbwrap.h b/source3/lib/dbwrap/dbwrap.h index 5120210399..cf2a41f309 100644 --- a/source3/lib/dbwrap/dbwrap.h +++ b/source3/lib/dbwrap/dbwrap.h @@ -60,6 +60,10 @@ struct db_context { /* The following definitions come from lib/dbwrap.c */ +TDB_DATA dbwrap_record_get_key(const struct db_record *rec); +TDB_DATA dbwrap_record_get_value(const struct db_record *rec); +void *dbwrap_record_get_private_data(const struct db_record *rec); + NTSTATUS dbwrap_delete(struct db_context *db, TDB_DATA key); NTSTATUS dbwrap_store(struct db_context *db, TDB_DATA key, TDB_DATA data, int flags); -- cgit