NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches

Close a Store connection. More...

+ Collaboration diagram for close():

Functions

static void store_gdbm_close (StoreHandle **ptr)
 Close a Store connection - Implements StoreOps::close() -.
 
static void store_lmdb_close (StoreHandle **ptr)
 Close a Store connection - Implements StoreOps::close() -.
 
static void store_rocksdb_close (StoreHandle **ptr)
 Close a Store connection - Implements StoreOps::close() -.
 
static void store_tdb_close (StoreHandle **ptr)
 Close a Store connection - Implements StoreOps::close() -.
 

Detailed Description

Close a Store connection.

Parameters
[in,out]ptrStore retrieved via open()

Function Documentation

◆ store_gdbm_close()

static void store_gdbm_close ( StoreHandle ** ptr)
static

Close a Store connection - Implements StoreOps::close() -.

Definition at line 137 of file gdbm.c.

138{
139 if (!ptr || !*ptr)
140 return;
141
142 // Decloak an opaque pointer
143 GDBM_FILE db = *ptr;
144 gdbm_close(db);
145 *ptr = NULL;
146}

◆ store_lmdb_close()

static void store_lmdb_close ( StoreHandle ** ptr)
static

Close a Store connection - Implements StoreOps::close() -.

Definition at line 331 of file lmdb.c.

332{
333 if (!ptr || !*ptr)
334 return;
335
336 // Decloak an opaque pointer
337 struct LmdbStoreData *sdata = *ptr;
338
339 if (sdata->txn)
340 {
341 if (sdata->txn_mode == TXN_WRITE)
342 mdb_txn_commit(sdata->txn);
343 else
344 mdb_txn_abort(sdata->txn);
345
347 sdata->txn = NULL;
348 }
349
350 mdb_env_close(sdata->env);
351 lmdb_sdata_free((struct LmdbStoreData **) ptr);
352}
static void lmdb_sdata_free(struct LmdbStoreData **ptr)
Free Lmdb Store Data.
Definition lmdb.c:78
@ TXN_WRITE
Write transaction in progress.
Definition lmdb.c:60
@ TXN_UNINITIALIZED
Transaction is uninitialised.
Definition lmdb.c:58
LMDB store.
Definition lmdb.c:67
MDB_txn * txn
LMDB transaction.
Definition lmdb.c:69
MDB_env * env
LMDB environment.
Definition lmdb.c:68
enum LmdbTxnMode txn_mode
Transaction mode.
Definition lmdb.c:71
+ Here is the call graph for this function:

◆ store_rocksdb_close()

static void store_rocksdb_close ( StoreHandle ** ptr)
static

Close a Store connection - Implements StoreOps::close() -.

Definition at line 199 of file rocksdb.c.

200{
201 if (!ptr || !*ptr)
202 return;
203
204 // Decloak an opaque pointer
205 struct RocksDbStoreData *sdata = *ptr;
206
207 /* close database and free resources */
208 rocksdb_close(sdata->db);
209 rocksdb_options_destroy(sdata->options);
210 rocksdb_readoptions_destroy(sdata->read_options);
211 rocksdb_writeoptions_destroy(sdata->write_options);
212
213 rocksdb_sdata_free((struct RocksDbStoreData **) ptr);
214}
static void rocksdb_sdata_free(struct RocksDbStoreData **ptr)
Free RocksDb Store Data.
Definition rocksdb.c:54
RocksDB store.
Definition rocksdb.c:42
rocksdb_options_t * options
Database options.
Definition rocksdb.c:44
rocksdb_t * db
RocksDB database.
Definition rocksdb.c:43
rocksdb_readoptions_t * read_options
Read options.
Definition rocksdb.c:45
rocksdb_writeoptions_t * write_options
Write options.
Definition rocksdb.c:46
+ Here is the call graph for this function:

◆ store_tdb_close()

static void store_tdb_close ( StoreHandle ** ptr)
static

Close a Store connection - Implements StoreOps::close() -.

Definition at line 134 of file tdb.c.

135{
136 if (!ptr || !*ptr)
137 return;
138
139 // Decloak an opaque pointer
140 TDB_CONTEXT *db = *ptr;
141 tdb_close(db);
142 *ptr = NULL;
143}