From a040e05d44a8fdf18a9e176f850fb2965c236da8 Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Tue, 20 Dec 2005 17:50:46 +0000 Subject: Refactor header cache a bit to provide (fetch|store)_raw functions. These will let me keep folder metadata (UIDVALIDITY, NEXT, msg count etc) in the cache, which will help to sync more quickly. --- hcache.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 hcache.h (limited to 'hcache.h') diff --git a/hcache.h b/hcache.h new file mode 100644 index 00000000..24ad89ce --- /dev/null +++ b/hcache.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2004 Thomas Glanzmann + * Copyright (C) 2004 Tobias Werth + * Copyright (C) 2004 Brian Fundakowski Feldman + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _HCACHE_H_ +#define _HCACHE_H_ 1 + +void *mutt_hcache_open(const char *path, const char *folder); +void mutt_hcache_close(void *db); +HEADER *mutt_hcache_restore(const unsigned char *d, HEADER **oh); +void *mutt_hcache_fetch(void *db, const char *filename, size_t (*keylen)(const char *fn)); +void *mutt_hcache_fetch_raw (void *db, const char *filename, + size_t (*keylen)(const char *fn)); +int mutt_hcache_store(void *db, const char *filename, HEADER *h, + unsigned long uid_validity, size_t (*keylen)(const char *fn)); +int mutt_hcache_store_raw (void* db, const char* filename, char* data, + size_t dlen, size_t(*keylen) (const char* fn)); +int mutt_hcache_delete(void *db, const char *filename, size_t (*keylen)(const char *fn)); + +#endif /* _HCACHE_H_ */ -- cgit v1.2.3