summaryrefslogtreecommitdiffstats
path: root/mbox.c
diff options
context:
space:
mode:
authorDerek Martin <code@pizzashack.org>2016-05-09 14:06:54 -0700
committerDerek Martin <code@pizzashack.org>2016-05-09 14:06:54 -0700
commit9cafb05c0efadc771197c0e1e98fa9d989b48d41 (patch)
treec70f969ad76a417ec896f10ecccd17ca0702c8ef /mbox.c
parentfa0dcb09fe69d23ceba28159e6be6b72adb9a9df (diff)
Change M_* symbols to MUTT_*
Changeset 23334e967dd7 created a workaround for a namespace conflict with Solaris and derivatives. After some discussion, the team decided it would be best to move away from using the "M_" prefix for macros. This patch was automatically generated by running: perl -wpi -e 's/\bM_(\w+)\b/MUTT_$1/g' `find . -name '*.[ch]' -print` with the exception that sys_socket.h was exempted. (That file will be backed out subsequent to this commit.) Thanks to Andras Salamon for supplying the perl script used to make this change.
Diffstat (limited to 'mbox.c')
-rw-r--r--mbox.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/mbox.c b/mbox.c
index 95cba654..74f45d53 100644
--- a/mbox.c
+++ b/mbox.c
@@ -117,7 +117,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx)
if (!ctx->quiet)
{
snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
- mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
+ mutt_progress_init (&progress, msgbuf, MUTT_PROGRESS_MSG, ReadInc, 0);
}
FOREVER
@@ -267,7 +267,7 @@ int mbox_parse_mailbox (CONTEXT *ctx)
if (!ctx->quiet)
{
snprintf (msgbuf, sizeof (msgbuf), _("Reading %s..."), ctx->path);
- mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, ReadInc, 0);
+ mutt_progress_init (&progress, msgbuf, MUTT_PROGRESS_MSG, ReadInc, 0);
}
loc = ftello (ctx->fp);
@@ -428,9 +428,9 @@ int mbox_open_mailbox (CONTEXT *ctx)
return (-1);
}
- if (ctx->magic == M_MBOX)
+ if (ctx->magic == MUTT_MBOX)
rc = mbox_parse_mailbox (ctx);
- else if (ctx->magic == M_MMDF)
+ else if (ctx->magic == MUTT_MMDF)
rc = mmdf_parse_mailbox (ctx);
else
rc = -1;
@@ -560,9 +560,9 @@ int mbox_strict_cmp_headers (const HEADER *h1, const HEADER *h2)
/* check to see if the mailbox has changed on disk.
*
* return values:
- * M_REOPENED mailbox has been reopened
- * M_NEW_MAIL new mail has arrived!
- * M_LOCKED couldn't lock the file
+ * MUTT_REOPENED mailbox has been reopened
+ * MUTT_NEW_MAIL new mail has arrived!
+ * MUTT_LOCKED couldn't lock the file
* 0 no change
* -1 error
*/
@@ -598,7 +598,7 @@ int mbox_check_mailbox (CONTEXT *ctx, int *index_hint)
* probably the new mail arrived: no reason to wait till we can
* parse it: we'll get it on the next pass
*/
- return (M_LOCKED);
+ return (MUTT_LOCKED);
}
unlock = 1;
}
@@ -613,12 +613,12 @@ int mbox_check_mailbox (CONTEXT *ctx, int *index_hint)
dprint (1, (debugfile, "mbox_check_mailbox: fseek() failed\n"));
if (fgets (buffer, sizeof (buffer), ctx->fp) != NULL)
{
- if ((ctx->magic == M_MBOX && mutt_strncmp ("From ", buffer, 5) == 0) ||
- (ctx->magic == M_MMDF && mutt_strcmp (MMDF_SEP, buffer) == 0))
+ if ((ctx->magic == MUTT_MBOX && mutt_strncmp ("From ", buffer, 5) == 0) ||
+ (ctx->magic == MUTT_MMDF && mutt_strcmp (MMDF_SEP, buffer) == 0))
{
if (fseeko (ctx->fp, ctx->size, SEEK_SET) != 0)
dprint (1, (debugfile, "mbox_check_mailbox: fseek() failed\n"));
- if (ctx->magic == M_MBOX)
+ if (ctx->magic == MUTT_MBOX)
mbox_parse_mailbox (ctx);
else
mmdf_parse_mailbox (ctx);
@@ -634,7 +634,7 @@ int mbox_check_mailbox (CONTEXT *ctx, int *index_hint)
mutt_unblock_signals ();
}
- return (M_NEW_MAIL); /* signal that new mail arrived */
+ return (MUTT_NEW_MAIL); /* signal that new mail arrived */
}
else
modified = 1;
@@ -658,7 +658,7 @@ int mbox_check_mailbox (CONTEXT *ctx, int *index_hint)
mbox_unlock_mailbox (ctx);
mutt_unblock_signals ();
}
- return (M_REOPENED);
+ return (MUTT_REOPENED);
}
}
@@ -762,7 +762,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
}
/* Check to make sure that the file hasn't changed on disk */
- if ((i = mbox_check_mailbox (ctx, index_hint)) == M_NEW_MAIL || i == M_REOPENED)
+ if ((i = mbox_check_mailbox (ctx, index_hint)) == MUTT_NEW_MAIL || i == MUTT_REOPENED)
{
/* new mail arrived, or mailbox reopened */
need_sort = i;
@@ -815,7 +815,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
/* the offset stored in the header does not include the MMDF_SEP, so make
* sure we seek to the correct location
*/
- if (ctx->magic == M_MMDF)
+ if (ctx->magic == MUTT_MMDF)
offset -= (sizeof MMDF_SEP - 1);
/* allocate space for the new offsets */
@@ -825,7 +825,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
if (!ctx->quiet)
{
snprintf (msgbuf, sizeof (msgbuf), _("Writing %s..."), ctx->path);
- mutt_progress_init (&progress, msgbuf, M_PROGRESS_MSG, WriteInc, ctx->msgcount);
+ mutt_progress_init (&progress, msgbuf, MUTT_PROGRESS_MSG, WriteInc, ctx->msgcount);
}
for (i = first, j = 0; i < ctx->msgcount; i++)
@@ -847,7 +847,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
{
j++;
- if (ctx->magic == M_MMDF)
+ if (ctx->magic == MUTT_MMDF)
{
if (fputs (MMDF_SEP, fp) == EOF)
{
@@ -865,7 +865,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
*/
newOffset[i - first].hdr = ftello (fp) + offset;
- if (mutt_copy_message (fp, ctx, ctx->hdrs[i], M_CM_UPDATE,
+ if (mutt_copy_message (fp, ctx, ctx->hdrs[i], MUTT_CM_UPDATE,
CH_FROM | CH_UPDATE | CH_UPDATE_LEN) != 0)
{
mutt_perror (tempfile);
@@ -885,7 +885,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
switch(ctx->magic)
{
- case M_MMDF:
+ case MUTT_MMDF:
if(fputs(MMDF_SEP, fp) == EOF)
{
mutt_perror (tempfile);
@@ -939,8 +939,8 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint)
if (fseeko (ctx->fp, offset, SEEK_SET) != 0 || /* seek the append location */
/* do a sanity check to make sure the mailbox looks ok */
fgets (buf, sizeof (buf), ctx->fp) == NULL ||
- (ctx->magic == M_MBOX && mutt_strncmp ("From ", buf, 5) != 0) ||
- (ctx->magic == M_MMDF && mutt_strcmp (MMDF_SEP, buf) != 0))
+ (ctx->magic == MUTT_MBOX && mutt_strncmp ("From ", buf, 5) != 0) ||
+ (ctx->magic == MUTT_MMDF && mutt_strcmp (MMDF_SEP, buf) != 0))
{
dprint (1, (debugfile, "mbox_sync_mailbox: message not in expected position."));
dprint (1, (debugfile, "\tLINE: %s\n", buf));
@@ -1064,7 +1064,7 @@ bail: /* Come here in case of disaster */
if (need_sort)
/* if the mailbox was reopened, the thread tree will be invalid so make
* sure to start threading from scratch. */
- mutt_sort_headers (ctx, (need_sort == M_REOPENED));
+ mutt_sort_headers (ctx, (need_sort == MUTT_REOPENED));
return rc;
}
@@ -1143,14 +1143,14 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint)
switch (ctx->magic)
{
- case M_MBOX:
- case M_MMDF:
+ case MUTT_MBOX:
+ case MUTT_MMDF:
cmp_headers = mbox_strict_cmp_headers;
safe_fclose (&ctx->fp);
if (!(ctx->fp = safe_fopen (ctx->path, "r")))
rc = -1;
else
- rc = ((ctx->magic == M_MBOX) ? mbox_parse_mailbox
+ rc = ((ctx->magic == MUTT_MBOX) ? mbox_parse_mailbox
: mmdf_parse_mailbox) (ctx);
break;
@@ -1221,13 +1221,13 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint)
* otherwise, the header may have been modified externally,
* and we don't want to lose _those_ changes
*/
- mutt_set_flag (ctx, ctx->hdrs[i], M_FLAG, old_hdrs[j]->flagged);
- mutt_set_flag (ctx, ctx->hdrs[i], M_REPLIED, old_hdrs[j]->replied);
- mutt_set_flag (ctx, ctx->hdrs[i], M_OLD, old_hdrs[j]->old);
- mutt_set_flag (ctx, ctx->hdrs[i], M_READ, old_hdrs[j]->read);
+ mutt_set_flag (ctx, ctx->hdrs[i], MUTT_FLAG, old_hdrs[j]->flagged);
+ mutt_set_flag (ctx, ctx->hdrs[i], MUTT_REPLIED, old_hdrs[j]->replied);
+ mutt_set_flag (ctx, ctx->hdrs[i], MUTT_OLD, old_hdrs[j]->old);
+ mutt_set_flag (ctx, ctx->hdrs[i], MUTT_READ, old_hdrs[j]->read);
}
- mutt_set_flag (ctx, ctx->hdrs[i], M_DELETE, old_hdrs[j]->deleted);
- mutt_set_flag (ctx, ctx->hdrs[i], M_TAG, old_hdrs[j]->tagged);
+ mutt_set_flag (ctx, ctx->hdrs[i], MUTT_DELETE, old_hdrs[j]->deleted);
+ mutt_set_flag (ctx, ctx->hdrs[i], MUTT_TAG, old_hdrs[j]->tagged);
/* we don't need this header any more */
mutt_free_header (&(old_hdrs[j]));
@@ -1248,7 +1248,7 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint)
ctx->quiet = 0;
- return ((ctx->changed || msg_mod) ? M_REOPENED : M_NEW_MAIL);
+ return ((ctx->changed || msg_mod) ? MUTT_REOPENED : MUTT_NEW_MAIL);
}
/*