return msgend;
}
+/* move all the headers from extra not present in base into base */
+static void mutt_merge_envelopes(ENVELOPE* base, ENVELOPE** extra)
+{
+ /* copies each existing element if necessary, and sets the element
+ * to NULL in the source so that envelope_delete doesn't leave us
+ * with dangling pointers. */
+#define MOVE_ELEM(h) if (!base->h) { base->h = (*extra)->h; (*extra)->h = NULL; }
+ MOVE_ELEM(return_path);
+ MOVE_ELEM(from);
+ MOVE_ELEM(to);
+ MOVE_ELEM(cc);
+ MOVE_ELEM(bcc);
+ MOVE_ELEM(sender);
+ MOVE_ELEM(reply_to);
+ MOVE_ELEM(mail_followup_to);
+ MOVE_ELEM(list_post);
+ MOVE_ELEM(message_id);
+ MOVE_ELEM(supersedes);
+ MOVE_ELEM(date);
+ MOVE_ELEM(x_label);
+ if (!base->refs_changed) {
+ MOVE_ELEM(references);
+ }
+ if (!base->irt_changed) {
+ MOVE_ELEM(in_reply_to);
+ }
+ /* real_subj is subordinate to subject */
+ if (!base->subject) {
+ base->subject = (*extra)->subject;
+ base->real_subj = (*extra)->real_subj;
+ (*extra)->subject = NULL;
+ (*extra)->real_subj = NULL;
+ }
+ /* spam and user headers should never be hashed, and the new envelope may
+ * have better values. Use new versions regardless. */
+ mutt_buffer_free (&base->spam);
+ string_list_wipe(&base->userhdrs);
+ MOVE_ELEM(spam);
+ MOVE_ELEM(userhdrs);
+#undef MOVE_ELEM
+
+ envelope_delete(extra);
+}
+
int imap_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno)
{
IMAP_DATA *idata;
{"key_select_smime", MENU_KEY_SELECT_SMIME},
#endif
-
#ifdef MIXMASTER
{"mix", MENU_MIX},
#endif
-
{"query", MENU_QUERY},
{"generic", MENU_GENERIC},
{NULL, 0}
};
-#define mutt_check_menu(s) mutt_getvaluebyname(s, Menus)
-
static struct mapping_t KeyNames[] = {
{"<PageUp>", KEY_PPAGE},
{"<PageDown>", KEY_NPAGE},
if (q)
*q = '\0';
- if ((menu[i] = mutt_check_menu (p)) == -1) {
+ if ((menu[i] = mutt_getvaluebyname(p, Menus)) == -1) {
snprintf (err->data, err->dsize, _("%s: no such menu"), p);
goto error;
}
#include <lib-lib/lib-lib.h>
+#include <utime.h>
+
#include <lib-ui/curses.h>
#include "state.h"
return (0);
}
+/* sets mtime of 'to' to mtime of 'from' */
+static void mutt_set_mtime (const char* from, const char* to) {
+ struct utimbuf utim;
+ struct stat st;
+
+ if (stat (from, &st) != -1) {
+ utim.actime = st.st_mtime;
+ utim.modtime = st.st_mtime;
+ utime (to, &utim);
+ }
+}
+
void rfc3676_space_stuff (HEADER* hdr) {
FILE* in = NULL, *out = NULL;
char buf[LONG_STRING];
return 0;
}
-/* prepend the path part of *path to *lnk */
-void mutt_expand_link (char *newpath, const char *path, const char *lnk)
-{
- const char *lb = NULL;
- ssize_t len;
-
- /* lnk is full path */
- if (*lnk == '/') {
- m_strcpy(newpath, _POSIX_PATH_MAX, lnk);
- return;
- }
-
- if ((lb = strrchr (path, '/')) == NULL) {
- /* no path in lnk */
- m_strcpy(newpath, _POSIX_PATH_MAX, lnk);
- return;
- }
-
- len = lb - path + 1;
- memcpy (newpath, path, len);
- m_strcpy(newpath + len, _POSIX_PATH_MAX - len, lnk);
-}
-
char *mutt_expand_path (char *s, ssize_t slen)
{
return _mutt_expand_path (s, slen, 0);
return (s);
}
-/* move all the headers from extra not present in base into base */
-void mutt_merge_envelopes(ENVELOPE* base, ENVELOPE** extra)
-{
- /* copies each existing element if necessary, and sets the element
- * to NULL in the source so that envelope_delete doesn't leave us
- * with dangling pointers. */
-#define MOVE_ELEM(h) if (!base->h) { base->h = (*extra)->h; (*extra)->h = NULL; }
- MOVE_ELEM(return_path);
- MOVE_ELEM(from);
- MOVE_ELEM(to);
- MOVE_ELEM(cc);
- MOVE_ELEM(bcc);
- MOVE_ELEM(sender);
- MOVE_ELEM(reply_to);
- MOVE_ELEM(mail_followup_to);
- MOVE_ELEM(list_post);
- MOVE_ELEM(message_id);
- MOVE_ELEM(supersedes);
- MOVE_ELEM(date);
- MOVE_ELEM(x_label);
- if (!base->refs_changed) {
- MOVE_ELEM(references);
- }
- if (!base->irt_changed) {
- MOVE_ELEM(in_reply_to);
- }
- /* real_subj is subordinate to subject */
- if (!base->subject) {
- base->subject = (*extra)->subject;
- base->real_subj = (*extra)->real_subj;
- (*extra)->subject = NULL;
- (*extra)->real_subj = NULL;
- }
- /* spam and user headers should never be hashed, and the new envelope may
- * have better values. Use new versions regardless. */
- mutt_buffer_free (&base->spam);
- string_list_wipe(&base->userhdrs);
- MOVE_ELEM(spam);
- MOVE_ELEM(userhdrs);
-#undef MOVE_ELEM
-
- envelope_delete(extra);
-}
-
void mutt_mktemp (char *s)
{
return mtime;
}
-/* sets mtime of 'to' to mtime of 'from' */
-void mutt_set_mtime (const char* from, const char* to) {
- struct utimbuf utim;
- struct stat st;
-
- if (stat (from, &st) != -1) {
- utim.actime = st.st_mtime;
- utim.modtime = st.st_mtime;
- utime (to, &utim);
- }
-}
-
const char *mutt_make_version (int full)
{
static char vstring[STRING];
return 0;
}
-int mutt_cmp_header (const HEADER * h1, const HEADER * h2) {
- if (h1 && h2) {
- if (h1->received != h2->received ||
- h1->date_sent != h2->date_sent ||
- h1->content->length != h2->content->length ||
- h1->lines != h2->lines ||
- h1->zhours != h2->zhours ||
- h1->zminutes != h2->zminutes ||
- h1->zoccident != h2->zoccident ||
- h1->mime != h2->mime ||
- !mutt_cmp_env (h1->env, h2->env) ||
- !mutt_cmp_body (h1->content, h2->content))
- return (0);
- else
- return (1);
- }
- else {
- if (h1 == NULL && h2 == NULL)
- return (1);
- else
- return (0);
- }
-}
-
/* return 1 if address lists are strictly identical */
-int mutt_cmp_addr (const address_t * a, const address_t * b)
+static int mutt_cmp_addr (const address_t * a, const address_t * b)
{
while (a && b) {
if (m_strcmp(a->mailbox, b->mailbox) ||
return (1);
}
-int mutt_cmp_list (const string_list_t * a, const string_list_t * b)
+static int mutt_cmp_list (const string_list_t * a, const string_list_t * b)
{
while (a && b) {
if (m_strcmp(a->data, b->data))
return (1);
}
-int mutt_cmp_env (const ENVELOPE * e1, const ENVELOPE * e2)
+static int mutt_cmp_env (const ENVELOPE * e1, const ENVELOPE * e2)
{
if (e1 && e2) {
if (m_strcmp(e1->message_id, e2->message_id) ||
}
}
-int mutt_cmp_body (const BODY * b1, const BODY * b2)
+static int mutt_cmp_body (const BODY * b1, const BODY * b2)
{
if (b1->type != b2->type ||
b1->encoding != b2->encoding ||
return (0);
return (1);
}
+int mutt_cmp_header (const HEADER * h1, const HEADER * h2) {
+ if (h1 && h2) {
+ if (h1->received != h2->received ||
+ h1->date_sent != h2->date_sent ||
+ h1->content->length != h2->content->length ||
+ h1->lines != h2->lines ||
+ h1->zhours != h2->zhours ||
+ h1->zminutes != h2->zminutes ||
+ h1->zoccident != h2->zoccident ||
+ h1->mime != h2->mime ||
+ !mutt_cmp_env (h1->env, h2->env) ||
+ !mutt_cmp_body (h1->content, h2->content))
+ return (0);
+ else
+ return (1);
+ }
+ else {
+ if (h1 == NULL && h2 == NULL)
+ return (1);
+ else
+ return (0);
+ }
+}
+
int mutt_extract_token(BUFFER *dest, BUFFER *tok, int flags)
{
CONTENT *mutt_get_content_info (const char *fname, BODY * b);
int mutt_cmp_header (const HEADER*, const HEADER*);
-int mutt_cmp_addr (const address_t * a, const address_t * b);
-int mutt_cmp_list (const string_list_t * a, const string_list_t * b);
-int mutt_cmp_env (const ENVELOPE * e1, const ENVELOPE * e2);
-int mutt_cmp_body (const BODY * b1, const BODY * b2);
time_t mutt_decrease_mtime (const char *, struct stat *);
-void mutt_set_mtime (const char*, const char*);
int is_from (const char *, char *, ssize_t, time_t *);
const char *mutt_charset_hook (const char *);
char *mutt_expand_path (char *, ssize_t);
char *_mutt_expand_path (char *, ssize_t, int);
char *mutt_find_hook (int, const char *);
-char *mutt_gen_msgid (void);
char *mutt_get_body_charset (char *, ssize_t, BODY *);
const char *mutt_get_name (address_t *);
const char *mutt_crypt_hook (address_t *);
void mutt_enter_command (void);
void mutt_expand_file_fmt (char *, ssize_t, const char *, const char *);
void mutt_expand_fmt (char *, ssize_t, const char *, const char *);
-void mutt_expand_link (char *, const char *, const char *);
void mutt_fix_reply_recipients (ENVELOPE * env);
void mutt_folder_hook (char *);
void mutt_forward_intro (FILE * fp, HEADER * cur);
void mutt_make_misc_reply_headers (ENVELOPE * env, CONTEXT * ctx,
HEADER * cur, ENVELOPE * curenv);
void mutt_make_post_indent (CONTEXT * ctx, HEADER * cur, FILE * out);
-void mutt_merge_envelopes (ENVELOPE* base, ENVELOPE** extra);
void mutt_message_to_7bit (BODY *, FILE *);
void mutt_mktemp (char *);
int mutt_can_decode (BODY *);
int mutt_change_flag (HEADER *, int);
-int mutt_check_menu (const char *);
int mutt_check_month (const char *);
int mutt_check_overwrite (const char *, const char *, char *, ssize_t, int *,
char **);
#undef APPEND_FMT
}
-char *mutt_gen_msgid (void)
+static char *mutt_gen_msgid (void)
{
char buf[SHORT_STRING];
char localpart[SHORT_STRING];