NeoMutt  2021-02-05-666-ge300cd
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 Email;
75 
85 {
86  char *folder;
87  unsigned int crc;
88  void *ctx;
89  void *cctx;
90 };
91 
96 {
97  uint32_t uidvalidity;
98  unsigned int crc;
99  struct Email *email;
100 };
101 
107 typedef void (*hcache_namer_t)(const char *path, struct Buffer *dest);
108 
118 struct HeaderCache *mutt_hcache_open(const char *path, const char *folder, hcache_namer_t namer);
119 
124 void mutt_hcache_close(struct HeaderCache *hc);
125 
136 int mutt_hcache_store(struct HeaderCache *hc, const char *key, size_t keylen,
137  struct Email *e, uint32_t uidvalidity);
138 
150 struct HCacheEntry mutt_hcache_fetch(struct HeaderCache *hc, const char *key, size_t keylen, uint32_t uidvalidity);
151 
152 int mutt_hcache_store_raw(struct HeaderCache *hc, const char *key, size_t keylen,
153  void *data, size_t dlen);
154 
155 void *mutt_hcache_fetch_raw(struct HeaderCache *hc, const char *key, size_t keylen, size_t *dlen);
156 
162 void mutt_hcache_free_raw(struct HeaderCache *hc, void **data);
163 
172 int mutt_hcache_delete_record(struct HeaderCache *hc, const char *key, size_t keylen);
173 
174 #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:637
void * cctx
Definition: lib.h:89
The envelope/body of an email.
Definition: email.h:37
Wrapper for Email retrieved from the header cache.
Definition: lib.h:95
uint32_t uidvalidity
IMAP-specific UIDVALIDITY.
Definition: lib.h:97
header cache structure
Definition: lib.h:84
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:461
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:332
unsigned int crc
Definition: lib.h:87
void(* hcache_namer_t)(const char *path, struct Buffer *dest)
Prototype for function to compose hcache file names.
Definition: lib.h:107
void mutt_hcache_free_raw(struct HeaderCache *hc, void **data)
free data fetched with mutt_hcache_fetch_raw()
Definition: hcache.c:541
void mutt_hcache_close(struct HeaderCache *hc)
close the connection to the header cache
Definition: hcache.c:435
char * path
Path of Email (for local Mailboxes)
Definition: email.h:92
unsigned int crc
CRC of Email/Body/etc structs.
Definition: lib.h:98
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:615
char * folder
Definition: lib.h:86
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:556
struct Email * email
Retrieved email.
Definition: lib.h:99
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:521
void * ctx
Definition: lib.h:88