#include <lib-mime/mime.h>
+#include "charset.h"
#include "mutt.h"
#include <imap/message.h>
#include "mx.h"
#include "lib.h"
-static struct header_cache {
+struct header_cache {
#if defined(HAVE_QDBM)
VILLA *db;
char *folder;
int fd;
char lockfile[_POSIX_PATH_MAX];
#endif
-} HEADER_CACHE;
+};
typedef union {
struct timeval timeval;
unsigned long uid_validity;
} validate;
-static void *lazy_malloc (size_t siz)
+static void *lazy_malloc (ssize_t siz)
{
if (0 < siz && siz < 4096) {
siz = 4096;
}
static
-unsigned int crc32 (unsigned int crc, unsigned char const *p, size_t len)
+unsigned int crc32 (unsigned int crc, unsigned char const *p, ssize_t len)
{
int i;
void *
mutt_hcache_fetch(void *db, const char *filename,
- size_t(*keylen) (const char *fn))
+ ssize_t(*keylen) (const char *fn))
{
struct header_cache *h = db;
char path[_POSIX_PATH_MAX];
int
mutt_hcache_store(void *db, const char *filename, HEADER * header,
unsigned long uid_validity,
- size_t(*keylen) (const char *fn))
+ ssize_t(*keylen) (const char *fn))
{
struct header_cache *h = db;
char path[_POSIX_PATH_MAX];
int
mutt_hcache_delete(void *db, const char *filename,
- size_t(*keylen) (const char *fn))
+ ssize_t(*keylen) (const char *fn))
{
struct header_cache *h = db;
char path[_POSIX_PATH_MAX];
void *mutt_hcache_open (const char *path, const char *folder)
{
- struct header_cache *h = p_new(HEADER_CACHE, 1);
+ struct header_cache *h = p_new(struct header_cache, 1);
int pagesize =
atoi (HeaderCachePageSize) ? atoi (HeaderCachePageSize) : 16384;
h->db = NULL;
}
void *mutt_hcache_fetch (void *db, const char *filename,
- size_t (*keylen) (const char *fn))
+ ssize_t (*keylen) (const char *fn))
{
struct header_cache *h = db;
datum key;
int
mutt_hcache_store (void *db, const char *filename, HEADER * header,
- unsigned long uid_validity, size_t (*keylen) (const char *fn))
+ unsigned long uid_validity, ssize_t (*keylen) (const char *fn))
{
struct header_cache *h = db;
datum key;
int
mutt_hcache_delete (void *db, const char *filename,
- size_t (*keylen) (const char *fn))
+ ssize_t (*keylen) (const char *fn))
{
datum key;
struct header_cache *h = db;
}
#elif defined(HAVE_DB4)
-static void mutt_hcache_dbt_init (DBT * dbt, void *data, size_t len)
+static void mutt_hcache_dbt_init (DBT * dbt, void *data, ssize_t len)
{
dbt->data = data;
dbt->size = dbt->ulen = len;
struct stat sb;
u_int32_t createflags = DB_CREATE;
int ret;
- struct header_cache *h = calloc (1, sizeof (HEADER_CACHE));
+ struct header_cache *h = p_new(struct header_cache, 1);
int pagesize = atoi (HeaderCachePageSize);
}
void *mutt_hcache_fetch (void *db, const char *filename,
- size_t (*keylen) (const char *fn))
+ ssize_t (*keylen) (const char *fn))
{
DBT key;
DBT data;
int
mutt_hcache_store (void *db, const char *filename, HEADER * header,
- unsigned long uid_validity, size_t (*keylen) (const char *fn))
+ unsigned long uid_validity, ssize_t (*keylen) (const char *fn))
{
DBT key;
DBT data;
int
mutt_hcache_delete (void *db, const char *filename,
- size_t (*keylen) (const char *fn))
+ ssize_t (*keylen) (const char *fn))
{
DBT key;
struct header_cache *h = db;