NeoMutt  2020-06-26-89-g172cd3
Teaching an old dog new tricks
DOXYGEN
StoreOps Struct Reference

Key Value Store API. More...

#include "lib.h"

Data Fields

const char * name
 Store name. More...
 
void *(* open )(const char *path)
 Open a connection to a Store. More...
 
void *(* fetch )(void *store, const char *key, size_t klen, size_t *vlen)
 Fetch a Value from the Store. More...
 
void(* free )(void *store, void **ptr)
 Free a Value returned by fetch() More...
 
int(* store )(void *store, const char *key, size_t klen, void *value, size_t vlen)
 Write a Value to the Store. More...
 
int(* delete_record )(void *store, const char *key, size_t klen)
 Delete a record from the Store. More...
 
void(* close )(void **ptr)
 Close a Store connection. More...
 
const char *(* version )(void)
 Get a Store version string. More...
 

Detailed Description

Key Value Store API.

Definition at line 61 of file lib.h.

Field Documentation

◆ name

const char* StoreOps::name

Store name.

Definition at line 63 of file lib.h.

◆ open

void*(* StoreOps::open) (const char *path)

Open a connection to a Store.

Parameters
[in]pathPath to the database file
Return values
ptrSuccess, Store pointer
NULLFailure

The open function has the purpose of opening a backend-specific connection to the database file specified by the path parameter. Backends MUST return non-NULL specific context information on success.

Definition at line 75 of file lib.h.

◆ fetch

void*(* StoreOps::fetch) (void *store, const char *key, size_t klen, size_t *vlen)

Fetch a Value from the Store.

Parameters
[in]storeStore retrieved via open()
[in]keyKey identifying the record
[in]klenLength of the Key string
[out]vlenLength of the Value
Return values
ptrSuccess, Value associated with the Key
NULLError, or Key not found

Definition at line 86 of file lib.h.

◆ free

void(* StoreOps::free) (void *store, void **ptr)

Free a Value returned by fetch()

Parameters
[in]storeStore retrieved via open()
[out]ptrValue to be freed

Definition at line 93 of file lib.h.

◆ store

int(* StoreOps::store) (void *store, const char *key, size_t klen, void *value, size_t vlen)

Write a Value to the Store.

Parameters
[in]storeStore retrieved via open()
[in]keyKey identifying the record
[in]klenLength of the Key string
[in]valueValue to save
[in]vlenLength of the Value
Return values
0Success
numError, a backend-specific error code

Definition at line 105 of file lib.h.

◆ delete_record

int(* StoreOps::delete_record) (void *store, const char *key, size_t klen)

Delete a record from the Store.

Parameters
[in]storeStore retrieved via open()
[in]keyKey identifying the record
[in]klenLength of the Key string
Return values
0Success
numError, a backend-specific error code

Definition at line 115 of file lib.h.

◆ close

void(* StoreOps::close) (void **ptr)

Close a Store connection.

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

Definition at line 121 of file lib.h.

◆ version

const char*(* StoreOps::version) (void)

Get a Store version string.

Return values
ptrString describing the currently used Store

Definition at line 127 of file lib.h.


The documentation for this struct was generated from the following file: