X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=hcache.c;h=681ec8619733346652f653aeb058a75a4889557e;hp=e513c76b478f3b540e407e3dbbb408d201589dae;hb=a5074c20c3873e4a1fbfea551b07bd1c867a9def;hpb=c6b9d35ed9361e4defab9762a7480d5126405ae9 diff --git a/hcache.c b/hcache.c index e513c76..681ec86 100644 --- a/hcache.c +++ b/hcache.c @@ -43,11 +43,10 @@ #include #include +#include + #include "mutt.h" -#ifdef USE_IMAP -#include "message.h" -#endif -#include "mime.h" +#include #include "mx.h" #include "lib.h" @@ -171,7 +170,7 @@ static void restore_char (char **c, const unsigned char *d, int *off) *off += size; } -static unsigned char *dump_address (ADDRESS * a, unsigned char *d, int *off) +static unsigned char *dump_address (address_t * a, unsigned char *d, int *off) { unsigned int counter = 0; unsigned int start_off = *off; @@ -191,14 +190,14 @@ static unsigned char *dump_address (ADDRESS * a, unsigned char *d, int *off) return d; } -static void restore_address (ADDRESS ** a, const unsigned char *d, int *off) +static void restore_address (address_t ** a, const unsigned char *d, int *off) { unsigned int counter; restore_int (&counter, d, off); while (counter) { - *a = p_new(ADDRESS, 1); + *a = p_new(address_t, 1); restore_char (&(*a)->personal, d, off); restore_char (&(*a)->mailbox, d, off); restore_int ((unsigned int *) &(*a)->group, d, off); @@ -455,31 +454,22 @@ static int generate_crc32 () (MUTTNG_HCACHE_ID "sithglan@stud.uni-erlangen.de[sithglan]|hcache.c|20041108231548|29613")); #if HAVE_LANGINFO_CODESET - crc = crc32 (crc, (unsigned char const *) Charset, m_strlen(Charset)); - crc = - crc32 (crc, (unsigned char const *) "HAVE_LANGINFO_CODESET", - m_strlen("HAVE_LANGINFO_CODESET")); + crc = crc32(crc, (unsigned char const *) Charset, m_strlen(Charset)); + crc = crc32(crc, (unsigned char const *) "HAVE_LANGINFO_CODESET", + m_strlen("HAVE_LANGINFO_CODESET")); #endif -#ifdef USE_POP - crc = - crc32 (crc, (unsigned char const *) "USE_POP", m_strlen("USE_POP")); -#endif + crc = crc32(crc, (unsigned char const *) "USE_POP", m_strlen("USE_POP")); #ifdef MIXMASTER - crc = - crc32 (crc, (unsigned char const *) "MIXMASTER", - m_strlen("MIXMASTER")); + crc = crc32(crc, (unsigned char const *) "MIXMASTER", + m_strlen("MIXMASTER")); #endif -#ifdef USE_IMAP - crc = - crc32 (crc, (unsigned char const *) "USE_IMAP", m_strlen("USE_IMAP")); -#endif + crc = crc32(crc, (unsigned char const *) "USE_IMAP", m_strlen("USE_IMAP")); #ifdef USE_NNTP - crc = - crc32 (crc, (unsigned char const *) "USE_NNTP", m_strlen("USE_NNTP")); + crc = crc32(crc, (unsigned char const *) "USE_NNTP", m_strlen("USE_NNTP")); #endif return crc; } @@ -657,20 +647,20 @@ mutt_hcache_fetch(void *db, const char *filename, { struct header_cache *h = db; char path[_POSIX_PATH_MAX]; - int ksize; + int ksize, len; char *data = NULL; if (!h) return NULL; m_strcpy(path, sizeof(path), h->folder); - str_cat(path, sizeof (path), filename); + m_strcat(path, sizeof(path), filename); ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); data = vlget(h->db, path, ksize, NULL); - if (! crc32_matches(data, h->crc)) + if (!crc32_matches(data, h->crc)) { p_delete(&data); return NULL; @@ -694,7 +684,7 @@ mutt_hcache_store(void *db, const char *filename, HEADER * header, return -1; m_strcpy(path, sizeof(path), h->folder); - str_cat(path, sizeof (path), filename); + m_strcat(path, sizeof(path), filename); ksize = strlen(h->folder) + keylen(path + strlen(h->folder)); @@ -719,7 +709,7 @@ mutt_hcache_delete(void *db, const char *filename, return -1; m_strcpy(path, sizeof(path), h->folder); - str_cat(path, sizeof (path), filename); + m_strcat(path, sizeof(path), filename); ksize = strlen(h->folder) + keylen(path + strlen(h->folder));