#endif
#include <lib-lib/mem.h>
+#include <lib-lib/ascii.h>
+#include <lib-lib/str.h>
+#include <lib-lib/macros.h>
#include "mutt.h"
#include "buffy.h"
-#include "ascii.h"
#include "mx.h"
#include "mbox.h"
#include "mh.h"
#include "mutt_crypt.h"
-#include "lib/mem.h"
-#include "lib/intl.h"
-#include "lib/str.h"
#include "lib/list.h"
#include "lib/debug.h"
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;
#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);
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));
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;
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 */
return (NULL);
}
- msg = mem_calloc (1, sizeof (MESSAGE));
+ msg = p_new(MESSAGE, 1);
msg->magic = dest->magic;
msg->write = 1;
{
MESSAGE *msg;
- msg = mem_calloc (1, sizeof (MESSAGE));
+ msg = p_new(MESSAGE, 1);
switch (msg->magic = ctx->magic) {
case M_MBOX:
case M_MMDF:
}
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;