summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-07-05 13:10:30 +0200
committerMichael Adam <obnox@samba.org>2011-10-11 14:17:55 +0200
commit893805b99caeb6645c0688c9ec5b9466947dc454 (patch)
treec4a2ab7745c2adb9b4504ddb72588654a6bac0ef /source3/lib
parentfff09d066f5b5ba82e268f4251802fd7f3006a5e (diff)
downloadsamba-893805b99caeb6645c0688c9ec5b9466947dc454.tar.gz
samba-893805b99caeb6645c0688c9ec5b9466947dc454.tar.bz2
samba-893805b99caeb6645c0688c9ec5b9466947dc454.zip
s3:dbwrap: add function dbwrap_parse_record()
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap/dbwrap.c12
-rw-r--r--source3/lib/dbwrap/dbwrap.h4
2 files changed, 16 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c
index 9ec7a3e59a..5908e1ecb0 100644
--- a/source3/lib/dbwrap/dbwrap.c
+++ b/source3/lib/dbwrap/dbwrap.c
@@ -173,3 +173,15 @@ NTSTATUS dbwrap_traverse_read(struct db_context *db,
return NT_STATUS_OK;
}
+
+int dbwrap_parse_record(struct db_context *db, TDB_DATA key,
+ int (*parser)(TDB_DATA key, TDB_DATA data,
+ void *private_data),
+ void *private_data)
+{
+ if (db->parse_record) {
+ return db->parse_record(db, key, parser, private_data);
+ } else {
+ return dbwrap_fallback_parse_record(db, key, parser, private_data);
+ }
+}
diff --git a/source3/lib/dbwrap/dbwrap.h b/source3/lib/dbwrap/dbwrap.h
index 9ff47c4285..0672de1f50 100644
--- a/source3/lib/dbwrap/dbwrap.h
+++ b/source3/lib/dbwrap/dbwrap.h
@@ -73,6 +73,10 @@ NTSTATUS dbwrap_traverse_read(struct db_context *db,
int (*f)(struct db_record*, void*),
void *private_data,
int *count);
+int dbwrap_parse_record(struct db_context *db, TDB_DATA key,
+ int (*parser)(TDB_DATA key, TDB_DATA data,
+ void *private_data),
+ void *private_data);
/* The following definitions come from lib/dbwrap_util.c */