summaryrefslogtreecommitdiff
path: root/lib/tdb/docs/README
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-02-27 19:26:01 +0100
committerVolker Lendecke <vl@samba.org>2010-02-28 17:40:59 +0100
commitfb98f60594b6cabc52d0f2f49eda08f793ba4748 (patch)
treeaeb54dd0f76da067561d17e8a8f27f19963ff021 /lib/tdb/docs/README
parent0e9882a65e91e4ab55dc103c7f6aec4ccd966db0 (diff)
downloadsamba-fb98f60594b6cabc52d0f2f49eda08f793ba4748.tar.gz
samba-fb98f60594b6cabc52d0f2f49eda08f793ba4748.tar.bz2
samba-fb98f60594b6cabc52d0f2f49eda08f793ba4748.zip
tdb: If tdb_parse_record does not find a record, return -1 instead of 0
Diffstat (limited to 'lib/tdb/docs/README')
-rw-r--r--lib/tdb/docs/README19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/tdb/docs/README b/lib/tdb/docs/README
index c02ee0e030..fe0e258183 100644
--- a/lib/tdb/docs/README
+++ b/lib/tdb/docs/README
@@ -105,6 +105,25 @@ TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA key);
caller must free the resulting data
----------------------------------------------------------------------
+int tdb_parse_record(struct tdb_context *tdb, TDB_DATA key,
+ int (*parser)(TDB_DATA key, TDB_DATA data,
+ void *private_data),
+ void *private_data);
+
+ Hand a record to a parser function without allocating it.
+
+ This function is meant as a fast tdb_fetch alternative for large records
+ that are frequently read. The "key" and "data" arguments point directly
+ into the tdb shared memory, they are not aligned at any boundary.
+
+ WARNING: The parser is called while tdb holds a lock on the record. DO NOT
+ call other tdb routines from within the parser. Also, for good performance
+ you should make the parser fast to allow parallel operations.
+
+ tdb_parse_record returns -1 if the record was not found. If the record was
+ found, the return value of "parser" is passed up to the caller.
+
+----------------------------------------------------------------------
int tdb_exists(TDB_CONTEXT *tdb, TDB_DATA key);
check if an entry in the database exists