mutt stable branch with some hacks
at jcs 51 lines 2.3 kB view raw
1/* 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> 5 * 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. 10 * 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. 15 * 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. 19 */ 20 21#ifndef _HCACHE_H_ 22#define _HCACHE_H_ 1 23 24struct header_cache; 25typedef struct header_cache header_cache_t; 26 27typedef void (*hcache_namer_t)(const char *path, BUFFER *dest); 28 29header_cache_t *mutt_hcache_open(const char *path, const char *folder, 30 hcache_namer_t namer); 31void mutt_hcache_close(header_cache_t *h); 32HEADER *mutt_hcache_restore(const unsigned char *d, HEADER **oh); 33void *mutt_hcache_fetch(header_cache_t *h, const char *filename, size_t (*keylen)(const char *fn)); 34void *mutt_hcache_fetch_raw (header_cache_t *h, const char *filename, 35 size_t (*keylen)(const char *fn)); 36void mutt_hcache_free (void **data); 37 38typedef enum { 39 MUTT_GENERATE_UIDVALIDITY = 1 /* use gettimeofday() as value */ 40} mutt_hcache_store_flags_t; 41 42/* uidvalidity is an IMAP-specific unsigned 32 bit number */ 43int mutt_hcache_store(header_cache_t *h, const char *filename, HEADER *header, 44 unsigned int uidvalidity, size_t (*keylen)(const char *fn), mutt_hcache_store_flags_t flags_t); 45int mutt_hcache_store_raw (header_cache_t *h, const char* filename, void* data, 46 size_t dlen, size_t(*keylen) (const char* fn)); 47int mutt_hcache_delete(header_cache_t *h, const char *filename, size_t (*keylen)(const char *fn)); 48 49const char *mutt_hcache_backend (void); 50 51#endif /* _HCACHE_H_ */