From 8c64bd92bf3c44599f561abea6abf1841fa88856 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 3 Jun 2002 06:04:14 +0000 Subject: Added tdb_delete_by_string() function. (This used to be commit 0cd3952f408e2fcd2c833b9039dff4392ac16cf7) --- source3/tdb/tdbutil.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3') diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c index 92a5a9d37f..1a3a8bb9a5 100644 --- a/source3/tdb/tdbutil.c +++ b/source3/tdb/tdbutil.c @@ -207,6 +207,20 @@ TDB_DATA tdb_fetch_by_string(TDB_CONTEXT *tdb, char *keystr) return tdb_fetch(tdb, key); } +/**************************************************************************** + Delete a buffer using a null terminated string key. +****************************************************************************/ + +int tdb_delete_by_string(TDB_CONTEXT *tdb, char *keystr) +{ + TDB_DATA key; + + key.dptr = keystr; + key.dsize = strlen(keystr) + 1; + + return tdb_delete(tdb, key); +} + /**************************************************************************** Atomic integer change. Returns old value. To create, set initial value in *oldval. ****************************************************************************/ -- cgit