summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-08-19 10:50:20 +0200
committerMichael Adam <obnox@samba.org>2011-10-11 14:17:56 +0200
commitbfed62c1695391076c1d82b312030adca8d971e5 (patch)
tree44d4fed05db196817de3a71ff45ddbeada3c119b /source3/lib/dbwrap
parent3ed2fb4a874e8c271fa5976efcc1b0938872c708 (diff)
downloadsamba-bfed62c1695391076c1d82b312030adca8d971e5.tar.gz
samba-bfed62c1695391076c1d82b312030adca8d971e5.tar.bz2
samba-bfed62c1695391076c1d82b312030adca8d971e5.zip
s3:dbwrap: add get-functions for db_record key, value and private_data
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r--source3/lib/dbwrap/dbwrap.c15
-rw-r--r--source3/lib/dbwrap/dbwrap.h4
2 files changed, 19 insertions, 0 deletions
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);