diff options
author | Gregor Beck <gbeck@sernet.de> | 2011-07-05 15:06:05 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-11 14:17:55 +0200 |
commit | 63c5c0eccf3df89135c4e18f5660e6f94978e3d3 (patch) | |
tree | eb0c168d45ac53de33f480029b569b82e2cbc9f2 /source3 | |
parent | c5d03cbff806c564d4903277bd2b866ba8bf9c7e (diff) | |
download | samba-63c5c0eccf3df89135c4e18f5660e6f94978e3d3.tar.gz samba-63c5c0eccf3df89135c4e18f5660e6f94978e3d3.tar.bz2 samba-63c5c0eccf3df89135c4e18f5660e6f94978e3d3.zip |
s3:dbwrap: add specific dbwrap_parse_record() implementation to dbwrap_rbt
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/dbwrap/dbwrap_rbt.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap_rbt.c b/source3/lib/dbwrap/dbwrap_rbt.c index 54d3fa3aae..3b5574a257 100644 --- a/source3/lib/dbwrap/dbwrap_rbt.c +++ b/source3/lib/dbwrap/dbwrap_rbt.c @@ -316,6 +316,20 @@ static int db_rbt_exists(struct db_context *db, TDB_DATA key) return db_rbt_search_internal(db, key, NULL); } +static int db_rbt_parse_record(struct db_context *db, TDB_DATA key, + int (*parser)(TDB_DATA key, TDB_DATA data, + void *private_data), + void *private_data) +{ + struct db_rbt_search_result res; + bool found = db_rbt_search_internal(db, key, &res); + + if (!found) { + return -1; + } + return parser(res.key, res.val, private_data); +} + static int db_rbt_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, TDB_DATA key, TDB_DATA *data) { @@ -419,6 +433,7 @@ struct db_context *db_open_rbt(TALLOC_CTX *mem_ctx) result->transaction_commit = db_rbt_trans_dummy; result->transaction_cancel = db_rbt_trans_dummy; result->exists = db_rbt_exists; + result->parse_record = db_rbt_parse_record; return result; } |