Added tdb_delete_by_string() function.
authorTim Potter <tpot@samba.org>
Mon, 3 Jun 2002 06:04:14 +0000 (06:04 +0000)
committerTim Potter <tpot@samba.org>
Mon, 3 Jun 2002 06:04:14 +0000 (06:04 +0000)
(This used to be commit 0cd3952f408e2fcd2c833b9039dff4392ac16cf7)

source3/tdb/tdbutil.c

index 92a5a9d37fa046f1f3a240d16e26bceedab14d7a..1a3a8bb9a52dedfb31f55b88e3a67a17873701f7 100644 (file)
@@ -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. 
 ****************************************************************************/