Add db_tdb_parse
authorVolker Lendecke <vl@samba.org>
Sat, 21 Feb 2009 23:47:54 +0000 (00:47 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 26 Feb 2009 10:05:22 +0000 (11:05 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
source3/lib/dbwrap_tdb.c

index b5eb1881d42169c6575d24327907761e04bc6ec6..c71e073b41e5110626ee942a12b7009c7d462951 100644 (file)
@@ -176,6 +176,17 @@ static int db_tdb_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
        return 0;
 }
 
        return 0;
 }
 
+static int db_tdb_parse(struct db_context *db, TDB_DATA key,
+                       int (*parser)(TDB_DATA key, TDB_DATA data,
+                                     void *private_data),
+                       void *private_data)
+{
+       struct db_tdb_ctx *ctx = talloc_get_type_abort(
+               db->private_data, struct db_tdb_ctx);
+
+       return tdb_parse_record(ctx->wtdb->tdb, key, parser, private_data);
+}
+
 static NTSTATUS db_tdb_store(struct db_record *rec, TDB_DATA data, int flag)
 {
        struct db_tdb_ctx *ctx = talloc_get_type_abort(rec->private_data,
 static NTSTATUS db_tdb_store(struct db_record *rec, TDB_DATA data, int flag)
 {
        struct db_tdb_ctx *ctx = talloc_get_type_abort(rec->private_data,
@@ -351,6 +362,7 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
        result->fetch = db_tdb_fetch;
        result->traverse = db_tdb_traverse;
        result->traverse_read = db_tdb_traverse_read;
        result->fetch = db_tdb_fetch;
        result->traverse = db_tdb_traverse;
        result->traverse_read = db_tdb_traverse_read;
+       result->parse_record = db_tdb_parse;
        result->get_seqnum = db_tdb_get_seqnum;
        result->get_flags = db_tdb_get_flags;
        result->persistent = ((tdb_flags & TDB_CLEAR_IF_FIRST) == 0);
        result->get_seqnum = db_tdb_get_seqnum;
        result->get_flags = db_tdb_get_flags;
        result->persistent = ((tdb_flags & TDB_CLEAR_IF_FIRST) == 0);