Commit 9cafb05c authored by Derek Martin's avatar Derek Martin

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.
parent fa0dcb09
......@@ -39,7 +39,7 @@ int mutt_account_match (const ACCOUNT* a1, const ACCOUNT* a2)
return 0;
#ifdef USE_IMAP
if (a1->type == M_ACCT_TYPE_IMAP)
if (a1->type == MUTT_ACCT_TYPE_IMAP)
{
if (ImapUser)
user = ImapUser;
......@@ -47,15 +47,15 @@ int mutt_account_match (const ACCOUNT* a1, const ACCOUNT* a2)
#endif
#ifdef USE_POP
if (a1->type == M_ACCT_TYPE_POP && PopUser)
if (a1->type == MUTT_ACCT_TYPE_POP && PopUser)
user = PopUser;
#endif
if (a1->flags & a2->flags & M_ACCT_USER)
if (a1->flags & a2->flags & MUTT_ACCT_USER)
return (!strcmp (a1->user, a2->user));
if (a1->flags & M_ACCT_USER)
if (a1->flags & MUTT_ACCT_USER)
return (!strcmp (a1->user, user));
if (a2->flags & M_ACCT_USER)
if (a2->flags & MUTT_ACCT_USER)
return (!strcmp (a2->user, user));
return 1;
......@@ -73,17 +73,17 @@ int mutt_account_fromurl (ACCOUNT* account, ciss_url_t* url)
if (url->user)
{
strfcpy (account->user, url->user, sizeof (account->user));
account->flags |= M_ACCT_USER;
account->flags |= MUTT_ACCT_USER;
}
if (url->pass)
{
strfcpy (account->pass, url->pass, sizeof (account->pass));
account->flags |= M_ACCT_PASS;
account->flags |= MUTT_ACCT_PASS;
}
if (url->port)
{
account->port = url->port;
account->flags |= M_ACCT_PORT;
account->flags |= MUTT_ACCT_PORT;
}
return 0;
......@@ -101,9 +101,9 @@ void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url)
url->port = 0;
#ifdef USE_IMAP
if (account->type == M_ACCT_TYPE_IMAP)
if (account->type == MUTT_ACCT_TYPE_IMAP)
{
if (account->flags & M_ACCT_SSL)
if (account->flags & MUTT_ACCT_SSL)
url->scheme = U_IMAPS;
else
url->scheme = U_IMAP;
......@@ -111,9 +111,9 @@ void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url)
#endif
#ifdef USE_POP
if (account->type == M_ACCT_TYPE_POP)
if (account->type == MUTT_ACCT_TYPE_POP)
{
if (account->flags & M_ACCT_SSL)
if (account->flags & MUTT_ACCT_SSL)
url->scheme = U_POPS;
else
url->scheme = U_POP;
......@@ -121,9 +121,9 @@ void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url)
#endif
#ifdef USE_SMTP
if (account->type == M_ACCT_TYPE_SMTP)
if (account->type == MUTT_ACCT_TYPE_SMTP)
{
if (account->flags & M_ACCT_SSL)
if (account->flags & MUTT_ACCT_SSL)
url->scheme = U_SMTPS;
else
url->scheme = U_SMTP;
......@@ -131,11 +131,11 @@ void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url)
#endif
url->host = account->host;
if (account->flags & M_ACCT_PORT)
if (account->flags & MUTT_ACCT_PORT)
url->port = account->port;
if (account->flags & M_ACCT_USER)
if (account->flags & MUTT_ACCT_USER)
url->user = account->user;
if (account->flags & M_ACCT_PASS)
if (account->flags & MUTT_ACCT_PASS)
url->pass = account->pass;
}
......@@ -145,14 +145,14 @@ int mutt_account_getuser (ACCOUNT* account)
char prompt[SHORT_STRING];
/* already set */
if (account->flags & M_ACCT_USER)
if (account->flags & MUTT_ACCT_USER)
return 0;
#ifdef USE_IMAP
else if ((account->type == M_ACCT_TYPE_IMAP) && ImapUser)
else if ((account->type == MUTT_ACCT_TYPE_IMAP) && ImapUser)
strfcpy (account->user, ImapUser, sizeof (account->user));
#endif
#ifdef USE_POP
else if ((account->type == M_ACCT_TYPE_POP) && PopUser)
else if ((account->type == MUTT_ACCT_TYPE_POP) && PopUser)
strfcpy (account->user, PopUser, sizeof (account->user));
#endif
else if (option (OPTNOCURSES))
......@@ -166,7 +166,7 @@ int mutt_account_getuser (ACCOUNT* account)
return -1;
}
account->flags |= M_ACCT_USER;
account->flags |= MUTT_ACCT_USER;
return 0;
}
......@@ -174,26 +174,26 @@ int mutt_account_getuser (ACCOUNT* account)
int mutt_account_getlogin (ACCOUNT* account)
{
/* already set */
if (account->flags & M_ACCT_LOGIN)
if (account->flags & MUTT_ACCT_LOGIN)
return 0;
#ifdef USE_IMAP
else if (account->type == M_ACCT_TYPE_IMAP)
else if (account->type == MUTT_ACCT_TYPE_IMAP)
{
if (ImapLogin)
{
strfcpy (account->login, ImapLogin, sizeof (account->login));
account->flags |= M_ACCT_LOGIN;
account->flags |= MUTT_ACCT_LOGIN;
}
}
#endif
if (!(account->flags & M_ACCT_LOGIN))
if (!(account->flags & MUTT_ACCT_LOGIN))
{
mutt_account_getuser (account);
strfcpy (account->login, account->user, sizeof (account->login));
}
account->flags |= M_ACCT_LOGIN;
account->flags |= MUTT_ACCT_LOGIN;
return 0;
}
......@@ -203,18 +203,18 @@ int mutt_account_getpass (ACCOUNT* account)
{
char prompt[SHORT_STRING];
if (account->flags & M_ACCT_PASS)
if (account->flags & MUTT_ACCT_PASS)
return 0;
#ifdef USE_IMAP
else if ((account->type == M_ACCT_TYPE_IMAP) && ImapPass)
else if ((account->type == MUTT_ACCT_TYPE_IMAP) && ImapPass)
strfcpy (account->pass, ImapPass, sizeof (account->pass));
#endif
#ifdef USE_POP
else if ((account->type == M_ACCT_TYPE_POP) && PopPass)
else if ((account->type == MUTT_ACCT_TYPE_POP) && PopPass)
strfcpy (account->pass, PopPass, sizeof (account->pass));
#endif
#ifdef USE_SMTP
else if ((account->type == M_ACCT_TYPE_SMTP) && SmtpPass)
else if ((account->type == MUTT_ACCT_TYPE_SMTP) && SmtpPass)
strfcpy (account->pass, SmtpPass, sizeof (account->pass));
#endif
else if (option (OPTNOCURSES))
......@@ -222,19 +222,19 @@ int mutt_account_getpass (ACCOUNT* account)
else
{
snprintf (prompt, sizeof (prompt), _("Password for %s@%s: "),
account->flags & M_ACCT_LOGIN ? account->login : account->user,
account->flags & MUTT_ACCT_LOGIN ? account->login : account->user,
account->host);
account->pass[0] = '\0';
if (mutt_get_password (prompt, account->pass, sizeof (account->pass)))
return -1;
}
account->flags |= M_ACCT_PASS;
account->flags |= MUTT_ACCT_PASS;
return 0;
}
void mutt_account_unsetpass (ACCOUNT* account)
{
account->flags &= ~M_ACCT_PASS;
account->flags &= ~MUTT_ACCT_PASS;
}
......@@ -26,18 +26,18 @@
/* account types */
enum
{
M_ACCT_TYPE_NONE = 0,
M_ACCT_TYPE_IMAP,
M_ACCT_TYPE_POP,
M_ACCT_TYPE_SMTP
MUTT_ACCT_TYPE_NONE = 0,
MUTT_ACCT_TYPE_IMAP,
MUTT_ACCT_TYPE_POP,
MUTT_ACCT_TYPE_SMTP
};
/* account flags */
#define M_ACCT_PORT (1<<0)
#define M_ACCT_USER (1<<1)
#define M_ACCT_LOGIN (1<<2)
#define M_ACCT_PASS (1<<3)
#define M_ACCT_SSL (1<<4)
#define MUTT_ACCT_PORT (1<<0)
#define MUTT_ACCT_USER (1<<1)
#define MUTT_ACCT_LOGIN (1<<2)
#define MUTT_ACCT_PASS (1<<3)
#define MUTT_ACCT_SSL (1<<4)
typedef struct
{
......
......@@ -80,7 +80,7 @@ alias_format_str (char *dest, size_t destlen, size_t col, int cols, char op, con
static void alias_entry (char *s, size_t slen, MUTTMENU *m, int num)
{
mutt_FormatString (s, slen, 0, MuttIndexWindow->cols, NONULL (AliasFmt), alias_format_str, (unsigned long) ((ALIAS **) m->data)[num], M_FORMAT_ARROWCURSOR);
mutt_FormatString (s, slen, 0, MuttIndexWindow->cols, NONULL (AliasFmt), alias_format_str, (unsigned long) ((ALIAS **) m->data)[num], MUTT_FORMAT_ARROWCURSOR);
}
static int alias_tag (MUTTMENU *menu, int n, int m)
......
......@@ -269,9 +269,9 @@ retry_name:
if (mutt_check_alias_name (buf, fixed, sizeof (fixed)))
{
switch (mutt_yesorno (_("Warning: This alias name may not work. Fix it?"), M_YES))
switch (mutt_yesorno (_("Warning: This alias name may not work. Fix it?"), MUTT_YES))
{
case M_YES:
case MUTT_YES:
strfcpy (buf, fixed, sizeof (buf));
goto retry_name;
case -1:
......@@ -326,7 +326,7 @@ retry_name:
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), new->addr, 1);
snprintf (prompt, sizeof (prompt), _("[%s = %s] Accept?"), new->name, buf);
if (mutt_yesorno (prompt, M_YES) != M_YES)
if (mutt_yesorno (prompt, MUTT_YES) != MUTT_YES)
{
mutt_free_alias (&new);
return;
......@@ -344,7 +344,7 @@ retry_name:
Aliases = new;
strfcpy (buf, NONULL (AliasFile), sizeof (buf));
if (mutt_get_field (_("Save to file: "), buf, sizeof (buf), M_FILE) != 0)
if (mutt_get_field (_("Save to file: "), buf, sizeof (buf), MUTT_FILE) != 0)
return;
mutt_expand_path (buf, sizeof (buf));
if ((rc = fopen (buf, "a+")))
......
......@@ -94,7 +94,7 @@ int mutt_compose_attachment (BODY *a)
int rc = 0;
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
if (rfc1524_mailcap_lookup (a, type, entry, M_COMPOSE))
if (rfc1524_mailcap_lookup (a, type, entry, MUTT_COMPOSE))
{
if (entry->composecommand || entry->composetypecommand)
{
......@@ -110,7 +110,7 @@ int mutt_compose_attachment (BODY *a)
a->filename, newfile));
if (safe_symlink (a->filename, newfile) == -1)
{
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) != MUTT_YES)
goto bailout;
}
else
......@@ -229,7 +229,7 @@ int mutt_edit_attachment (BODY *a)
int rc = 0;
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
if (rfc1524_mailcap_lookup (a, type, entry, M_EDIT))
if (rfc1524_mailcap_lookup (a, type, entry, MUTT_EDIT))
{
if (entry->editcommand)
{
......@@ -242,7 +242,7 @@ int mutt_edit_attachment (BODY *a)
a->filename, newfile));
if (safe_symlink (a->filename, newfile) == -1)
{
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) != MUTT_YES)
goto bailout;
}
else
......@@ -350,8 +350,8 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
if (WithCrypto && is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
!crypt_valid_passphrase(a->hdr->security))
return (rc);
use_mailcap = (flag == M_MAILCAP ||
(flag == M_REGULAR && mutt_needs_mailcap (a)));
use_mailcap = (flag == MUTT_MAILCAP ||
(flag == MUTT_REGULAR && mutt_needs_mailcap (a)));
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
if (use_mailcap)
......@@ -359,12 +359,12 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
entry = rfc1524_new_entry ();
if (!rfc1524_mailcap_lookup (a, type, entry, 0))
{
if (flag == M_REGULAR)
if (flag == MUTT_REGULAR)
{
/* fallback to view as text */
rfc1524_free_entry (&entry);
mutt_error _("No matching mailcap entry found. Viewing as text.");
flag = M_AS_TEXT;
flag = MUTT_AS_TEXT;
use_mailcap = 0;
}
else
......@@ -397,7 +397,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
/* send case: the file is already there */
if (safe_symlink (a->filename, tempfile) == -1)
{
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) == M_YES)
if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) == MUTT_YES)
strfcpy (tempfile, a->filename, sizeof (tempfile));
else
goto return_error;
......@@ -502,7 +502,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
{
/* Don't use mailcap; the attachment is viewed in the pager */
if (flag == M_AS_TEXT)
if (flag == MUTT_AS_TEXT)
{
/* just let me see the raw data */
if (fp)
......@@ -524,7 +524,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
goto return_error;
}
decode_state.fpin = fp;
decode_state.flags = M_CHARCONV;
decode_state.flags = MUTT_CHARCONV;
mutt_decode_attachment(a, &decode_state);
if (fclose(decode_state.fpout) == EOF)
dprint(1, (debugfile, "mutt_view_attachment:%d fclose errno=%d %s\n", __LINE__, pagerfile, errno, strerror(errno)));
......@@ -544,7 +544,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
/* Use built-in handler */
set_option (OPTVIEWATTACH); /* disable the "use 'v' to view this part"
* message in case of error */
if (mutt_decode_save_attachment (fp, a, pagerfile, M_DISPLAY, 0))
if (mutt_decode_save_attachment (fp, a, pagerfile, MUTT_DISPLAY, 0))
{
unset_option (OPTVIEWATTACH);
goto return_error;
......@@ -576,7 +576,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
info.hdr = hdr;
rc = mutt_do_pager (descrip, pagerfile,
M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE : 0), &info);
MUTT_PAGER_ATTACHMENT | (is_message ? MUTT_PAGER_MESSAGE : 0), &info);
*pagerfile = '\0';
}
else
......@@ -691,9 +691,9 @@ bail:
static FILE *
mutt_save_attachment_open (char *path, int flags)
{
if (flags == M_SAVE_APPEND)
if (flags == MUTT_SAVE_APPEND)
return fopen (path, "a");
if (flags == M_SAVE_OVERWRITE)
if (flags == MUTT_SAVE_OVERWRITE)
return fopen (path, "w"); /* __FOPEN_CHECKED__ */
return safe_fopen (path, "w");
......@@ -729,16 +729,16 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr)
fseeko (fp, m->offset, 0);
if (fgets (buf, sizeof (buf), fp) == NULL)
return -1;
if (mx_open_mailbox(path, M_APPEND | M_QUIET, &ctx) == NULL)
if (mx_open_mailbox(path, MUTT_APPEND | MUTT_QUIET, &ctx) == NULL)
return -1;
if ((msg = mx_open_new_message (&ctx, hn, is_from (buf, NULL, 0, NULL) ? 0 : M_ADD_FROM)) == NULL)
if ((msg = mx_open_new_message (&ctx, hn, is_from (buf, NULL, 0, NULL) ? 0 : MUTT_ADD_FROM)) == NULL)
{
mx_close_mailbox(&ctx, NULL);
return -1;
}
if (ctx.magic == M_MBOX || ctx.magic == M_MMDF)
if (ctx.magic == MUTT_MBOX || ctx.magic == MUTT_MMDF)
chflags = CH_FROM | CH_UPDATE_LEN;
chflags |= (ctx.magic == M_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
chflags |= (ctx.magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
if (_mutt_copy_message (msg->fp, fp, hn, hn->content, 0, chflags) == 0
&& mx_commit_message (msg, &ctx) == 0)
r = 0;
......@@ -818,9 +818,9 @@ int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path,
memset (&s, 0, sizeof (s));
s.flags = displaying;
if (flags == M_SAVE_APPEND)
if (flags == MUTT_SAVE_APPEND)
s.fpout = fopen (path, "a");
else if (flags == M_SAVE_OVERWRITE)
else if (flags == MUTT_SAVE_OVERWRITE)
s.fpout = fopen (path, "w"); /* __FOPEN_CHECKED__ */
else
s.fpout = safe_fopen (path, "w");
......@@ -861,12 +861,12 @@ int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path,
mutt_parse_part (s.fpin, m);
if (m->noconv || is_multipart (m))
s.flags |= M_CHARCONV;
s.flags |= MUTT_CHARCONV;
}
else
{
s.fpin = fp;
s.flags |= M_CHARCONV;
s.flags |= MUTT_CHARCONV;
}
mutt_body_handler (m, &s);
......@@ -905,7 +905,7 @@ int mutt_print_attachment (FILE *fp, BODY *a)
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
if (rfc1524_mailcap_lookup (a, type, NULL, M_PRINT))
if (rfc1524_mailcap_lookup (a, type, NULL, MUTT_PRINT))
{
char command[_POSIX_PATH_MAX+STRING];
rfc1524_entry *entry;
......@@ -914,7 +914,7 @@ int mutt_print_attachment (FILE *fp, BODY *a)
dprint (2, (debugfile, "Using mailcap...\n"));
entry = rfc1524_new_entry ();
rfc1524_mailcap_lookup (a, type, entry, M_PRINT);
rfc1524_mailcap_lookup (a, type, entry, MUTT_PRINT);
if (rfc1524_expand_filename (entry->nametemplate, a->filename,
newfile, sizeof (newfile)))
{
......@@ -922,7 +922,7 @@ int mutt_print_attachment (FILE *fp, BODY *a)
{
if (safe_symlink(a->filename, newfile) == -1)
{
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) != MUTT_YES)
{
rfc1524_free_entry (&entry);
return 0;
......@@ -996,7 +996,7 @@ int mutt_print_attachment (FILE *fp, BODY *a)
fpout = NULL;
mutt_mktemp (newfile, sizeof (newfile));
if (mutt_decode_save_attachment (fp, a, newfile, M_PRINTING, 0) == 0)
if (mutt_decode_save_attachment (fp, a, newfile, MUTT_PRINTING, 0) == 0)
{
dprint (2, (debugfile, "successfully decoded %s type attachment to %s\n",
......
......@@ -152,7 +152,7 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co
FOLDER *folder = (FOLDER *) data;
struct passwd *pw;
struct group *gr;
int optional = (flags & M_FORMAT_OPTIONAL);
int optional = (flags & MUTT_FORMAT_OPTIONAL);
switch (op)
{
......@@ -318,7 +318,7 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co
if (optional)
mutt_FormatString (dest, destlen, col, cols, ifstring, folder_format_str, data, 0);
else if (flags & M_FORMAT_OPTIONAL)
else if (flags & MUTT_FORMAT_OPTIONAL)
mutt_FormatString (dest, destlen, col, cols, elsestring, folder_format_str, data, 0);
return (src);
......@@ -516,7 +516,7 @@ static void folder_entry (char *s, size_t slen, MUTTMENU *menu, int num)
folder.num = num;
mutt_FormatString (s, slen, 0, MuttIndexWindow->cols, NONULL(FolderFormat), folder_format_str,
(unsigned long) &folder, M_FORMAT_ARROWCURSOR);
(unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR);
}
static void init_menu (struct browser_state *state, MUTTMENU *menu, char *title,
......@@ -579,9 +579,9 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
MUTTMENU *menu;
struct stat st;
int i, killPrefix = 0;
int multiple = (flags & M_SEL_MULTI) ? 1 : 0;
int folder = (flags & M_SEL_FOLDER) ? 1 : 0;
int buffy = (flags & M_SEL_BUFFY) ? 1 : 0;
int multiple = (flags & MUTT_SEL_MULTI) ? 1 : 0;
int folder = (flags & MUTT_SEL_FOLDER) ? 1 : 0;
int buffy = (flags & MUTT_SEL_BUFFY) ? 1 : 0;
buffy = buffy && folder;
......@@ -964,7 +964,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
}
snprintf (msg, sizeof (msg), _("Really delete mailbox \"%s\"?"),
mx.mbox);
if (mutt_yesorno (msg, M_NO) == M_YES)
if (mutt_yesorno (msg, MUTT_NO) == MUTT_YES)
{
if (!imap_delete_mailbox (Context, mx))
{
......@@ -1001,7 +1001,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
buf[len]='/';
}
if (mutt_get_field (_("Chdir to: "), buf, sizeof (buf), M_FILE) == 0 &&
if (mutt_get_field (_("Chdir to: "), buf, sizeof (buf), MUTT_FILE) == 0 &&
buf[0])
{
buffy = 0;
......@@ -1205,7 +1205,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
case OP_BROWSER_NEW_FILE:
snprintf (buf, sizeof (buf), "%s/", LastDir);
if (mutt_get_field (_("New file name: "), buf, sizeof (buf), M_FILE) == 0)
if (mutt_get_field (_("New file name: "), buf, sizeof (buf), MUTT_FILE) == 0)
{
strfcpy (f, buf, flen);
destroy_state (&state);
......@@ -1248,7 +1248,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
b = mutt_make_file_attach (buf);
if (b != NULL)
{
mutt_view_attachment (NULL, b, M_REGULAR, NULL, NULL, 0);
mutt_view_attachment (NULL, b, MUTT_REGULAR, NULL, NULL, 0);
mutt_free_body (&b);
menu->redraw = REDRAW_FULL;
}
......
......@@ -124,7 +124,7 @@ static int test_new_folder (const char *path)
typ = mx_get_magic (path);
if (typ != M_MBOX && typ != M_MMDF)
if (typ != MUTT_MBOX && typ != MUTT_MMDF)
return 0;
if ((f = fopen (path, "rb")))
......@@ -223,7 +223,7 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
mutt_extract_token (path, s, 0);
strfcpy (buf, path->data, sizeof (buf));
if(data == M_UNMAILBOXES && mutt_strcmp(buf,"*") == 0)
if(data == MUTT_UNMAILBOXES && mutt_strcmp(buf,"*") == 0)
{
for (tmp = &Incoming; *tmp;)
{
......@@ -251,7 +251,7 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
}
}
if(data == M_UNMAILBOXES)
if(data == MUTT_UNMAILBOXES)
{
if(*tmp)
{
......@@ -421,7 +421,7 @@ int mutt_buffy_check (int force)
#endif
/* check device ID and serial number instead of comparing paths */
if (!Context || Context->magic == M_IMAP || Context->magic == M_POP
if (!Context || Context->magic == MUTT_IMAP || Context->magic == MUTT_POP
|| stat (Context->path, &contex_sb) != 0)
{
contex_sb.st_dev=0;
......@@ -430,12 +430,12 @@ int mutt_buffy_check (int force)
for (tmp = Incoming; tmp; tmp = tmp->next)
{
if (tmp->magic != M_IMAP)
if (tmp->magic != MUTT_IMAP)
{
tmp->new = 0;
#ifdef USE_POP
if (mx_is_pop (tmp->path))
tmp->magic = M_POP;
tmp->magic = MUTT_POP;
else
#endif
if (stat (tmp->path, &sb) != 0 || (S_ISREG(sb.st_mode) && sb.st_size == 0) ||
......@@ -453,24 +453,24 @@ int mutt_buffy_check (int force)
/* check to see if the folder is the currently selected folder
* before polling */
if (!Context || !Context->path ||
(( tmp->magic == M_IMAP || tmp->magic == M_POP )
(( tmp->magic == MUTT_IMAP || tmp->magic == MUTT_POP )
? mutt_strcmp (tmp->path, Context->path) :
(sb.st_dev != contex_sb.st_dev || sb.st_ino != contex_sb.st_ino)))
{
switch (tmp->magic)
{
case M_MBOX:
case M_MMDF:
case MUTT_MBOX:
case MUTT_MMDF:
if (buffy_mbox_hasnew (tmp, &sb) > 0)
BuffyCount++;
break;
case M_MAILDIR:
case MUTT_MAILDIR:
if (buffy_maildir_hasnew (tmp) > 0)
BuffyCount++;
break;
case M_MH:
case MUTT_MH:
mh_buffy(tmp);
if (tmp->new)
BuffyCount++;
......
......@@ -17,8 +17,8 @@
*/
/*parameter to mutt_parse_mailboxes*/
#define M_MAILBOXES 1
#define M_UNMAILBOXES 2
#define MUTT_MAILBOXES 1
#define MUTT_UNMAILBOXES 2
typedef struct buffy_t
{
......
......@@ -349,15 +349,15 @@ int iconv_close (iconv_t cd)
/*
* Like iconv_open, but canonicalises the charsets, applies
* charset-hooks, recanonicalises, and finally applies iconv-hooks.
* Parameter flags=0 skips charset-hooks, while M_ICONV_HOOK_FROM
* Parameter flags=0 skips charset-hooks, while MUTT_ICONV_HOOK_FROM
* applies them to fromcode. Callers should use flags=0 when fromcode
* can safely be considered true, either some constant, or some value
* provided by the user; M_ICONV_HOOK_FROM should be used only when
* provided by the user; MUTT_ICONV_HOOK_FROM should be used only when
* fromcode is unsure, taken from a possibly wrong incoming MIME label,
* or such. Misusing M_ICONV_HOOK_FROM leads to unwanted interactions
* or such. Misusing MUTT_ICONV_HOOK_FROM leads to unwanted interactions
* in some setups. Note: By design charset-hooks should never be, and
* are never, applied to tocode. Highlight note: The top-well-named
* M_ICONV_HOOK_FROM acts on charset-hooks, not at all on iconv-hooks.
* MUTT_ICONV_HOOK_FROM acts on charset-hooks, not at all on iconv-hooks.
*/
iconv_t mutt_iconv_open (const char *tocode, const char *fromcode, int flags)
......@@ -376,7 +376,7 @@ iconv_t mutt_iconv_open (const char *tocode, const char *fromcode, int flags)
/* maybe apply charset-hooks and recanonicalise fromcode,
* but only when caller asked us to sanitize a potentialy wrong
* charset name incoming from the wild exterior. */
if ((flags & M_ICONV_HOOK_FROM) && (tmp = mutt_charset_hook (fromcode1)))
if ((flags & MUTT_ICONV_HOOK_FROM) && (tmp = mutt_charset_hook (fromcode1)))
mutt_canonical_charset (fromcode1, sizeof (fromcode1), tmp);
/* always apply iconv-hooks to suit system's iconv tastes */
......
......@@ -51,10 +51,10 @@ char *mutt_get_default_charset (void);
/* flags for charset.c:mutt_convert_string(), fgetconv_open(), and
* mutt_iconv_open(). Note that applying charset-hooks to tocode is
* never needed, and sometimes hurts: Hence there is no M_ICONV_HOOK_TO
* never needed, and sometimes hurts: Hence there is no MUTT_ICONV_HOOK_TO
* flag.
*/
#define M_ICONV_HOOK_FROM 1 /* apply charset-hooks to fromcode */
#define MUTT_ICONV_HOOK_FROM 1 /* apply charset-hooks to fromcode */
/* Check if given character set is valid (either officially assigned or
* known to local iconv implementation). If strict is non-zero, check
......
......@@ -549,7 +549,7 @@ add_pattern (COLOR_LINE **top, const char *s, int sensitive,
strfcpy(buf, NONULL(s), sizeof(buf));
mutt_check_simple (buf, sizeof (buf), NONULL(SimpleSearch));
if((tmp->color_pattern = mutt_pattern_comp (buf, M_FULL_MSG, err)) == NULL)
if((tmp->color_pattern = mutt_pattern_comp (buf, MUTT_FULL_MSG, err)) == NULL)
{
mutt_free_color_line(&tmp, 1);
return -1;
......
This diff is collapsed.
This diff is collapsed.
......@@ -466,14 +466,14 @@ static int count_delete_lines (FILE *fp, BODY *b, LOFF_T *length, size_t datelen
* hdr header of message being copied
* body structure of message being copied
* flags
* M_CM_NOHEADER don't copy header
* M_CM_PREFIX quote header and body
* M_CM_DECODE decode message body to text/plain
* M_CM_DISPLAY displaying output to the user
* M_CM_PRINTING printing the message
* M_CM_UPDATE update structures in memory after syncing
* M_CM_DECODE_PGP used for decoding PGP messages
* M_CM_CHARCONV perform character set conversion
* MUTT_CM_NOHEADER don't copy header
* MUTT_CM_PREFIX quote header and body
* MUTT_CM_DECODE decode message body to text/plain
* MUTT_CM_DISPLAY displaying output to the user
* MUTT_CM_PRINTING printing the message
* MUTT_CM_UPDATE update structures in memory after syncing
* MUTT_CM_DECODE_PGP used for decoding PGP messages
* MUTT_CM_CHARCONV perform character set conversion
* chflags flags to mutt_copy_header()
*/
......@@ -486,7 +486,7 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body,
LOFF_T new_offset = -1;
int rc = 0;