NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
bdb.c File Reference

Berkeley DB backend for the key/value Store. More...

#include "config.h"
#include <db.h>
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/stat.h>
#include <unistd.h>
#include "mutt/lib.h"
#include "lib.h"
+ Include dependency graph for bdb.c:

Go to the source code of this file.

Data Structures

struct  StoreDbCtx
 Berkeley DB context. More...
 

Functions

static void dbt_init (DBT *dbt, void *data, size_t len)
 Initialise a BDB context. More...
 
static void dbt_empty_init (DBT *dbt)
 Initialise an empty BDB context. More...
 
static void * store_bdb_open (const char *path)
 Implements StoreOps::open() -. More...
 
static void * store_bdb_fetch (void *store, const char *key, size_t klen, size_t *vlen)
 Implements StoreOps::fetch() -. More...
 
static void store_bdb_free (void *store, void **ptr)
 Implements StoreOps::free() -. More...
 
static int store_bdb_store (void *store, const char *key, size_t klen, void *value, size_t vlen)
 Implements StoreOps::store() -. More...
 
static int store_bdb_delete_record (void *store, const char *key, size_t klen)
 Implements StoreOps::delete_record() -. More...
 
static void store_bdb_close (void **ptr)
 Implements StoreOps::close() -. More...
 
static const char * store_bdb_version (void)
 Implements StoreOps::version() -. More...
 

Detailed Description

Berkeley DB backend for the key/value Store.

Authors
  • Thomas Glanzmann
  • Tobias Werth
  • Brian Fundakowski Feldman
  • Pietro Cerutti

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 bdb.c.

Function Documentation

◆ dbt_init()

static void dbt_init ( DBT *  dbt,
void *  data,
size_t  len 
)
static

Initialise a BDB context.

Parameters
dbtContext to initialise
dataID string to associate
lenLength of ID string

Definition at line 62 of file bdb.c.

63 {
64  dbt->data = data;
65  dbt->size = len;
66  dbt->ulen = len;
67  dbt->dlen = 0;
68  dbt->doff = 0;
69  dbt->flags = DB_DBT_USERMEM;
70 }
+ Here is the caller graph for this function:

◆ dbt_empty_init()

static void dbt_empty_init ( DBT *  dbt)
static

Initialise an empty BDB context.

Parameters
dbtContext to initialise

Definition at line 76 of file bdb.c.

77 {
78  dbt->data = NULL;
79  dbt->size = 0;
80  dbt->ulen = 0;
81  dbt->dlen = 0;
82  dbt->doff = 0;
83  dbt->flags = 0;
84 }
+ Here is the caller graph for this function: