diff options
author | Michael Adam <obnox@samba.org> | 2011-08-24 14:53:42 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-10-11 14:17:58 +0200 |
commit | 8750e3f22c9b62840fd7e90eb99b95204542a592 (patch) | |
tree | 7711f48872662f87e56bd6558130a306fd36e939 /source3/lib/dbwrap/dbwrap_private.h | |
parent | 6fb5c47f21a4b0d5998de37d13b3cab61afd5bac (diff) | |
download | samba-8750e3f22c9b62840fd7e90eb99b95204542a592.tar.gz samba-8750e3f22c9b62840fd7e90eb99b95204542a592.tar.bz2 samba-8750e3f22c9b62840fd7e90eb99b95204542a592.zip |
s3:dbwrap: move definitions of db_record and db_contect structs to dbwrap_private.h
The API and callers now only need the forward declarations.
Diffstat (limited to 'source3/lib/dbwrap/dbwrap_private.h')
-rw-r--r-- | source3/lib/dbwrap/dbwrap_private.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source3/lib/dbwrap/dbwrap_private.h b/source3/lib/dbwrap/dbwrap_private.h index 1e221878f5..0a8581a91b 100644 --- a/source3/lib/dbwrap/dbwrap_private.h +++ b/source3/lib/dbwrap/dbwrap_private.h @@ -23,6 +23,41 @@ #ifndef __DBWRAP_PRIVATE_H__ #define __DBWRAP_PRIVATE_H__ +struct db_record { + TDB_DATA key, value; + NTSTATUS (*store)(struct db_record *rec, TDB_DATA data, int flag); + NTSTATUS (*delete_rec)(struct db_record *rec); + void *private_data; +}; + +struct db_context { + struct db_record *(*fetch_locked)(struct db_context *db, + TALLOC_CTX *mem_ctx, + TDB_DATA key); + int (*fetch)(struct db_context *db, TALLOC_CTX *mem_ctx, + TDB_DATA key, TDB_DATA *data); + int (*traverse)(struct db_context *db, + int (*f)(struct db_record *rec, + void *private_data), + void *private_data); + int (*traverse_read)(struct db_context *db, + int (*f)(struct db_record *rec, + void *private_data), + void *private_data); + int (*get_seqnum)(struct db_context *db); + int (*get_flags)(struct db_context *db); + int (*transaction_start)(struct db_context *db); + int (*transaction_commit)(struct db_context *db); + int (*transaction_cancel)(struct db_context *db); + int (*parse_record)(struct db_context *db, TDB_DATA key, + int (*parser)(TDB_DATA key, TDB_DATA data, + void *private_data), + void *private_data); + int (*exists)(struct db_context *db,TDB_DATA key); + int (*wipe)(struct db_context *db); + void *private_data; + bool persistent; +}; int dbwrap_fallback_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, TDB_DATA key, TDB_DATA *data); |