2 * Copyright (C) 2004 Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
3 * Copyright (C) 2004 Tobias Werth <sitowert@stud.uni-erlangen.de>
4 * Copyright (C) 2004 Brian Fundakowski Feldman <green@FreeBSD.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 typedef struct header_cache header_cache_t;
27 typedef int (*hcache_namer_t)(const char* path, char* dest, size_t dlen);
29 header_cache_t *mutt_hcache_open(const char *path, const char *folder,
30 hcache_namer_t namer);
31 void mutt_hcache_close(header_cache_t *h);
32 HEADER *mutt_hcache_restore(const unsigned char *d, HEADER **oh);
33 void *mutt_hcache_fetch(header_cache_t *h, const char *filename, size_t (*keylen)(const char *fn));
34 void *mutt_hcache_fetch_raw (header_cache_t *h, const char *filename,
35 size_t (*keylen)(const char *fn));
36 int mutt_hcache_store(header_cache_t *h, const char *filename, HEADER *header,
37 unsigned long uid_validity, size_t (*keylen)(const char *fn));
38 int mutt_hcache_store_raw (header_cache_t *h, const char* filename, void* data,
39 size_t dlen, size_t(*keylen) (const char* fn));
40 int mutt_hcache_delete(header_cache_t *h, const char *filename, size_t (*keylen)(const char *fn));
42 const char *mutt_hcache_backend (void);
44 #endif /* _HCACHE_H_ */