NeoMutt  2021-02-05-89-gabe350
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 
124 struct HeaderCache *mutt_hcache_open(const char *path, const char *folder, hcache_namer_t namer);
125 
130 void mutt_hcache_close(struct HeaderCache *hc);
131 
142 int mutt_hcache_store(struct HeaderCache *hc, const char *key, size_t keylen,
143  struct Email *e, uint32_t uidvalidity);
144 
156 struct HCacheEntry mutt_hcache_fetch(struct HeaderCache *hc, const char *key, size_t keylen, uint32_t uidvalidity);
157 
158 int mutt_hcache_store_raw(struct HeaderCache *hc, const char *key, size_t keylen,
159  void *data, size_t dlen);
160 
161 void *mutt_hcache_fetch_raw(struct HeaderCache *hc, const char *key, size_t keylen, size_t *dlen);
162 
168 void mutt_hcache_free_raw(struct HeaderCache *hc, void **data);
169 
178 int mutt_hcache_delete_record(struct HeaderCache *hc, const char *key, size_t keylen);
179 
180 #endif /* MUTT_HCACHE_LIB_H */
mutt_hcache_store
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:527
mutt_hcache_close
void mutt_hcache_close(struct HeaderCache *hc)
close the connection to the header cache
Definition: hcache.c:419
Buffer
String manipulation buffer.
Definition: buffer.h:33
HeaderCache::cctx
void * cctx
Definition: lib.h:90
mutt_hcache_fetch
struct HCacheEntry mutt_hcache_fetch(struct HeaderCache *hc, const char *key, size_t keylen, uint32_t uidvalidity)
fetch and validate a message's header from the cache
Definition: hcache.c:438
HeaderCache::ctx
void * ctx
Definition: lib.h:89
Email::path
char * path
Path of Email (for local Mailboxes)
Definition: email.h:92
C_HeaderCache
char * C_HeaderCache
Config: (hcache) Directory/file for the header cache database.
Definition: config.c:40
mutt_hcache_free_raw
void mutt_hcache_free_raw(struct HeaderCache *hc, void **data)
free data fetched with mutt_hcache_fetch_raw()
Definition: hcache.c:514
C_HeaderCacheCompressLevel
short C_HeaderCacheCompressLevel
Config: (hcache) Level of compression for method.
Definition: config.c:43
mutt_hcache_fetch_raw
void * mutt_hcache_fetch_raw(struct HeaderCache *hc, const char *key, size_t keylen, size_t *dlen)
Fetch a message's header from the cache.
Definition: hcache.c:496
mutt_hcache_delete_record
int mutt_hcache_delete_record(struct HeaderCache *hc, const char *key, size_t keylen)
delete a key / data pair
Definition: hcache.c:604
HeaderCache::folder
char * folder
Definition: lib.h:87
HCacheEntry::email
struct Email * email
Retrieved email.
Definition: lib.h:100
HCacheEntry
Wrapper for Email retrieved from the header cache.
Definition: lib.h:96
hcache_namer_t
void(* hcache_namer_t)(const char *path, struct Buffer *dest)
Prototype for function to compose hcache file names.
Definition: lib.h:108
HeaderCache
header cache structure
Definition: lib.h:85
ConfigSet
Container for lots of config items.
Definition: set.h:228
mutt_hcache_open
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:322
C_HeaderCacheCompressMethod
char * C_HeaderCacheCompressMethod
Config: (hcache) Enable generic hcache database compression.
Definition: config.c:44
mutt_hcache_store_raw
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:584
HCacheEntry::uidvalidity
uint32_t uidvalidity
IMAP-specific UIDVALIDITY.
Definition: lib.h:98
Email
The envelope/body of an email.
Definition: email.h:37
C_HeaderCacheBackend
char * C_HeaderCacheBackend
Config: (hcache) Header cache backend to use.
Definition: config.c:41
HeaderCache::crc
unsigned int crc
Definition: lib.h:88
HCacheEntry::crc
unsigned int crc
CRC of Email/Body/etc structs.
Definition: lib.h:99