diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-10-10 06:43:26 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-10-10 06:43:26 +0000 |
commit | 2a9ce69f3b4a020bd1442901625562c6391746cd (patch) | |
tree | 124ee3867f1838a6daa316f7f26cc9f3c727e2bd | |
parent | d2f07bb7656cd46a93bdaac1d77bfa1c412d8c0c (diff) | |
download | samba-2a9ce69f3b4a020bd1442901625562c6391746cd.tar.gz samba-2a9ce69f3b4a020bd1442901625562c6391746cd.tar.bz2 samba-2a9ce69f3b4a020bd1442901625562c6391746cd.zip |
added tdb_lock_bystring() and tdb_unlock_bystring()
(This used to be commit ca443210c84575d39e60c38a7a12d037386d0e38)
-rw-r--r-- | source3/tdb/tdbutil.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c index e426aa51cd..ac7a5e2e90 100644 --- a/source3/tdb/tdbutil.c +++ b/source3/tdb/tdbutil.c @@ -24,6 +24,30 @@ /* these are little tdb utility functions that are meant to make dealing with a tdb database a little less cumbersome in Samba */ +/* lock a chain by string */ +int tdb_lock_bystring(TDB_CONTEXT *tdb, char *keyval) +{ + TDB_DATA key; + + key.dptr = keyval; + key.dsize = strlen(keyval)+1; + + return tdb_lockchain(tdb, key); +} + +/* unlock a chain by string */ +int tdb_unlock_bystring(TDB_CONTEXT *tdb, char *keyval) +{ + TDB_DATA key; + + key.dptr = keyval; + key.dsize = strlen(keyval)+1; + + return tdb_unlockchain(tdb, key); +} + +/* lock a chain by string key */ + /* fetch a value by a arbitrary blob key, return -1 if not found */ int tdb_fetch_int_byblob(TDB_CONTEXT *tdb, char *keyval, size_t len) |