NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
lib.h
Go to the documentation of this file.
1
23
50
51
#ifndef MUTT_STORE_LIB_H
52
#define MUTT_STORE_LIB_H
53
54
#include <stdbool.h>
55
#include <stdlib.h>
56
58
typedef
void
StoreHandle
;
59
65
struct
StoreOps
66
{
67
const
char
*
name
;
68
83
StoreHandle
*(*open)(
const
char
*path,
bool
create);
84
97
void
*(*fetch)(
StoreHandle
*
store
,
const
char
*key,
size_t
klen,
size_t
*vlen);
98
107
void (*
free
)(
StoreHandle
*
store
,
void
**ptr);
108
122
int (*
store
)(
StoreHandle
*
store
,
const
char
*key,
size_t
klen,
void
*value,
size_t
vlen);
123
135
int (*
delete_record
)(
StoreHandle
*
store
,
const
char
*key,
size_t
klen);
136
144
void (*
close
)(
StoreHandle
**ptr);
145
153
const
char
*(*version)(void);
154
};
155
156
struct
Slist
*
store_backend_list
(
void
);
157
const
struct
StoreOps
*
store_get_backend_ops
(
const
char
*str);
158
bool
store_is_valid_backend
(
const
char
*str);
159
160
#define STORE_BACKEND_OPS(_name) \
161
const struct StoreOps store_##_name##_ops = { \
162
.name = #_name, \
163
.open = store_##_name##_open, \
164
.fetch = store_##_name##_fetch, \
165
.free = store_##_name##_free, \
166
.store = store_##_name##_store, \
167
.delete_record = store_##_name##_delete_record, \
168
.close = store_##_name##_close, \
169
.version = store_##_name##_version, \
170
};
171
172
#endif
/* MUTT_STORE_LIB_H */
StoreHandle
void StoreHandle
Opaque type for store backend.
Definition
lib.h:58
store_is_valid_backend
bool store_is_valid_backend(const char *str)
Is the string a valid Store backend.
Definition
store.c:110
store_backend_list
struct Slist * store_backend_list(void)
Get a list of backend names.
Definition
store.c:69
store_get_backend_ops
const struct StoreOps * store_get_backend_ops(const char *str)
Get the API functions for an store backend.
Definition
store.c:88
Slist
String list.
Definition
slist.h:37
StoreOps
Definition
lib.h:66
StoreOps::close
void(* close)(StoreHandle **ptr)
Definition
lib.h:144
StoreOps::store
int(* store)(StoreHandle *store, const char *key, size_t klen, void *value, size_t vlen)
Definition
lib.h:122
StoreOps::name
const char * name
Store name.
Definition
lib.h:67
StoreOps::delete_record
int(* delete_record)(StoreHandle *store, const char *key, size_t klen)
Definition
lib.h:135
StoreOps::free
void(* free)(StoreHandle *store, void **ptr)
Definition
lib.h:107