projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
mx.c
diff --git
a/mx.c
b/mx.c
index
2cdbe7e
..
fc2a908
100644
(file)
--- a/
mx.c
+++ b/
mx.c
@@
-13,11
+13,13
@@
#endif
#include "mutt.h"
#endif
#include "mutt.h"
+#include "ascii.h"
#include "mx.h"
#include "mbox.h"
#include "mh.h"
#include "rfc2047.h"
#include "sort.h"
#include "mx.h"
#include "mbox.h"
#include "mh.h"
#include "rfc2047.h"
#include "sort.h"
+#include "thread.h"
#include "copy.h"
#include "keymap.h"
#include "url.h"
#include "copy.h"
#include "keymap.h"
#include "url.h"
@@
-73,7
+75,7
@@
static list2_t* MailboxFormats = NULL;
#define MX_COMMAND(idx,cmd) ((mx_t*) MailboxFormats->data[idx])->cmd
#define MX_IDX(idx) (idx >= 0 && idx < MailboxFormats->length)
#define MX_COMMAND(idx,cmd) ((mx_t*) MailboxFormats->data[idx])->cmd
#define MX_IDX(idx) (idx >= 0 && idx < MailboxFormats->length)
-#define mutt_is_spool(s) (
mutt_str
cmp (Spoolfile, s) == 0)
+#define mutt_is_spool(s) (
str_
cmp (Spoolfile, s) == 0)
#ifdef USE_DOTLOCK
/* parameters:
#ifdef USE_DOTLOCK
/* parameters:
@@
-342,7
+344,7
@@
void mx_unlink_empty (const char *path)
int mx_get_magic (const char *path) {
int i = 0;
int mx_get_magic (const char *path) {
int i = 0;
- if (
mutt_str
len (path) == 0)
+ if (
str_
len (path) == 0)
return (-1);
if ((i = mx_get_idx (path)) >= 0)
return (MX_COMMAND(i,type));
return (-1);
if ((i = mx_get_idx (path)) >= 0)
return (MX_COMMAND(i,type));
@@
-518,9
+520,9
@@
CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT * pctx)
int rc;
if (!ctx)
int rc;
if (!ctx)
- ctx =
safe
_malloc (sizeof (CONTEXT));
+ ctx =
mem
_malloc (sizeof (CONTEXT));
memset (ctx, 0, sizeof (CONTEXT));
memset (ctx, 0, sizeof (CONTEXT));
- ctx->path = s
afe_str
dup (path);
+ ctx->path = s
tr_
dup (path);
ctx->msgnotreadyet = -1;
ctx->collapsed = 0;
ctx->msgnotreadyet = -1;
ctx->collapsed = 0;
@@
-536,7
+538,7
@@
CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT * pctx)
if (mx_open_mailbox_append (ctx, flags) != 0) {
mx_fastclose_mailbox (ctx);
if (!pctx)
if (mx_open_mailbox_append (ctx, flags) != 0) {
mx_fastclose_mailbox (ctx);
if (!pctx)
-
FREE
(&ctx);
+
mem_free
(&ctx);
return NULL;
}
return ctx;
return NULL;
}
return ctx;
@@
-559,7
+561,7
@@
CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT * pctx)
if (ctx->magic <= 0) {
mx_fastclose_mailbox (ctx);
if (!pctx)
if (ctx->magic <= 0) {
mx_fastclose_mailbox (ctx);
if (!pctx)
-
FREE
(&ctx);
+
mem_free
(&ctx);
return (NULL);
}
return (NULL);
}
@@
-589,7
+591,7
@@
CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT * pctx)
else {
mx_fastclose_mailbox (ctx);
if (!pctx)
else {
mx_fastclose_mailbox (ctx);
if (!pctx)
-
FREE
(&ctx);
+
mem_free
(&ctx);
}
unset_option (OPTFORCEREFRESH);
}
unset_option (OPTFORCEREFRESH);
@@
-613,14
+615,14
@@
void mx_fastclose_mailbox (CONTEXT * ctx)
mutt_clear_threads (ctx);
for (i = 0; i < ctx->msgcount; i++)
mutt_free_header (&ctx->hdrs[i]);
mutt_clear_threads (ctx);
for (i = 0; i < ctx->msgcount; i++)
mutt_free_header (&ctx->hdrs[i]);
-
FREE
(&ctx->hdrs);
-
FREE
(&ctx->v2r);
+
mem_free
(&ctx->hdrs);
+
mem_free
(&ctx->v2r);
#ifdef USE_COMPRESSED
if (ctx->compressinfo)
mutt_fast_close_compressed (ctx);
#endif
#ifdef USE_COMPRESSED
if (ctx->compressinfo)
mutt_fast_close_compressed (ctx);
#endif
-
FREE
(&ctx->path);
-
FREE
(&ctx->pattern);
+
mem_free
(&ctx->path);
+
mem_free
(&ctx->pattern);
if (ctx->limit_pattern)
mutt_pattern_free (&ctx->limit_pattern);
safe_fclose (&ctx->fp);
if (ctx->limit_pattern)
mutt_pattern_free (&ctx->limit_pattern);
safe_fclose (&ctx->fp);
@@
-1117,7
+1119,7
@@
MESSAGE *mx_open_new_message (CONTEXT * dest, HEADER * hdr, int flags)
return (NULL);
}
return (NULL);
}
- msg =
safe
_calloc (1, sizeof (MESSAGE));
+ msg =
mem
_calloc (1, sizeof (MESSAGE));
msg->magic = dest->magic;
msg->write = 1;
msg->magic = dest->magic;
msg->write = 1;
@@
-1150,7
+1152,7
@@
MESSAGE *mx_open_new_message (CONTEXT * dest, HEADER * hdr, int flags)
}
}
else
}
}
else
-
FREE
(&msg);
+
mem_free
(&msg);
return msg;
}
return msg;
}
@@
-1179,7
+1181,7
@@
MESSAGE *mx_open_message (CONTEXT * ctx, int msgno)
{
MESSAGE *msg;
{
MESSAGE *msg;
- msg =
safe
_calloc (1, sizeof (MESSAGE));
+ msg =
mem
_calloc (1, sizeof (MESSAGE));
switch (msg->magic = ctx->magic) {
case M_MBOX:
case M_MMDF:
switch (msg->magic = ctx->magic) {
case M_MBOX:
case M_MMDF:
@@
-1201,7
+1203,7
@@
MESSAGE *mx_open_message (CONTEXT * ctx, int msgno)
if (msg->fp == NULL) {
mutt_perror (path);
debug_print (1, ("fopen: %s: %s (errno %d).\n", path, strerror (errno), errno));
if (msg->fp == NULL) {
mutt_perror (path);
debug_print (1, ("fopen: %s: %s (errno %d).\n", path, strerror (errno), errno));
-
FREE
(&msg);
+
mem_free
(&msg);
}
}
break;
}
}
break;
@@
-1210,7
+1212,7
@@
MESSAGE *mx_open_message (CONTEXT * ctx, int msgno)
case M_IMAP:
{
if (imap_fetch_message (msg, ctx, msgno) != 0)
case M_IMAP:
{
if (imap_fetch_message (msg, ctx, msgno) != 0)
-
FREE
(&msg);
+
mem_free
(&msg);
break;
}
#endif /* USE_IMAP */
break;
}
#endif /* USE_IMAP */
@@
-1219,7
+1221,7
@@
MESSAGE *mx_open_message (CONTEXT * ctx, int msgno)
case M_POP:
{
if (pop_fetch_message (msg, ctx, msgno) != 0)
case M_POP:
{
if (pop_fetch_message (msg, ctx, msgno) != 0)
-
FREE
(&msg);
+
mem_free
(&msg);
break;
}
#endif /* USE_POP */
break;
}
#endif /* USE_POP */
@@
-1228,14
+1230,14
@@
MESSAGE *mx_open_message (CONTEXT * ctx, int msgno)
case M_NNTP:
{
if (nntp_fetch_message (msg, ctx, msgno) != 0)
case M_NNTP:
{
if (nntp_fetch_message (msg, ctx, msgno) != 0)
-
FREE
(&msg);
+
mem_free
(&msg);
break;
}
#endif /* USE_NNTP */
default:
debug_print (1, ("function not implemented for mailbox type %d.\n", ctx->magic));
break;
}
#endif /* USE_NNTP */
default:
debug_print (1, ("function not implemented for mailbox type %d.\n", ctx->magic));
-
FREE
(&msg);
+
mem_free
(&msg);
break;
}
return (msg);
break;
}
return (msg);
@@
-1277,10
+1279,10
@@
int mx_close_message (MESSAGE ** msg)
if ((*msg)->path) {
debug_print (1, ("unlinking %s\n", (*msg)->path));
unlink ((*msg)->path);
if ((*msg)->path) {
debug_print (1, ("unlinking %s\n", (*msg)->path));
unlink ((*msg)->path);
-
FREE
(&(*msg)->path);
+
mem_free
(&(*msg)->path);
}
}
-
FREE
(msg);
+
mem_free
(msg);
return (r);
}
return (r);
}
@@
-1297,12
+1299,12
@@
void mx_alloc_memory (CONTEXT * ctx)
}
if (ctx->hdrs) {
}
if (ctx->hdrs) {
-
safe
_realloc (&ctx->hdrs, sizeof (HEADER *) * (ctx->hdrmax += 25));
-
safe
_realloc (&ctx->v2r, sizeof (int) * ctx->hdrmax);
+
mem
_realloc (&ctx->hdrs, sizeof (HEADER *) * (ctx->hdrmax += 25));
+
mem
_realloc (&ctx->v2r, sizeof (int) * ctx->hdrmax);
}
else {
}
else {
- ctx->hdrs =
safe
_calloc ((ctx->hdrmax += 25), sizeof (HEADER *));
- ctx->v2r =
safe
_calloc (ctx->hdrmax, sizeof (int));
+ ctx->hdrs =
mem
_calloc ((ctx->hdrmax += 25), sizeof (HEADER *));
+ ctx->v2r =
mem
_calloc (ctx->hdrmax, sizeof (int));
}
for (i = ctx->msgcount; i < ctx->hdrmax; i++) {
ctx->hdrs[i] = NULL;
}
for (i = ctx->msgcount; i < ctx->hdrmax; i++) {
ctx->hdrs[i] = NULL;
@@
-1342,7
+1344,7
@@
void mx_update_context (CONTEXT * ctx, int new_messages)
h2 = hash_find (ctx->id_hash, h->env->supersedes);
h2 = hash_find (ctx->id_hash, h->env->supersedes);
- /*
FREE
(&h->env->supersedes); should I ? */
+ /*
mem_free
(&h->env->supersedes); should I ? */
if (h2) {
h2->superseded = 1;
if (!ctx->counting && option (OPTSCORE))
if (h2) {
h2->superseded = 1;
if (!ctx->counting && option (OPTSCORE))