NeoMutt  2024-04-25-92-gf10c0f
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
rocksdb.c File Reference

RocksDB backend for the key/value Store. More...

#include "config.h"
#include <rocksdb/c.h>
#include <stdbool.h>
#include <stddef.h>
#include "mutt/lib.h"
#include "lib.h"
+ Include dependency graph for rocksdb.c:

Go to the source code of this file.

Data Structures

struct  RocksDbStoreData
 RocksDB store. More...
 

Macros

#define RDBVER(major, minor, patch)   #major "." #minor "." #patch
 

Functions

static void rocksdb_sdata_free (struct RocksDbStoreData **ptr)
 Free RocksDb Store Data.
 
static struct RocksDbStoreDatarocksdb_sdata_new (void)
 Create new RocksDb Store Data.
 
static StoreHandlestore_rocksdb_open (const char *path, bool create)
 Open a connection to a Store - Implements StoreOps::open() -.
 
static void * store_rocksdb_fetch (StoreHandle *store, const char *key, size_t klen, size_t *vlen)
 Fetch a Value from the Store - Implements StoreOps::fetch() -.
 
static void store_rocksdb_free (StoreHandle *store, void **ptr)
 Free a Value returned by fetch() - Implements StoreOps::free() -.
 
static int store_rocksdb_store (StoreHandle *store, const char *key, size_t klen, void *value, size_t vlen)
 Write a Value to the Store - Implements StoreOps::store() -.
 
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 void store_rocksdb_close (StoreHandle **ptr)
 Close a Store connection - Implements StoreOps::close() -.
 
static const char * store_rocksdb_version (void)
 Get a Store version string - Implements StoreOps::version() -.
 

Detailed Description

RocksDB backend for the key/value Store.

Authors
  • Tino Reichardt
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file rocksdb.c.

Macro Definition Documentation

◆ RDBVER

#define RDBVER (   major,
  minor,
  patch 
)    #major "." #minor "." #patch

Function Documentation

◆ rocksdb_sdata_free()

static void rocksdb_sdata_free ( struct RocksDbStoreData **  ptr)
static

Free RocksDb Store Data.

Parameters
ptrRocksDb Store Data to free

Definition at line 54 of file rocksdb.c.

55{
56 if (!ptr || !*ptr)
57 return;
58
59 struct RocksDbStoreData *sdata = *ptr;
60 FREE(&sdata->err);
61
62 FREE(ptr);
63}
#define FREE(x)
Definition: memory.h:45
RocksDB store.
Definition: rocksdb.c:42
char * err
Definition: rocksdb.c:47
+ Here is the caller graph for this function:

◆ rocksdb_sdata_new()

static struct RocksDbStoreData * rocksdb_sdata_new ( void  )
static

Create new RocksDb Store Data.

Return values
ptrNew RocksDb Store Data

Definition at line 69 of file rocksdb.c.

70{
71 return mutt_mem_calloc(1, sizeof(struct RocksDbStoreData));
72}
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function: