NeoMutt  2020-09-25
Teaching an old dog new tricks
DOXYGEN
lib.h
Go to the documentation of this file.
1 
67 #ifndef MUTT_HCACHE_LIB_H
68 #define MUTT_HCACHE_LIB_H
69 
70 #include <stddef.h>
71 #include <stdint.h>
72 
73 struct Buffer;
74 struct ConfigSet;
75 struct Email;
76 
86 {
87  char *folder;
88  unsigned int crc;
89  void *ctx;
90  void *cctx;
91 };
92 
97 {
98  uint32_t uidvalidity;
99  unsigned int crc;
100  struct Email *email;
101 };
102 
108 typedef void (*hcache_namer_t)(const char *path, struct Buffer *dest);
109 
110 extern char *C_HeaderCache;
111 extern char *C_HeaderCacheBackend;
112 extern short C_HeaderCacheCompressLevel;
113 extern char *C_HeaderCacheCompressMethod;
114 extern bool C_MaildirHeaderCacheVerify;
115 
125 struct HeaderCache *mutt_hcache_open(const char *path, const char *folder, hcache_namer_t namer);
126 
131 void mutt_hcache_close(struct HeaderCache *hc);
132 
143 int mutt_hcache_store(struct HeaderCache *hc, const char *key, size_t keylen,
144  struct Email *e, uint32_t uidvalidity);
145 
157 struct HCacheEntry mutt_hcache_fetch(struct HeaderCache *hc, const char *key, size_t keylen, uint32_t uidvalidity);
158 
159 int mutt_hcache_store_raw(struct HeaderCache *hc, const char *key, size_t keylen,
160  void *data, size_t dlen);
161 
162 void *mutt_hcache_fetch_raw(struct HeaderCache *hc, const char *key, size_t keylen, size_t *dlen);
163 
169 void mutt_hcache_free_raw(struct HeaderCache *hc, void **data);
170 
179 int mutt_hcache_delete_record(struct HeaderCache *hc, const char *key, size_t keylen);
180 
181 bool config_init_hcache(struct ConfigSet *cs);
182 
183 #endif /* MUTT_HCACHE_LIB_H */
int mutt_hcache_delete_record(struct HeaderCache *hc, const char *key, size_t keylen)
delete a key / data pair
Definition: hcache.c:602
Container for lots of config items.
Definition: set.h:228
void * cctx
Definition: lib.h:90
The envelope/body of an email.
Definition: email.h:37
Wrapper for Email retrieved from the header cache.
Definition: lib.h:96
char * C_HeaderCacheCompressMethod
Config: (hcache) Enable generic hcache database compression.
Definition: config.c:44
uint32_t uidvalidity
IMAP-specific UIDVALIDITY.
Definition: lib.h:98
header cache structure
Definition: lib.h:85
String manipulation buffer.
Definition: buffer.h:33
struct HCacheEntry mutt_hcache_fetch(struct HeaderCache *hc, const char *key, size_t keylen, uint32_t uidvalidity)
fetch and validate a message&#39;s header from the cache
Definition: hcache.c:436
struct HeaderCache * mutt_hcache_open(const char *path, const char *folder, hcache_namer_t namer)
open the connection to the header cache
Definition: hcache.c:320
unsigned int crc
Definition: lib.h:88
void(* hcache_namer_t)(const char *path, struct Buffer *dest)
Prototype for function to compose hcache file names.
Definition: lib.h:108
char * C_HeaderCache
Config: (hcache) Directory/file for the header cache database.
Definition: config.c:40
void mutt_hcache_free_raw(struct HeaderCache *hc, void **data)
free data fetched with mutt_hcache_fetch_raw()
Definition: hcache.c:512
bool C_MaildirHeaderCacheVerify
Config: (hcache) Check for maildir changes when opening mailbox.
Definition: config.c:46
char * C_HeaderCacheBackend
Config: (hcache) Header cache backend to use.
Definition: config.c:41
void mutt_hcache_close(struct HeaderCache *hc)
close the connection to the header cache
Definition: hcache.c:417
char * path
Path of Email (for local Mailboxes)
Definition: email.h:92
unsigned int crc
CRC of Email/Body/etc structs.
Definition: lib.h:99
int mutt_hcache_store_raw(struct HeaderCache *hc, const char *key, size_t keylen, void *data, size_t dlen)
store a key / data pair
Definition: hcache.c:582
char * folder
Definition: lib.h:87
int mutt_hcache_store(struct HeaderCache *hc, const char *key, size_t keylen, struct Email *e, uint32_t uidvalidity)
store a Header along with a validity datum
Definition: hcache.c:525
struct Email * email
Retrieved email.
Definition: lib.h:100
bool config_init_hcache(struct ConfigSet *cs)
Register hcache config variables - Implements module_init_config_t.
Definition: config.c:157
void * mutt_hcache_fetch_raw(struct HeaderCache *hc, const char *key, size_t keylen, size_t *dlen)
Fetch a message&#39;s header from the cache.
Definition: hcache.c:494
short C_HeaderCacheCompressLevel
Config: (hcache) Level of compression for method.
Definition: config.c:43
void * ctx
Definition: lib.h:89