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 | ca443210c84575d39e60c38a7a12d037386d0e38 (patch) | |
tree | fdc8fd0b3097cd85bb0650d63c77ced735ef89b9 /source/tdb | |
parent | e4ea0a5975d3539803c78cac2229550a6e89c4b4 (diff) | |
download | samba-ca443210c84575d39e60c38a7a12d037386d0e38.tar.gz samba-ca443210c84575d39e60c38a7a12d037386d0e38.tar.xz samba-ca443210c84575d39e60c38a7a12d037386d0e38.zip |
added tdb_lock_bystring() and tdb_unlock_bystring()
Diffstat (limited to 'source/tdb')
-rw-r--r-- | source/tdb/tdbutil.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/tdb/tdbutil.c b/source/tdb/tdbutil.c index e426aa51cd9..ac7a5e2e909 100644 --- a/source/tdb/tdbutil.c +++ b/source/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) |