Delete a record from the Store.
More...
|
static int | store_bdb_delete_record (StoreHandle *store, const char *key, size_t klen) |
| Delete a record from the Store - Implements StoreOps::delete_record() -.
|
|
static int | store_gdbm_delete_record (StoreHandle *store, const char *key, size_t klen) |
| Delete a record from the Store - Implements StoreOps::delete_record() -.
|
|
static int | store_kyotocabinet_delete_record (StoreHandle *store, const char *key, size_t klen) |
| Delete a record from the Store - Implements StoreOps::delete_record() -.
|
|
static int | store_lmdb_delete_record (StoreHandle *store, const char *key, size_t klen) |
| Delete a record from the Store - Implements StoreOps::delete_record() -.
|
|
static int | store_qdbm_delete_record (StoreHandle *store, const char *key, size_t klen) |
| Delete a record from the Store - Implements StoreOps::delete_record() -.
|
|
static int | store_rocksdb_delete_record (StoreHandle *store, const char *key, size_t klen) |
| Delete a record from the Store - Implements StoreOps::delete_record() -.
|
|
static int | store_tokyocabinet_delete_record (StoreHandle *store, const char *key, size_t klen) |
| Delete a record from the Store - Implements StoreOps::delete_record() -.
|
|
static int | store_tdb_delete_record (StoreHandle *store, const char *key, size_t klen) |
| Delete a record from the Store - Implements StoreOps::delete_record() -.
|
|
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_bdb_delete_record()
static int store_bdb_delete_record |
( |
StoreHandle * |
store, |
|
|
const char * |
key, |
|
|
size_t |
klen |
|
) |
| |
|
static |
Delete a record from the Store - Implements StoreOps::delete_record() -.
Definition at line 240 of file bdb.c.
241{
242 if (!store)
243 return -1;
244
245
247
248 DBT dkey = { 0 };
249 dbt_init(&dkey, (
void *) key, klen);
250 return sdata->
db->del(sdata->
db, NULL, &dkey, 0);
251}
static void dbt_init(DBT *dbt, void *data, size_t len)
Initialise a BDB thing.
◆ 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_kyotocabinet_delete_record()
static int store_kyotocabinet_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 kc.c.
117{
118 if (!store)
119 return -1;
120
121
122 KCDB *db = store;
123 if (!kcdbremove(db, key, klen))
124 {
125 int ecode = kcdbecode(db);
126 return ecode ? ecode : -1;
127 }
128 return 0;
129}
◆ 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 296 of file lmdb.c.
297{
298 if (!store)
299 return -1;
300
301 MDB_val dkey = { 0 };
302
303
305
306 dkey.mv_data = (void *) key;
307 dkey.mv_size = klen;
309 if (rc != MDB_SUCCESS)
310 {
312 return rc;
313 }
314 rc = mdb_del(sdata->
txn, sdata->
db, &dkey, NULL);
315 if ((rc != MDB_SUCCESS) && (rc != MDB_NOTFOUND))
316 {
318 mdb_txn_abort(sdata->
txn);
321 }
322
323 return rc;
324}
#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.
enum LmdbTxnMode txn_mode
◆ store_qdbm_delete_record()
static int store_qdbm_delete_record |
( |
StoreHandle * |
store, |
|
|
const char * |
key, |
|
|
size_t |
klen |
|
) |
| |
|
static |
Delete a record from the Store - Implements StoreOps::delete_record() -.
Definition at line 97 of file qdbm.c.
98{
99 if (!store)
100 return -1;
101
102
103 VILLA *db = store;
104
105
106 bool success = vlout(db, key, klen);
107 return success ? 0 : dpecode ? dpecode : -1;
108}
◆ 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_writeoptions_t * write_options
◆ store_tokyocabinet_delete_record()
static int store_tokyocabinet_delete_record |
( |
StoreHandle * |
store, |
|
|
const char * |
key, |
|
|
size_t |
klen |
|
) |
| |
|
static |
Delete a record from the Store - Implements StoreOps::delete_record() -.
Definition at line 110 of file tc.c.
111{
112 if (!store)
113 return -1;
114
115
116 TCBDB *db = store;
117 if (!tcbdbout(db, key, klen))
118 {
119 int ecode = tcbdbecode(db);
120 return ecode ? ecode : -1;
121 }
122 return 0;
123}
◆ 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}