X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mx.c;h=cf924ca9cad7d69b295db99c36685b7eb5d6022b;hp=c68b0ac3d56913156dc1478639f7ba2aea044c35;hb=9274cbe8e6410ddb95ddc667faa678a29da85420;hpb=b3cb6ed8d36c550a2e589910ce51bbc8352ff57c diff --git a/mx.c b/mx.c index c68b0ac..cf924ca 100644 --- a/mx.c +++ b/mx.c @@ -13,10 +13,12 @@ #endif #include +#include +#include +#include #include "mutt.h" #include "buffy.h" -#include "ascii.h" #include "mx.h" #include "mbox.h" #include "mh.h" @@ -53,9 +55,6 @@ #include "mutt_crypt.h" -#include "lib/mem.h" -#include "lib/intl.h" -#include "lib/str.h" #include "lib/list.h" #include "lib/debug.h" @@ -194,7 +193,7 @@ int mx_lock_file (const char *path, int fd, int excl, int dot, int timeout) struct flock lck; - memset (&lck, 0, sizeof (struct flock)); + p_clear(&lck, 1); lck.l_type = excl ? F_WRLCK : F_RDLCK; lck.l_whence = SEEK_SET; @@ -295,7 +294,7 @@ int mx_unlock_file (const char *path, int fd, int dot) #ifdef USE_FCNTL struct flock unlockit; - memset (&unlockit, 0, sizeof (struct flock)); + p_clear(&unlockit, 1); unlockit.l_type = F_UNLCK; unlockit.l_whence = SEEK_SET; fcntl (fd, F_SETLK, &unlockit); @@ -344,7 +343,7 @@ void mx_unlink_empty (const char *path) int mx_get_magic (const char *path) { int i = 0; - if (str_len (path) == 0) + if (m_strlen(path) == 0) return (-1); if ((i = mx_get_idx (path)) >= 0) return (MX_COMMAND(i,type)); @@ -522,7 +521,7 @@ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT * pctx) if (!ctx) ctx = p_new(CONTEXT, 1); p_clear(ctx, 1); - ctx->path = str_dup (path); + ctx->path = m_strdup(path); ctx->msgnotreadyet = -1; ctx->collapsed = 0; @@ -626,7 +625,7 @@ void mx_fastclose_mailbox (CONTEXT * ctx) if (ctx->limit_pattern) mutt_pattern_free (&ctx->limit_pattern); safe_fclose (&ctx->fp); - memset (ctx, 0, sizeof (CONTEXT)); + p_clear(ctx, 1); } /* save changes to disk */ @@ -1310,8 +1309,8 @@ void mx_alloc_memory (CONTEXT * ctx) } if (ctx->hdrs) { - mem_realloc (&ctx->hdrs, sizeof (HEADER *) * (ctx->hdrmax += 25)); - mem_realloc (&ctx->v2r, sizeof (int) * ctx->hdrmax); + p_realloc(&ctx->hdrs, ctx->hdrmax += 25); + p_realloc(&ctx->v2r, ctx->hdrmax); } else { ctx->hdrs = p_new(HEADER *, (ctx->hdrmax += 25));