return (NULL); /* no such alias */
}
-static ADDRESS *mutt_expand_aliases_r (ADDRESS *a, LIST **expn)
+static ADDRESS *expand_aliases_r (ADDRESS *a, LIST **expn)
{
ADDRESS *head = NULL, *last = NULL, *t, *w;
LIST *u;
{
if (mutt_strcmp (a->mailbox, u->data) == 0) /* alias already found */
{
- mutt_debug (1, "mutt_expand_aliases_r(): loop in alias found for '%s'\n",
+ mutt_debug (1, "expand_aliases_r(): loop in alias found for '%s'\n",
a->mailbox);
i = 1;
break;
u->next = *expn;
*expn = u;
w = rfc822_cpy_adr (t, 0);
- w = mutt_expand_aliases_r (w, expn);
+ w = expand_aliases_r (w, expn);
if (head)
last->next = w;
else
ADDRESS *t;
LIST *expn = NULL; /* previously expanded aliases to avoid loops */
- t = mutt_expand_aliases_r (a, &expn);
+ t = expand_aliases_r (a, &expn);
mutt_free_list (&expn);
return (mutt_remove_duplicates (t));
}
}
static FILE *
-mutt_save_attachment_open (char *path, int flags)
+save_attachment_open (char *path, int flags)
{
if (flags == MUTT_SAVE_APPEND)
return fopen (path, "a");
STATE s;
memset (&s, 0, sizeof (s));
- if ((s.fpout = mutt_save_attachment_open (path, flags)) == NULL)
+ if ((s.fpout = save_attachment_open (path, flags)) == NULL)
{
mutt_perror ("fopen");
mutt_sleep (2);
return (-1);
}
- if ((nfp = mutt_save_attachment_open (path, flags)) == NULL)
+ if ((nfp = save_attachment_open (path, flags)) == NULL)
{
mutt_perror ("fopen");
safe_fclose (&ofp);
}
#endif
-/* Public function
- *
+/*
* This function takes a menu and a state and defines the current
* entry that should be highlighted.
*/
-static void mutt_browser_highlight_default (struct browser_state *state, MUTTMENU *menu)
+static void browser_highlight_default (struct browser_state *state, MUTTMENU *menu)
{
menu->top = 0;
/* Reset menu position to 1.
}
}
if (!matched)
- mutt_browser_highlight_default(state, menu);
+ browser_highlight_default(state, menu);
}
else
- mutt_browser_highlight_default(state, menu);
+ browser_highlight_default(state, menu);
menu->redraw = REDRAW_FULL;
}
goto bail;
}
}
- mutt_browser_highlight_default (&state, menu);
+ browser_highlight_default (&state, menu);
init_menu (&state, menu, title, sizeof (title), buffy);
if (GotoSwapper[0])
GotoSwapper[0] = '\0';
imap_browse (LastDir, &state);
browser_sort (&state);
menu->data = state.entry;
- mutt_browser_highlight_default (&state, menu);
+ browser_highlight_default (&state, menu);
init_menu (&state, menu, title, sizeof (title), buffy);
MAYBE_REDRAW (menu->redraw);
}
imap_browse (LastDir, &state);
browser_sort (&state);
menu->data = state.entry;
- mutt_browser_highlight_default (&state, menu);
+ browser_highlight_default (&state, menu);
init_menu (&state, menu, title, sizeof (title), buffy);
MAYBE_REDRAW (menu->redraw);
}
imap_browse (LastDir, &state);
browser_sort (&state);
menu->data = state.entry;
- mutt_browser_highlight_default (&state, menu);
+ browser_highlight_default (&state, menu);
init_menu (&state, menu, title, sizeof (title), buffy);
}
else
goto bail;
}
}
- mutt_browser_highlight_default (&state, menu);
+ browser_highlight_default (&state, menu);
init_menu (&state, menu, title, sizeof (title), buffy);
}
else
{
BrowserSort |= reverse ? SORT_REVERSE : 0;
browser_sort (&state);
- mutt_browser_highlight_default (&state, menu);
+ browser_highlight_default (&state, menu);
menu->redraw = REDRAW_FULL;
}
break;
#define COLOR_QUOTE_INIT 8
-static COLOR_LINE *mutt_new_color_line (void)
+static COLOR_LINE *new_color_line (void)
{
COLOR_LINE *p = safe_calloc (1, sizeof (COLOR_LINE));
return (p);
}
-static void mutt_free_color_line(COLOR_LINE **l,
+static void free_color_line(COLOR_LINE **l,
int free_colors)
{
COLOR_LINE *tmp;
#endif
-void
-mutt_do_uncolor (BUFFER *buf, BUFFER *s, COLOR_LINE **ColorList,
+static void
+do_uncolor (BUFFER *buf, BUFFER *s, COLOR_LINE **ColorList,
int *do_cache, int parse_uncolor)
{
COLOR_LINE *tmp, *last = NULL;
}
last = tmp;
tmp = tmp->next;
- mutt_free_color_line (&last, parse_uncolor);
+ free_color_line (&last, parse_uncolor);
}
*ColorList = NULL;
}
{
*ColorList = tmp->next;
}
- mutt_free_color_line (&tmp, parse_uncolor);
+ free_color_line (&tmp, parse_uncolor);
break;
}
}
}
if (object == MT_COLOR_BODY)
- mutt_do_uncolor (buf, s, &ColorBodyList, &do_cache, parse_uncolor);
+ do_uncolor (buf, s, &ColorBodyList, &do_cache, parse_uncolor);
else if (object == MT_COLOR_HEADER)
- mutt_do_uncolor (buf, s, &ColorHdrList, &do_cache, parse_uncolor);
+ do_uncolor (buf, s, &ColorHdrList, &do_cache, parse_uncolor);
else if (object == MT_COLOR_ATTACH_HEADERS)
- mutt_do_uncolor (buf, s, &ColorAttachList, &do_cache, parse_uncolor);
+ do_uncolor (buf, s, &ColorAttachList, &do_cache, parse_uncolor);
else if (object == MT_COLOR_INDEX)
- mutt_do_uncolor (buf, s, &ColorIndexList, &do_cache, parse_uncolor);
+ do_uncolor (buf, s, &ColorIndexList, &do_cache, parse_uncolor);
else if (object == MT_COLOR_INDEX_AUTHOR)
- mutt_do_uncolor (buf, s, &ColorIndexAuthorList, &do_cache, parse_uncolor);
+ do_uncolor (buf, s, &ColorIndexAuthorList, &do_cache, parse_uncolor);
else if (object == MT_COLOR_INDEX_FLAGS)
- mutt_do_uncolor (buf, s, &ColorIndexFlagsList, &do_cache, parse_uncolor);
+ do_uncolor (buf, s, &ColorIndexFlagsList, &do_cache, parse_uncolor);
else if (object == MT_COLOR_INDEX_SUBJECT)
- mutt_do_uncolor (buf, s, &ColorIndexSubjectList, &do_cache, parse_uncolor);
+ do_uncolor (buf, s, &ColorIndexSubjectList, &do_cache, parse_uncolor);
#ifdef USE_NOTMUCH
else if (object == MT_COLOR_INDEX_TAG)
- mutt_do_uncolor(buf, s, &ColorIndexTagList, &do_cache, parse_uncolor);
+ do_uncolor(buf, s, &ColorIndexTagList, &do_cache, parse_uncolor);
#endif
if (do_cache && !option (OPTNOCURSES))
int r;
char buf[LONG_STRING];
- tmp = mutt_new_color_line ();
+ tmp = new_color_line ();
if (is_index)
{
int i;
mutt_check_simple (buf, sizeof (buf), NONULL(SimpleSearch));
if((tmp->color_pattern = mutt_pattern_comp (buf, MUTT_FULL_MSG, err)) == NULL)
{
- mutt_free_color_line(&tmp, 1);
+ free_color_line(&tmp, 1);
return -1;
}
/* force re-caching of index colors */
else if ((r = REGCOMP (&tmp->rx, s, (sensitive ? mutt_which_case (s) : REG_ICASE))) != 0)
{
regerror (r, &tmp->rx, err->data, err->dsize);
- mutt_free_color_line(&tmp, 1);
+ free_color_line(&tmp, 1);
return (-1);
}
tmp->next = *top;
}
/**
- * mutt_free_compress_info - Frees the compress info members and structure.
+ * free_compress_info - Frees the compress info members and structure.
* @ctx: Mailbox to free compress_info for.
*/
static void
-mutt_free_compress_info (CONTEXT *ctx)
+free_compress_info (CONTEXT *ctx)
{
COMPRESS_INFO *ci;
or_fail:
/* remove the partial uncompressed file */
remove (ctx->path);
- mutt_free_compress_info (ctx);
+ free_compress_info (ctx);
return -1;
}
remove (ctx->path);
oa_fail1:
/* Free the compress_info to prevent close from trying to recompress */
- mutt_free_compress_info (ctx);
+ free_compress_info (ctx);
return -1;
}
struct mx_ops *ops = ci->child_ops;
if (!ops)
{
- mutt_free_compress_info (ctx);
+ free_compress_info (ctx);
return -1;
}
unlock_realpath (ctx);
}
- mutt_free_compress_info (ctx);
+ free_compress_info (ctx);
return 0;
}
* the number of character cells when printed.
*/
-static void mutt_format_s_x (char *dest,
+static void format_s_x (char *dest,
size_t destlen,
const char *prefix,
const char *s,
const char *prefix,
const char *s)
{
- mutt_format_s_x (dest, destlen, prefix, s, 0);
+ format_s_x (dest, destlen, prefix, s, 0);
}
void mutt_format_s_tree (char *dest,
const char *prefix,
const char *s)
{
- mutt_format_s_x (dest, destlen, prefix, s, 1);
+ format_s_x (dest, destlen, prefix, s, 1);
}
/*
return p;
}
-static void mutt_group_remove (group_t *g)
+static void group_remove (group_t *g)
{
if (!g)
return;
group_context_t *t;
for ( ; ctx && *ctx; (*ctx) = t)
{
- mutt_group_remove ((*ctx)->g);
+ group_remove ((*ctx)->g);
t = (*ctx)->next;
FREE(ctx); /* __FREE_CHECKED__ */
}
}
}
-static void mutt_group_add_adrlist (group_t *g, ADDRESS *a)
+static void group_add_adrlist (group_t *g, ADDRESS *a)
{
ADDRESS **p, *q;
*p = q;
}
-static int mutt_group_remove_adrlist (group_t *g, ADDRESS *a)
+static int group_remove_adrlist (group_t *g, ADDRESS *a)
{
ADDRESS *p;
return 0;
}
-static int mutt_group_add_rx (group_t *g, const char *s, int flags, BUFFER *err)
+static int group_add_rx (group_t *g, const char *s, int flags, BUFFER *err)
{
return mutt_add_to_rx_list (&g->rs, s, flags, err);
}
-static int mutt_group_remove_rx (group_t *g, const char *s)
+static int group_remove_rx (group_t *g, const char *s)
{
return mutt_remove_from_rx_list (&g->rs, s);
}
void mutt_group_context_add_adrlist (group_context_t *ctx, ADDRESS *a)
{
for (; ctx; ctx = ctx->next)
- mutt_group_add_adrlist (ctx->g, a);
+ group_add_adrlist (ctx->g, a);
}
int mutt_group_context_remove_adrlist (group_context_t *ctx, ADDRESS * a)
for (; (!rv) && ctx; ctx = ctx->next)
{
- rv = mutt_group_remove_adrlist (ctx->g, a);
+ rv = group_remove_adrlist (ctx->g, a);
if (empty_group (ctx->g))
- mutt_group_remove (ctx->g);
+ group_remove (ctx->g);
}
return rv;
int rv = 0;
for (; (!rv) && ctx; ctx = ctx->next)
- rv = mutt_group_add_rx (ctx->g, s, flags, err);
+ rv = group_add_rx (ctx->g, s, flags, err);
return rv;
}
for (; (!rv) && ctx; ctx = ctx->next)
{
- rv = mutt_group_remove_rx (ctx->g, s);
+ rv = group_remove_rx (ctx->g, s);
if (empty_group (ctx->g))
- mutt_group_remove (ctx->g);
+ group_remove (ctx->g);
}
return rv;
fwrite (d, dlen, 1, s->fpout);
}
-static void mutt_convert_to_state(iconv_t cd, char *bufi, size_t *l, STATE *s)
+static void convert_to_state(iconv_t cd, char *bufi, size_t *l, STATE *s)
{
char bufo[BUFO_SIZE];
ICONV_CONST char *ib;
*l = ibl;
}
-static void mutt_decode_xbit (STATE *s, long len, int istext, iconv_t cd)
+static void decode_xbit (STATE *s, long len, int istext, iconv_t cd)
{
int c, ch;
char bufi[BUFI_SIZE];
bufi[l++] = c;
if (l == sizeof (bufi))
- mutt_convert_to_state (cd, bufi, &l, s);
+ convert_to_state (cd, bufi, &l, s);
}
- mutt_convert_to_state (cd, bufi, &l, s);
- mutt_convert_to_state (cd, 0, 0, s);
+ convert_to_state (cd, bufi, &l, s);
+ convert_to_state (cd, 0, 0, s);
state_reset_prefix (s);
}
* result of qp_decode_line.
*
* Finally, at soft line breaks, some part of a multibyte character
- * may have been left over by mutt_convert_to_state(). This shouldn't
+ * may have been left over by convert_to_state(). This shouldn't
* be more than 6 characters, so STRING + 7 should be sufficient
* memory to store the decoded data.
*
*
*/
-static void mutt_decode_quoted (STATE *s, long len, int istext, iconv_t cd)
+static void decode_quoted (STATE *s, long len, int istext, iconv_t cd)
{
char line[STRING];
char decline[2*STRING];
/* decode and do character set conversion */
qp_decode_line (decline + l, line, &l3, last);
l += l3;
- mutt_convert_to_state (cd, decline, &l, s);
+ convert_to_state (cd, decline, &l, s);
}
- mutt_convert_to_state (cd, 0, 0, s);
+ convert_to_state (cd, 0, 0, s);
state_reset_prefix(s);
}
bufi[l++] = ch;
if (l + 8 >= sizeof (bufi))
- mutt_convert_to_state (cd, bufi, &l, s);
+ convert_to_state (cd, bufi, &l, s);
}
if (cr) bufi[l++] = '\r';
- mutt_convert_to_state (cd, bufi, &l, s);
- mutt_convert_to_state (cd, 0, 0, s);
+ convert_to_state (cd, bufi, &l, s);
+ convert_to_state (cd, 0, 0, s);
state_reset_prefix(s);
}
return ch - 32;
}
-static void mutt_decode_uuencoded (STATE *s, long len, int istext, iconv_t cd)
+static void decode_uuencoded (STATE *s, long len, int istext, iconv_t cd)
{
char tmps[SHORT_STRING];
char linelen, c, l, out;
if (c == linelen)
break;
}
- mutt_convert_to_state (cd, bufi, &k, s);
+ convert_to_state (cd, bufi, &k, s);
pt++;
}
}
- mutt_convert_to_state (cd, bufi, &k, s);
- mutt_convert_to_state (cd, 0, 0, s);
+ convert_to_state (cd, bufi, &k, s);
+ convert_to_state (cd, 0, 0, s);
state_reset_prefix(s);
}
*
* 0 otherwise
*/
-static int mutt_is_autoview (BODY *b)
+static int is_autoview (BODY *b)
{
char type[SHORT_STRING];
- int is_autoview = 0;
+ int is_av = 0;
snprintf (type, sizeof (type), "%s/%s", TYPE (b), b->subtype);
if (option(OPTIMPLICITAUTOVIEW))
{
/* $implicit_autoview is essentially the same as "auto_view *" */
- is_autoview = 1;
+ is_av = 1;
}
else
{
if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' &&
ascii_strncasecmp (type, t->data, i) == 0) ||
ascii_strcasecmp (type, t->data) == 0)
- is_autoview = 1;
+ is_av = 1;
}
if (is_mmnoask (type))
- is_autoview = 1;
+ is_av = 1;
}
/* determine if there is a mailcap entry suitable for auto_view
*
* WARNING: type is altered by this call as a result of `mime_lookup' support */
- if (is_autoview)
+ if (is_av)
return rfc1524_mailcap_lookup(b, type, NULL, MUTT_AUTOVIEW);
return 0;
b = a;
while (b)
{
- if (mutt_is_autoview (b))
+ if (is_autoview (b))
choice = b;
b = b->next;
}
/* returns 1 if decoding the attachment will produce output */
int mutt_can_decode (BODY *a)
{
- if (mutt_is_autoview (a))
+ if (is_autoview (a))
return 1;
else if (a->type == TYPETEXT)
return (1);
switch (b->encoding)
{
case ENCQUOTEDPRINTABLE:
- mutt_decode_quoted (s, b->length, istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b)), cd);
+ decode_quoted (s, b->length, istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b)), cd);
break;
case ENCBASE64:
mutt_decode_base64 (s, b->length, istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b)), cd);
break;
case ENCUUENCODED:
- mutt_decode_uuencoded (s, b->length, istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b)), cd);
+ decode_uuencoded (s, b->length, istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b)), cd);
break;
default:
- mutt_decode_xbit (s, b->length, istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b)), cd);
+ decode_xbit (s, b->length, istext || ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b)), cd);
break;
}
/* first determine which handler to use to process this part */
- if (mutt_is_autoview (b))
+ if (is_autoview (b))
{
handler = autoview_handler;
s->flags &= ~MUTT_CHARCONV;
}
/**
- * mutt_hcache_per_folder - Generate the hcache pathname
+ * hcache_per_folder - Generate the hcache pathname
* @param path Base directory, from $header_cache
* @param folder Mailbox name (including protocol)
* @param namer Callback to generate database filename
* If ICONV isn't being used, then a suffix is added to the path, e.g. '-utf-8'.
* Otherise @path is assumed to be a file.
*/
-static const char *mutt_hcache_per_folder(const char *path, const char *folder,
+static const char *hcache_per_folder(const char *path, const char *folder,
hcache_namer_t namer)
{
static char hcpath[_POSIX_PATH_MAX];
* db_store.
*/
static void *
-mutt_hcache_dump(header_cache_t *h, HEADER * header, int *off,
+hcache_dump(header_cache_t *h, HEADER * header, int *off,
unsigned int uidvalidity)
{
unsigned char *d = NULL;
return NULL;
}
- path = mutt_hcache_per_folder(path, h->folder, namer);
+ path = hcache_per_folder(path, h->folder, namer);
h->ctx = ops->open(path);
if (h->ctx)
if (!h)
return -1;
- data = mutt_hcache_dump(h, header, &dlen, uidvalidity);
+ data = hcache_dump(h, header, &dlen, uidvalidity);
ret = mutt_hcache_store_raw (h, key, keylen, data, dlen);
FREE(&data);
* 4: user is originator
* 5: sent to a subscribed mailinglist
*/
-static int mutt_user_is_recipient (HEADER *h)
+static int user_is_recipient (HEADER *h)
{
if (!h || !h->env)
return 0;
case 'T':
snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
snprintf (dest, destlen, fmt,
- (Tochars && ((i = mutt_user_is_recipient (hdr))) < Tochars->len) ? Tochars->chars[i] : " ");
+ (Tochars && ((i = user_is_recipient (hdr))) < Tochars->len) ? Tochars->chars[i] : " ");
break;
case 'u':
else if (hdr->flagged)
third = get_nth_wchar (Flagchars, FlagCharImportant);
else
- third = get_nth_wchar (Tochars, mutt_user_is_recipient (hdr));
+ third = get_nth_wchar (Tochars, user_is_recipient (hdr));
snprintf (buf2, sizeof (buf2), "%s%s%s", first, second, third);
}
}
static int
-mutt_addr_hook (char *path, size_t pathlen, int type, CONTEXT *ctx, HEADER *hdr)
+addr_hook (char *path, size_t pathlen, int type, CONTEXT *ctx, HEADER *hdr)
{
HOOK *hook;
pattern_cache_t cache;
void mutt_default_save (char *path, size_t pathlen, HEADER *hdr)
{
*path = 0;
- if (mutt_addr_hook (path, pathlen, MUTT_SAVEHOOK, Context, hdr) != 0)
+ if (addr_hook (path, pathlen, MUTT_SAVEHOOK, Context, hdr) != 0)
{
char tmp[_POSIX_PATH_MAX];
ADDRESS *adr;
char buf[_POSIX_PATH_MAX];
ENVELOPE *env = hdr->env;
- if (mutt_addr_hook (path, pathlen, MUTT_FCCHOOK, NULL, hdr) != 0)
+ if (addr_hook (path, pathlen, MUTT_FCCHOOK, NULL, hdr) != 0)
{
if ((option (OPTSAVENAME) || option (OPTFORCENAME)) &&
(env->to || env->cc || env->bcc))
}
#endif
-static void mutt_free_opt (struct option_t* p)
+static void free_opt (struct option_t* p)
{
REGEXP* pp;
int i;
for (i = 0; MuttVars[i].option; i++)
- mutt_free_opt (MuttVars + i);
+ free_opt (MuttVars + i);
mutt_free_rx_list (&Alternates);
mutt_free_rx_list (&UnAlternates);
}
}
+static RX_LIST *new_rx_list(void)
+{
+ return safe_calloc (1, sizeof (RX_LIST));
+}
+
int mutt_add_to_rx_list (RX_LIST **list, const char *s, int flags, BUFFER *err)
{
RX_LIST *t, *last = NULL;
if (!*list || last)
{
- t = mutt_new_rx_list();
+ t = new_rx_list();
t->rx = rx;
if (last)
{
return nremoved;
}
+static REPLACE_LIST *new_replace_list(void)
+{
+ return safe_calloc (1, sizeof (REPLACE_LIST));
+}
+
static int add_to_replace_list (REPLACE_LIST **list, const char *pat, const char *templ, BUFFER *err)
{
REPLACE_LIST *t = NULL, *last = NULL;
*/
if (!t)
{
- t = mutt_new_replace_list();
+ t = new_replace_list();
t->rx = rx;
rx = NULL;
if (last)
}
}
-static void mutt_restore_default (struct option_t *p)
+static void restore_default (struct option_t *p)
{
switch (p->type & DT_MASK)
{
{
char msgbuf[STRING];
regerror (retval, pp->rx, msgbuf, sizeof (msgbuf));
- fprintf (stderr, _("mutt_restore_default(%s): error in regexp: %s\n"),
+ fprintf (stderr, _("restore_default(%s): error in regexp: %s\n"),
p->option, pp->pattern);
fprintf (stderr, "%s\n", msgbuf);
mutt_sleep (0);
return (-1);
}
for (idx = 0; MuttVars[idx].option; idx++)
- mutt_restore_default (&MuttVars[idx]);
+ restore_default (&MuttVars[idx]);
set_option (OPTFORCEREDRAWINDEX);
set_option (OPTFORCEREDRAWPAGER);
set_option (OPTSORTSUBTHREADS);
if (myvar)
myvar_del (myvar);
else
- mutt_restore_default (&MuttVars[idx]);
+ restore_default (&MuttVars[idx]);
}
}
else if (!myvar && DTYPE (MuttVars[idx].type) == DT_BOOL)
}
#endif
-static int mutt_execute_commands (LIST *p)
+static int execute_commands (LIST *p)
{
BUFFER err, token;
return 0;
}
-static char* mutt_find_cfg (const char *home, const char *xdg_cfg_home)
+static char* find_cfg (const char *home, const char *xdg_cfg_home)
{
const char* names[] =
{
for (i = 0; MuttVars[i].option; i++)
{
set_default (&MuttVars[i]);
- mutt_restore_default (&MuttVars[i]);
+ restore_default (&MuttVars[i]);
}
CurrentMenu = MENU_MAIN;
xdg_cfg_home = buffer;
}
- char *config = mutt_find_cfg (Homedir, xdg_cfg_home);
+ char *config = find_cfg (Homedir, xdg_cfg_home);
if (config)
{
Muttrc = mutt_add_list (Muttrc, config);
}
}
- if (mutt_execute_commands (commands) != 0)
+ if (execute_commands (commands) != 0)
need_pause = 1;
if (need_pause && !option (OPTNOCURSES))
/* Create a temporary directory next to a file name */
-static int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen,
+static int mkwrapdir (const char *path, char *newfile, size_t nflen,
char *newdir, size_t ndlen)
{
const char *basename;
snprintf (newdir, ndlen, "%s/%s", parent, ".muttXXXXXX");
if (mkdtemp(newdir) == NULL)
{
- mutt_debug (1, "mutt_mkwrapdir: mkdtemp() failed\n");
+ mutt_debug (1, "mkwrapdir: mkdtemp() failed\n");
return -1;
}
if (snprintf (newfile, nflen, "%s/%s", newdir, NONULL(basename)) >= nflen)
{
rmdir(newdir);
- mutt_debug (1, "mutt_mkwrapdir: string was truncated\n");
+ mutt_debug (1, "mkwrapdir: string was truncated\n");
return -1;
}
return 0;
return rc;
}
-static int mutt_put_file_in_place (const char *path, const char *safe_file, const char *safe_dir)
+static int put_file_in_place (const char *path, const char *safe_file, const char *safe_dir)
{
int rv;
char safe_file[_POSIX_PATH_MAX];
char safe_dir[_POSIX_PATH_MAX];
- if (mutt_mkwrapdir (path, safe_file, sizeof (safe_file),
+ if (mkwrapdir (path, safe_file, sizeof (safe_file),
safe_dir, sizeof (safe_dir)) == -1)
return -1;
/* NFS and I believe cygwin do not handle movement of open files well */
close (fd);
- if (mutt_put_file_in_place (path, safe_file, safe_dir) == -1)
+ if (put_file_in_place (path, safe_file, safe_dir) == -1)
return -1;
}
exit (code);
}
-static void mutt_usage (void)
+static void usage (void)
{
puts (mutt_make_version ());
break;
default:
- mutt_usage ();
+ usage ();
}
}
}
}
-static int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint)
+static int reopen_mailbox (CONTEXT *ctx, int *index_hint)
{
int (*cmp_headers) (const HEADER *, const HEADER *) = NULL;
HEADER **old_hdrs;
if (modified)
{
- if (mutt_reopen_mailbox (ctx, index_hint) != -1)
+ if (reopen_mailbox (ctx, index_hint) != -1)
{
if (unlock)
{
return safe_calloc (1, sizeof (LIST));
}
-static inline RX_LIST *mutt_new_rx_list()
-{
- return safe_calloc (1, sizeof (RX_LIST));
-}
-
-static inline REPLACE_LIST *mutt_new_replace_list()
-{
- return safe_calloc (1, sizeof (REPLACE_LIST));
-}
-
void mutt_free_list(LIST **list);
void mutt_free_rx_list(RX_LIST **list);
void mutt_free_replace_list(REPLACE_LIST **list);
/* not reached */
}
-static LIST *mutt_parse_references (char *s, int in_reply_to)
+static LIST *parse_references (char *s, int in_reply_to)
{
LIST *t, *lst = NULL;
char *m;
if (!ascii_strcasecmp (line+1, "n-reply-to"))
{
mutt_free_list (&e->in_reply_to);
- e->in_reply_to = mutt_parse_references (p, 1);
+ e->in_reply_to = parse_references (p, 1);
matched = 1;
}
break;
if (!ascii_strcasecmp (line + 1, "eferences"))
{
mutt_free_list (&e->references);
- e->references = mutt_parse_references (p, 0);
+ e->references = parse_references (p, 0);
matched = 1;
}
else if (!ascii_strcasecmp (line + 1, "eply-to"))
dst[l + 2] = 0;
}
-static int mutt_query_save_attachment (FILE *fp, BODY *body, HEADER *hdr, char **directory)
+static int query_save_attachment (FILE *fp, BODY *body, HEADER *hdr, char **directory)
{
char *prompt;
char buf[_POSIX_PATH_MAX], tfile[_POSIX_PATH_MAX];
menu_redraw (menu);
}
- if (mutt_query_save_attachment (fp, top, hdr, &directory) == -1)
+ if (query_save_attachment (fp, top, hdr, &directory) == -1)
break;
}
}
}
static void
-mutt_query_pipe_attachment (char *command, FILE *fp, BODY *body, int filter)
+query_pipe_attachment (char *command, FILE *fp, BODY *body, int filter)
{
char tfile[_POSIX_PATH_MAX];
char warning[STRING+_POSIX_PATH_MAX];
if (!filter && !option (OPTATTACHSPLIT))
pipe_attachment (fp, top, state);
else
- mutt_query_pipe_attachment (command, fp, top, filter);
+ query_pipe_attachment (command, fp, top, filter);
}
else if (top->parts)
pipe_attachment_list (command, fp, tag, top->parts, filter, state);
}
static void
-mutt_update_attach_index (BODY *cur, ATTACHPTR ***idxp,
+update_attach_index (BODY *cur, ATTACHPTR ***idxp,
short *idxlen, short *idxmax,
MUTTMENU *menu)
{
mutt_edit_content_type (hdr, idx[menu->current]->content, fp);
if (idxmax)
{
- mutt_update_attach_index (cur, idxp, idxlen, idxmax, menu);
+ update_attach_index (cur, idxp, idxlen, idxmax, menu);
idx = *idxp;
}
op = OP_VIEW_ATTACH;
mutt_attach_init (cur);
attach_collapse (cur, 0, 1, 0);
- mutt_update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
+ update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
while (true)
{
attach_collapse (idx[menu->current]->content, 1, 0, 1);
else
attach_collapse (idx[menu->current]->content, 0, 1, 1);
- mutt_update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
+ update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
break;
case OP_FORGET_PASSPHRASE:
case OP_EDIT_TYPE:
mutt_edit_content_type (hdr, idx[menu->current]->content, fp);
- mutt_update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
+ update_attach_index (cur, &idx, &idxlen, &idxmax, menu);
break;
case OP_EXIT:
}
/* compare two e-mail addresses and return 1 if they are equivalent */
-static int mutt_addrcmp (ADDRESS *a, ADDRESS *b)
+static int addrcmp (ADDRESS *a, ADDRESS *b)
{
if (!a->mailbox || !b->mailbox)
return 0;
}
/* search an e-mail address in a list */
-static int mutt_addrsrc (ADDRESS *a, ADDRESS *lst)
+static int addrsrc (ADDRESS *a, ADDRESS *lst)
{
for (; lst; lst = lst->next)
{
- if (mutt_addrcmp (a, lst))
+ if (addrcmp (a, lst))
return (1);
}
return (0);
{
for (p = a; p; p = p->next)
{
- if (mutt_addrcmp (p, b))
+ if (addrcmp (p, b))
break;
}
if (p)
}
else if (env->reply_to)
{
- if ((mutt_addrcmp (env->from, env->reply_to) && !env->reply_to->next &&
+ if ((addrcmp (env->from, env->reply_to) && !env->reply_to->next &&
!env->reply_to->personal) ||
(option (OPTIGNORELISTREPLYTO) &&
mutt_is_mail_list (env->reply_to) &&
- (mutt_addrsrc (env->reply_to, env->to) ||
- mutt_addrsrc (env->reply_to, env->cc))))
+ (addrsrc (env->reply_to, env->to) ||
+ addrsrc (env->reply_to, env->cc))))
{
/* If the Reply-To: address is a mailing list, assume that it was
* put there by the mailing list, and use the From: address
*/
rfc822_append (to, env->from, 0);
}
- else if (!(mutt_addrcmp (env->from, env->reply_to) &&
+ else if (!(addrcmp (env->from, env->reply_to) &&
!env->reply_to->next) &&
quadoption (OPT_REPLYTO) != MUTT_YES)
{
return 0;
}
-static LIST *mutt_make_references(ENVELOPE *e)
+static LIST *make_references(ENVELOPE *e)
{
LIST *t = NULL, *l = NULL;
while (*p) p = &(*p)->next;
while (*q) q = &(*q)->next;
- *p = mutt_make_references (curenv);
+ *p = make_references (curenv);
if (curenv->message_id)
{
}
static void
-mutt_make_reference_headers (ENVELOPE *curenv, ENVELOPE *env, CONTEXT *ctx)
+make_reference_headers (ENVELOPE *curenv, ENVELOPE *env, CONTEXT *ctx)
{
env->references = NULL;
env->in_reply_to = NULL;
}
mutt_make_misc_reply_headers (env, ctx, cur, curenv);
- mutt_make_reference_headers (tag ? NULL : curenv, env, ctx);
+ make_reference_headers (tag ? NULL : curenv, env, ctx);
}
else if (flags & SENDFORWARD)
{
mutt_make_forward_subject (env, ctx, cur);
if (option (OPTFORWREF))
- mutt_make_reference_headers (tag ? NULL : curenv, env, ctx);
+ make_reference_headers (tag ? NULL : curenv, env, ctx);
}
return (0);
return c;
}
-int
-static mutt_search_attach_keyword (char *filename)
+static int
+mutt_search_attach_keyword (char *filename)
{
/* Search for the regex in AttachKeyword within a file */
if (!AttachKeyword.rx)
}
/* determine which Content-Transfer-Encoding to use */
-static void mutt_set_encoding (BODY *b, CONTENT *info)
+static void set_encoding (BODY *b, CONTENT *info)
{
char send_charset[SHORT_STRING];
if ((info = mutt_get_content_info (a->filename, a)) == NULL)
return;
- mutt_set_encoding (a, info);
+ set_encoding (a, info);
mutt_stamp_attachment(a);
FREE (&a->content);
}
/* check for duplicate boundary. return 1 if duplicate */
-static int mutt_check_boundary (const char* boundary, BODY *b)
+static int check_boundary (const char* boundary, BODY *b)
{
char* p;
- if (b->parts && mutt_check_boundary (boundary, b->parts))
+ if (b->parts && check_boundary (boundary, b->parts))
return 1;
- if (b->next && mutt_check_boundary (boundary, b->next))
+ if (b->next && check_boundary (boundary, b->next))
return 1;
if ((p = mutt_get_parameter ("boundary", b->parameter))
do
{
mutt_generate_boundary (&new->parameter);
- if (mutt_check_boundary (mutt_get_parameter ("boundary", new->parameter),
+ if (check_boundary (mutt_get_parameter ("boundary", new->parameter),
b))
mutt_delete_parameter ("boundary", &new->parameter);
}
return p;
}
-static char *mutt_gen_msgid (void)
+static char *gen_msgid (void)
{
char buf[SHORT_STRING];
time_t now;
mutt_set_followup_to (env);
if (!env->message_id)
- env->message_id = mutt_gen_msgid ();
+ env->message_id = gen_msgid ();
}
/* Take care of 8-bit => 7-bit conversion. */
fseeko (fp, h->offset, 0);
fprintf (f, "Resent-From: %s", resent_from);
fprintf (f, "\nResent-%s", mutt_make_date (date, sizeof(date)));
- msgid_str = mutt_gen_msgid();
+ msgid_str = gen_msgid();
fprintf (f, "Resent-Message-ID: %s\n", msgid_str);
fputs ("Resent-To: ", f);
mutt_write_address_list (to, f, 11, 0);
-static void mutt_smime_command (char *d, size_t dlen,
+static void smime_command (char *d, size_t dlen,
struct smime_command_context *cctx, const char *fmt)
{
mutt_FormatString (d, dlen, 0, MuttIndexWindow->cols, NONULL(fmt), _mutt_fmt_smime_command,
(unsigned long) cctx, 0);
- mutt_debug (2, "mutt_smime_command: %s\n", d);
+ mutt_debug (2, "smime_command: %s\n", d);
}
cctx.certificates = certificates;
cctx.intermediates = intermediates;
- mutt_smime_command (cmd, sizeof (cmd), &cctx, format);
+ smime_command (cmd, sizeof (cmd), &cctx, format);
return mutt_create_filter_fd (cmd, smimein, smimeout, smimeerr,
smimeinfd, smimeoutfd, smimeerrfd);
*new = cur;
}
-static HASH *mutt_make_subj_hash (CONTEXT *ctx)
+static HASH *make_subj_hash (CONTEXT *ctx)
{
int i;
HEADER *hdr;
THREAD *tmp, *cur, *parent, *curchild, *nextchild;
if (!ctx->subj_hash)
- ctx->subj_hash = mutt_make_subj_hash (ctx);
+ ctx->subj_hash = make_subj_hash (ctx);
while (tree)
{