Delete a record from the Store.
More...
Delete a record from the Store.
- Parameters
-
| [in] | store | Store retrieved via open() |
| [in] | key | Key identifying the record |
| [in] | klen | Length of the Key string |
- Return values
-
| 0 | Success |
| num | Error, a backend-specific error code |
◆ store_gdbm_delete_record()
| static int store_gdbm_delete_record |
( |
StoreHandle * | store, |
|
|
const char * | key, |
|
|
size_t | klen ) |
|
static |
Delete a record from the Store - Implements StoreOps::delete_record() -.
Definition at line 118 of file gdbm.c.
119{
120 if (!store || (klen > INT_MAX))
121 return -1;
122
123 datum dkey = { 0 };
124
125
126 GDBM_FILE db = store;
127
128 dkey.dptr = (char *) key;
129 dkey.dsize = klen;
130
131 return gdbm_delete(db, dkey);
132}
◆ store_lmdb_delete_record()
| static int store_lmdb_delete_record |
( |
StoreHandle * | store, |
|
|
const char * | key, |
|
|
size_t | klen ) |
|
static |
Delete a record from the Store - Implements StoreOps::delete_record() -.
Definition at line 298 of file lmdb.c.
299{
300 if (!store)
301 return -1;
302
303 MDB_val dkey = { 0 };
304
305
307
308 dkey.mv_data = (void *) key;
309 dkey.mv_size = klen;
311 if (rc != MDB_SUCCESS)
312 {
314 return rc;
315 }
316 rc = mdb_del(sdata->
txn, sdata->
db, &dkey, NULL);
317 if ((rc != MDB_SUCCESS) && (rc != MDB_NOTFOUND))
318 {
320 mdb_txn_abort(sdata->
txn);
323 }
324
325 return rc;
326}
#define mutt_debug(LEVEL,...)
static int lmdb_get_write_txn(struct LmdbStoreData *sdata)
Get an LMDB write transaction.
@ TXN_UNINITIALIZED
Transaction is uninitialised.
@ LL_DEBUG2
Log at debug level 2.
MDB_txn * txn
LMDB transaction.
enum LmdbTxnMode txn_mode
Transaction mode.
◆ store_rocksdb_delete_record()
| static int store_rocksdb_delete_record |
( |
StoreHandle * | store, |
|
|
const char * | key, |
|
|
size_t | klen ) |
|
static |
Delete a record from the Store - Implements StoreOps::delete_record() -.
Definition at line 177 of file rocksdb.c.
178{
179 if (!store)
180 return -1;
181
182
184
187 {
188 rocksdb_free(sdata->
err);
190 return -1;
191 }
192
193 return 0;
194}
rocksdb_t * db
RocksDB database.
rocksdb_writeoptions_t * write_options
Write options.
◆ store_tdb_delete_record()
| static int store_tdb_delete_record |
( |
StoreHandle * | store, |
|
|
const char * | key, |
|
|
size_t | klen ) |
|
static |
Delete a record from the Store - Implements StoreOps::delete_record() -.
Definition at line 116 of file tdb.c.
117{
118 if (!store)
119 return -1;
120
121
122 TDB_CONTEXT *db = store;
123 TDB_DATA dkey;
124
125 dkey.dptr = (unsigned char *) key;
126 dkey.dsize = klen;
127
128 return tdb_delete(db, dkey);
129}