1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

added tdb_lock_bystring() and tdb_unlock_bystring()

(This used to be commit ca443210c84575d39e60c38a7a12d037386d0e38)
This commit is contained in:
Andrew Tridgell 2000-10-10 06:43:26 +00:00
parent d2f07bb765
commit 2a9ce69f3b

View File

@ -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)