projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove most of the debug code: often makes the code unreadable, for little
[apps/madmutt.git]
/
hcache.c
diff --git
a/hcache.c
b/hcache.c
index
4b9e757
..
532a2b8
100644
(file)
--- a/
hcache.c
+++ b/
hcache.c
@@
-42,16
+42,16
@@
#include <lib-lib/mem.h>
#include <lib-hash/hash.h>
#include <lib-lib/mem.h>
#include <lib-hash/hash.h>
-#include <lib-lib/debug.h>
#include <lib-mime/mime.h>
#include <lib-mime/mime.h>
+#include "charset.h"
#include "mutt.h"
#include <imap/message.h>
#include "mx.h"
#include "lib.h"
#include "mutt.h"
#include <imap/message.h>
#include "mx.h"
#include "lib.h"
-st
atic st
ruct header_cache {
+struct header_cache {
#if defined(HAVE_QDBM)
VILLA *db;
char *folder;
#if defined(HAVE_QDBM)
VILLA *db;
char *folder;
@@
-67,14
+67,14
@@
static struct header_cache {
int fd;
char lockfile[_POSIX_PATH_MAX];
#endif
int fd;
char lockfile[_POSIX_PATH_MAX];
#endif
-}
HEADER_CACHE
;
+};
typedef union {
struct timeval timeval;
unsigned long uid_validity;
} validate;
typedef union {
struct timeval timeval;
unsigned long uid_validity;
} validate;
-static void *lazy_malloc (size_t siz)
+static void *lazy_malloc (s
s
ize_t siz)
{
if (0 < siz && siz < 4096) {
siz = 4096;
{
if (0 < siz && siz < 4096) {
siz = 4096;
@@
-424,7
+424,7
@@
static void restore_envelope (ENVELOPE * e, const unsigned char *d, int *off)
}
static
}
static
-unsigned int crc32 (unsigned int crc, unsigned char const *p, size_t len)
+unsigned int crc32 (unsigned int crc, unsigned char const *p, s
s
ize_t len)
{
int i;
{
int i;
@@
-635,7
+635,7
@@
mutt_hcache_close(void *db)
void *
mutt_hcache_fetch(void *db, const char *filename,
void *
mutt_hcache_fetch(void *db, const char *filename,
- size_t(*keylen) (const char *fn))
+ s
s
ize_t(*keylen) (const char *fn))
{
struct header_cache *h = db;
char path[_POSIX_PATH_MAX];
{
struct header_cache *h = db;
char path[_POSIX_PATH_MAX];
@@
-664,7
+664,7
@@
mutt_hcache_fetch(void *db, const char *filename,
int
mutt_hcache_store(void *db, const char *filename, HEADER * header,
unsigned long uid_validity,
int
mutt_hcache_store(void *db, const char *filename, HEADER * header,
unsigned long uid_validity,
- size_t(*keylen) (const char *fn))
+ s
s
ize_t(*keylen) (const char *fn))
{
struct header_cache *h = db;
char path[_POSIX_PATH_MAX];
{
struct header_cache *h = db;
char path[_POSIX_PATH_MAX];
@@
-691,7
+691,7
@@
mutt_hcache_store(void *db, const char *filename, HEADER * header,
int
mutt_hcache_delete(void *db, const char *filename,
int
mutt_hcache_delete(void *db, const char *filename,
- size_t(*keylen) (const char *fn))
+ s
s
ize_t(*keylen) (const char *fn))
{
struct header_cache *h = db;
char path[_POSIX_PATH_MAX];
{
struct header_cache *h = db;
char path[_POSIX_PATH_MAX];
@@
-712,7
+712,7
@@
mutt_hcache_delete(void *db, const char *filename,
void *mutt_hcache_open (const char *path, const char *folder)
{
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;
int pagesize =
atoi (HeaderCachePageSize) ? atoi (HeaderCachePageSize) : 16384;
h->db = NULL;
@@
-759,7
+759,7
@@
void mutt_hcache_close (void *db)
}
void *mutt_hcache_fetch (void *db, const char *filename,
}
void *mutt_hcache_fetch (void *db, const char *filename,
- size_t (*keylen) (const char *fn))
+ s
s
ize_t (*keylen) (const char *fn))
{
struct header_cache *h = db;
datum key;
{
struct header_cache *h = db;
datum key;
@@
-788,7
+788,7
@@
void *mutt_hcache_fetch (void *db, const char *filename,
int
mutt_hcache_store (void *db, const char *filename, HEADER * header,
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, s
s
ize_t (*keylen) (const char *fn))
{
struct header_cache *h = db;
datum key;
{
struct header_cache *h = db;
datum key;
@@
-817,7
+817,7
@@
mutt_hcache_store (void *db, const char *filename, HEADER * header,
int
mutt_hcache_delete (void *db, const char *filename,
int
mutt_hcache_delete (void *db, const char *filename,
- size_t (*keylen) (const char *fn))
+ s
s
ize_t (*keylen) (const char *fn))
{
datum key;
struct header_cache *h = db;
{
datum key;
struct header_cache *h = db;
@@
-837,7
+837,7
@@
mutt_hcache_delete (void *db, const char *filename,
}
#elif defined(HAVE_DB4)
}
#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, s
s
ize_t len)
{
dbt->data = data;
dbt->size = dbt->ulen = len;
{
dbt->data = data;
dbt->size = dbt->ulen = len;
@@
-857,7
+857,7
@@
void *mutt_hcache_open (const char *path, const char *folder)
struct stat sb;
u_int32_t createflags = DB_CREATE;
int ret;
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);
int pagesize = atoi (HeaderCachePageSize);
@@
-939,7
+939,7
@@
void mutt_hcache_close (void *db)
}
void *mutt_hcache_fetch (void *db, const char *filename,
}
void *mutt_hcache_fetch (void *db, const char *filename,
- size_t (*keylen) (const char *fn))
+ s
s
ize_t (*keylen) (const char *fn))
{
DBT key;
DBT data;
{
DBT key;
DBT data;
@@
-967,7
+967,7
@@
void *mutt_hcache_fetch (void *db, const char *filename,
int
mutt_hcache_store (void *db, const char *filename, HEADER * header,
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, s
s
ize_t (*keylen) (const char *fn))
{
DBT key;
DBT data;
{
DBT key;
DBT data;
@@
-997,7
+997,7
@@
mutt_hcache_store (void *db, const char *filename, HEADER * header,
int
mutt_hcache_delete (void *db, const char *filename,
int
mutt_hcache_delete (void *db, const char *filename,
- size_t (*keylen) (const char *fn))
+ s
s
ize_t (*keylen) (const char *fn))
{
DBT key;
struct header_cache *h = db;
{
DBT key;
struct header_cache *h = db;