X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mx.c;h=4160eeba2e767faaa797f86b00563ab5d0367aca;hp=e173aad69bad2e50e1f6e27840e48a8435741e54;hb=7f7a0be369840b290248e5b0302beb447fa1b3cd;hpb=8e037c67a88cb4680c4391134c578e3b55a80f8a diff --git a/mx.c b/mx.c index e173aad..4160eeb 100644 --- a/mx.c +++ b/mx.c @@ -13,6 +13,8 @@ #endif #include +#include +#include #include "mutt.h" #include "buffy.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" @@ -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; @@ -1130,7 +1129,7 @@ MESSAGE *mx_open_new_message (CONTEXT * dest, HEADER * hdr, int flags) return (NULL); } - msg = mem_calloc (1, sizeof (MESSAGE)); + msg = p_new(MESSAGE, 1); msg->magic = dest->magic; msg->write = 1; @@ -1192,7 +1191,7 @@ MESSAGE *mx_open_message (CONTEXT * ctx, int msgno) { MESSAGE *msg; - msg = mem_calloc (1, sizeof (MESSAGE)); + msg = p_new(MESSAGE, 1); switch (msg->magic = ctx->magic) { case M_MBOX: case M_MMDF: @@ -1310,12 +1309,12 @@ 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 = mem_calloc ((ctx->hdrmax += 25), sizeof (HEADER *)); - ctx->v2r = mem_calloc (ctx->hdrmax, sizeof (int)); + ctx->hdrs = p_new(HEADER *, (ctx->hdrmax += 25)); + ctx->v2r = p_new(int, ctx->hdrmax); } for (i = ctx->msgcount; i < ctx->hdrmax; i++) { ctx->hdrs[i] = NULL;