LIBEMAIL= libemail.a
LIBEMAILOBJS= email/address.o email/attach.o email/body.o \
email/email_globals.o email/envelope.o email/from.o \
- email/header.o email/idna.o email/mime.o email/parameter.o \
+ email/email.o email/idna.o email/mime.o email/parameter.o \
email/parse.o email/rfc2047.o email/rfc2231.o email/tags.o \
email/thread.o email/url.o
CLEANFILES+= $(LIBEMAIL) $(LIBEMAILOBJS)
hcache/hcversion.h: $(SRCDIR)/email/address.h \
$(SRCDIR)/email/body.h \
+ $(SRCDIR)/email/email.h \
$(SRCDIR)/email/envelope.h \
- $(SRCDIR)/email/header.h \
$(SRCDIR)/email/parameter.h \
$(SRCDIR)/mutt/buffer.h \
$(SRCDIR)/mutt/list.h \
( echo '#include "config.h"'; \
echo '#include "email/address.h"'; \
echo '#include "email/body.h"'; \
+ echo '#include "email/email.h"'; \
echo '#include "email/envelope.h"'; \
- echo '#include "email/header.h"'; \
echo '#include "email/parameter.h"'; \
echo '#include "mutt/buffer.h"'; \
echo '#include "mutt/list.h"';) | $(CPP) $(CFLAGS) - | \
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_display_message(struct Header *cur)
+int mutt_display_message(struct Email *cur)
{
char tempfile[PATH_MAX], buf[LONG_STRING];
int rc = 0;
* ci_bounce_message - Bounce an email
* @param h Header of email to bounce
*/
-void ci_bounce_message(struct Header *h)
+void ci_bounce_message(struct Email *h)
{
char prompt[SHORT_STRING];
char scratch[SHORT_STRING];
* @param decode If true, decode the message
* @param print If true, message is for printing
*/
-static void pipe_msg(struct Header *h, FILE *fp, bool decode, bool print)
+static void pipe_msg(struct Email *h, FILE *fp, bool decode, bool print)
{
int cmflags = 0;
int chflags = CH_FROM;
*
* The following code is shared between printing and piping.
*/
-static int pipe_message(struct Header *h, char *cmd, bool decode, bool print,
+static int pipe_message(struct Email *h, char *cmd, bool decode, bool print,
bool split, const char *sep)
{
int rc = 0;
* mutt_pipe_message - Pipe a message
* @param h Header of message to pipe
*/
-void mutt_pipe_message(struct Header *h)
+void mutt_pipe_message(struct Email *h)
{
char buffer[LONG_STRING];
* mutt_print_message - Print a message
* @param h Header of message to print
*/
-void mutt_print_message(struct Header *h)
+void mutt_print_message(struct Email *h)
{
int i;
int msgcount; // for L10N with ngettext
* @param[out] cmflags Copy message flags, e.g. MUTT_CM_DECODE
* @param[out] chflags Copy header flags, e.g. CH_DECODE
*/
-static void set_copy_flags(struct Header *hdr, bool decode, bool decrypt,
+static void set_copy_flags(struct Email *hdr, bool decode, bool decrypt,
int *cmflags, int *chflags)
{
*cmflags = 0;
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_save_message_ctx(struct Header *h, bool delete, bool decode,
+int mutt_save_message_ctx(struct Email *h, bool delete, bool decode,
bool decrypt, struct Context *ctx)
{
int cmflags, chflags;
* @retval 0 Copy/save was successful
* @retval -1 Error/abort
*/
-int mutt_save_message(struct Header *h, bool delete, bool decode, bool decrypt)
+int mutt_save_message(struct Email *h, bool delete, bool decode, bool decrypt)
{
bool need_passphrase = false;
int app = 0;
#ifdef USE_COMPRESSED
if (cm)
{
- struct Header *h2 = Context->mailbox->hdrs[i];
+ struct Email *h2 = Context->mailbox->hdrs[i];
cm->msg_count++;
if (!h2->read)
cm->msg_unread++;
*
* recvattach requires the return code to know when to regenerate the actx.
*/
-int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp)
+int mutt_edit_content_type(struct Email *h, struct Body *b, FILE *fp)
{
char buf[LONG_STRING];
char obuf[LONG_STRING];
{
structure_changed = 1;
b->hdr->content = NULL;
- mutt_header_free(&b->hdr);
+ mutt_email_free(&b->hdr);
}
if (fp && !b->parts && (is_multipart(b) || mutt_is_message_type(b->type, b->subtype)))
* @param[out] redraw Set of #REDRAW_FULL if the screen may need redrawing
* @retval true If message contains inline PGP content
*/
-static bool check_traditional_pgp(struct Header *h, int *redraw)
+static bool check_traditional_pgp(struct Email *h, int *redraw)
{
bool rc = false;
* @param[out] redraw Set of #REDRAW_FULL if the screen may need redrawing
* @retval true If message contains inline PGP content
*/
-bool mutt_check_traditional_pgp(struct Header *h, int *redraw)
+bool mutt_check_traditional_pgp(struct Email *h, int *redraw)
{
bool rc = false;
if (h && !(h->security & PGP_TRADITIONAL_CHECKED))
struct Body;
struct Context;
struct Envelope;
-struct Header;
+struct Email;
/* These Config Variables are only used in commands.c */
extern unsigned char CryptVerifySig; /* verify PGP signatures */
extern bool PrintSplit;
extern bool PromptAfter;
-void ci_bounce_message(struct Header *h);
+void ci_bounce_message(struct Email *h);
void mutt_check_stats(void);
-bool mutt_check_traditional_pgp(struct Header *h, int *redraw);
+bool mutt_check_traditional_pgp(struct Email *h, int *redraw);
void mutt_display_address(struct Envelope *env);
-int mutt_display_message(struct Header *cur);
-int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp);
+int mutt_display_message(struct Email *cur);
+int mutt_edit_content_type(struct Email *h, struct Body *b, FILE *fp);
void mutt_enter_command(void);
-void mutt_pipe_message(struct Header *h);
-void mutt_print_message(struct Header *h);
-int mutt_save_message_ctx(struct Header *h, bool delete, bool decode, bool decrypt, struct Context *ctx);
-int mutt_save_message(struct Header *h, bool delete, bool decode, bool decrypt);
+void mutt_pipe_message(struct Email *h);
+void mutt_print_message(struct Email *h);
+int mutt_save_message_ctx(struct Email *h, bool delete, bool decode, bool decrypt, struct Context *ctx);
+int mutt_save_message(struct Email *h, bool delete, bool decode, bool decrypt);
int mutt_select_sort(int reverse);
void mutt_shell_escape(void);
* redraw_crypt_lines - Update the encryption info in the compose window
* @param msg Header of message
*/
-static void redraw_crypt_lines(struct Header *msg)
+static void redraw_crypt_lines(struct Email *msg)
{
SETCOLOR(MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw(MuttIndexWindow, HDR_CRYPT, 0, "%*s",
* @param msg Header of the message
* @param fcc Fcc field
*/
-static void draw_envelope(struct Header *msg, char *fcc)
+static void draw_envelope(struct Email *msg, char *fcc)
{
draw_envelope_addr(HDR_FROM, msg->env->from);
#ifdef USE_NNTP
*/
struct ComposeRedrawData
{
- struct Header *msg;
+ struct Email *msg;
char *fcc;
};
* @retval 0 Normal exit
* @retval -1 Abort message
*/
-int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen,
- struct Header *cur, int flags)
+int mutt_compose_menu(struct Email *msg, char *fcc, size_t fcclen, struct Email *cur, int flags)
{
char helpstr[LONG_STRING];
char buf[LONG_STRING];
#include <stdio.h>
-struct Header;
+struct Email;
/* These Config Variables are only used in compose.c */
extern char * ComposeFormat;
/* flags for mutt_compose_menu() */
#define MUTT_COMPOSE_NOFREEHEADER (1 << 0)
-int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, struct Header *cur, int flags);
+int mutt_compose_menu(struct Email *msg, char *fcc, size_t fcclen, struct Email *cur, int flags);
#endif /* MUTT_COMPOSE_H */
#include "mx.h"
#include "protos.h"
-struct Header;
+struct Email;
/* Notes:
* Any references to compressed files also apply to encrypted files.
/**
* comp_msg_open_new - Implements MxOps::msg_open_new()
*/
-static int comp_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr)
+static int comp_msg_open_new(struct Context *ctx, struct Message *msg, struct Email *hdr)
{
if (!ctx)
return -1;
/**
* comp_tags_commit - Implements MxOps::tags_commit()
*/
-static int comp_tags_commit(struct Context *ctx, struct Header *hdr, char *buf)
+static int comp_tags_commit(struct Context *ctx, struct Email *hdr, char *buf)
{
if (!ctx)
return 0;
off_t vsize;
char *pattern; /**< limit pattern string */
struct Pattern *limit_pattern; /**< compiled limit pattern */
- struct Header *last_tag; /**< last tagged msg. used to link threads */
+ struct Email *last_tag; /**< last tagged msg. used to link threads */
struct MuttThread *tree; /**< top of thread tree */
struct Hash *thread_hash; /**< hash table for threading */
int tagged; /**< how many messages are tagged? */
* prefix
* * string to use if CH_PREFIX is set
*/
-int mutt_copy_header(FILE *in, struct Header *h, FILE *out, int flags, const char *prefix)
+int mutt_copy_header(FILE *in, struct Email *h, FILE *out, int flags, const char *prefix)
{
if (h->env)
{
* * #MUTT_CM_DECODE_PGP used for decoding PGP messages
* * #MUTT_CM_CHARCONV perform character set conversion
*/
-int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Header *hdr, int flags, int chflags)
+int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *hdr, int flags, int chflags)
{
struct Body *body = hdr->content;
char prefix[SHORT_STRING];
* should be made to return -1 on fatal errors, and 1 on non-fatal errors
* like partial decode, where it is worth displaying as much as possible
*/
-int mutt_copy_message_ctx(FILE *fpout, struct Context *src, struct Header *hdr,
+int mutt_copy_message_ctx(FILE *fpout, struct Context *src, struct Email *hdr,
int flags, int chflags)
{
struct Message *msg = mx_msg_open(src, hdr->msgno);
* @retval -1 Error
*/
static int append_message(struct Context *dest, FILE *fpin, struct Context *src,
- struct Header *hdr, int flags, int chflags)
+ struct Email *hdr, int flags, int chflags)
{
char buf[STRING];
struct Message *msg = NULL;
* @retval -1 Failure
*/
int mutt_append_message(struct Context *dest, struct Context *src,
- struct Header *hdr, int cmflags, int chflags)
+ struct Email *hdr, int cmflags, int chflags)
{
struct Message *msg = mx_msg_open(src, hdr->msgno);
if (!msg)
#include <stdio.h>
-struct Header;
+struct Email;
struct Context;
/**< flags to mutt_copy_message */
int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
int flags, const char *prefix);
-int mutt_copy_header(FILE *in, struct Header *h, FILE *out, int flags, const char *prefix);
+int mutt_copy_header(FILE *in, struct Email *h, FILE *out, int flags, const char *prefix);
-int mutt_copy_message_fp (FILE *fpout, FILE *fpin, struct Header *hdr, int flags, int chflags);
-int mutt_copy_message_ctx(FILE *fpout, struct Context *src, struct Header *hdr, int flags, int chflags);
+int mutt_copy_message_fp (FILE *fpout, FILE *fpin, struct Email *hdr, int flags, int chflags);
+int mutt_copy_message_ctx(FILE *fpout, struct Context *src, struct Email *hdr, int flags, int chflags);
-int mutt_append_message(struct Context *dest, struct Context *src, struct Header *hdr, int cmflags, int chflags);
+int mutt_append_message(struct Context *dest, struct Context *src, struct Email *hdr, int cmflags, int chflags);
#endif /* MUTT_COPY_H */
*/
static void collapse_all(struct Menu *menu, int toggle)
{
- struct Header *h = NULL, *base = NULL;
+ struct Email *h = NULL, *base = NULL;
struct MuttThread *thread = NULL, *top = NULL;
int final;
*/
static void resort_index(struct Menu *menu)
{
- struct Header *current = CURHDR;
+ struct Email *current = CURHDR;
menu->current = -1;
mutt_sort_headers(Context, false);
*/
static void update_index_threaded(struct Context *ctx, int check, int oldcount)
{
- struct Header **save_new = NULL;
+ struct Email **save_new = NULL;
/* save the list of new messages */
if ((check != MUTT_REOPENED) && oldcount && (ctx->pattern || UncollapseNew))
{
- save_new = mutt_mem_malloc(sizeof(struct Header *) * (ctx->mailbox->msg_count - oldcount));
+ save_new = mutt_mem_malloc(sizeof(struct Email *) * (ctx->mailbox->msg_count - oldcount));
for (int i = oldcount; i < ctx->mailbox->msg_count; i++)
save_new[i - oldcount] = ctx->mailbox->hdrs[i];
}
{
for (int i = (check == MUTT_REOPENED) ? 0 : oldcount; i < ctx->mailbox->msg_count; i++)
{
- struct Header *h = NULL;
+ struct Email *h = NULL;
if ((check != MUTT_REOPENED) && oldcount)
h = save_new[i - oldcount];
if (!Context || !menu || (num < 0) || (num >= Context->mailbox->hdrmax))
return;
- struct Header *h = Context->mailbox->hdrs[Context->mailbox->v2r[num]];
+ struct Email *h = Context->mailbox->hdrs[Context->mailbox->v2r[num]];
if (!h)
return;
if (!Context || (index_no < 0))
return 0;
- struct Header *h = Context->mailbox->hdrs[Context->mailbox->v2r[index_no]];
+ struct Email *h = Context->mailbox->hdrs[Context->mailbox->v2r[index_no]];
if (h && h->pair)
return h->pair;
CHECK_ATTACH;
if (Context->mailbox->magic == MUTT_NNTP)
{
- struct Header *hdr = NULL;
+ struct Email *hdr = NULL;
if (op == OP_GET_MESSAGE)
{
/* at least one message has been loaded */
if (Context->mailbox->msg_count > oldmsgcount)
{
- struct Header *oldcur = CURHDR;
- struct Header *hdr = NULL;
+ struct Email *oldcur = CURHDR;
+ struct Email *hdr = NULL;
bool quiet = Context->mailbox->quiet;
if (rc2 < 0)
mutt_error(_("That message is not visible"));
else
{
- struct Header *hdr = Context->mailbox->hdrs[i - 1];
+ struct Email *hdr = Context->mailbox->hdrs[i - 1];
if (mutt_messages_in_thread(Context, hdr, 1) != 1)
{
int ovc = Context->mailbox->vcount;
int oc = Context->mailbox->msg_count;
int check;
- struct Header *newhdr = NULL;
+ struct Email *newhdr = NULL;
/* don't attempt to move the cursor if there are no visible messages in the current limit */
if (menu->current < Context->mailbox->vcount)
}
if (oc < Context->mailbox->msg_count)
{
- struct Header *oldcur = CURHDR;
+ struct Email *oldcur = CURHDR;
if ((Sort & SORT_MASK) == SORT_THREADS)
mutt_sort_headers(Context, false);
!STAILQ_EMPTY(&CURHDR->env->references))
{
{
- struct Header *oldcur = CURHDR;
+ struct Email *oldcur = CURHDR;
mutt_break_thread(CURHDR);
mutt_sort_headers(Context, true);
mutt_error(_("First, please tag a message to be linked here"));
else
{
- struct Header *oldcur = CURHDR;
+ struct Email *oldcur = CURHDR;
if (mutt_link_threads(CURHDR, tag ? NULL : Context->last_tag, Context))
{
}
}
- struct Header *h = Context->mailbox->hdrs[Context->mailbox->v2r[i]];
+ struct Email *h = Context->mailbox->hdrs[Context->mailbox->v2r[i]];
if (h->collapsed && (Sort & SORT_MASK) == SORT_THREADS)
{
if (UNREAD(h) && first_unread == -1)
* @param ctx Mailbox
* @param curhdr Header of message
*/
-void mutt_set_header_color(struct Context *ctx, struct Header *curhdr)
+void mutt_set_header_color(struct Context *ctx, struct Email *curhdr)
{
struct ColorLine *color = NULL;
struct PatternCache cache = { 0 };
#include <stdio.h>
struct Context;
-struct Header;
+struct Email;
struct Menu;
/* These Config Variables are only used in curs_main.c */
void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int num);
void mutt_draw_statusline(int cols, const char *buf, size_t buflen);
int mutt_index_menu(void);
-void mutt_set_header_color(struct Context *ctx, struct Header *curhdr);
+void mutt_set_header_color(struct Context *ctx, struct Email *curhdr);
void update_index(struct Menu *menu, struct Context *ctx, int check, int oldcount, int index_hint);
#endif /* MUTT_CURS_MAIN_H */
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_builtin_editor(const char *path, struct Header *msg, struct Header *cur)
+int mutt_builtin_editor(const char *path, struct Email *msg, struct Email *cur)
{
char **buf = NULL;
int bufmax = 0, buflen = 0;
#ifndef MUTT_EDIT_H
#define MUTT_EDIT_H
-struct Header;
+struct Email;
/* These Config Variables are only used in edit.c */
extern char *Escape;
-int mutt_builtin_editor(const char *path, struct Header *msg, struct Header *cur);
+int mutt_builtin_editor(const char *path, struct Email *msg, struct Email *cur);
#endif /* MUTT_EDIT_H */
* @retval 0 Message edited successfully
* @retval -1 Error
*/
-static int edit_or_view_one_message(bool edit, struct Context *ctx, struct Header *cur)
+static int edit_or_view_one_message(bool edit, struct Context *ctx, struct Email *cur)
{
char tmp[PATH_MAX];
char buf[STRING];
* @retval 0 Message edited successfully
* @retval -1 Error
*/
-int edit_or_view_message(bool edit, struct Context *ctx, struct Header *hdr)
+int edit_or_view_message(bool edit, struct Context *ctx, struct Email *hdr)
{
if (hdr)
return edit_or_view_one_message(edit, ctx, hdr);
* @retval 0 Message edited successfully
* @retval -1 Error
*/
-int mutt_edit_message(struct Context *ctx, struct Header *hdr)
+int mutt_edit_message(struct Context *ctx, struct Email *hdr)
{
return edit_or_view_message(true, ctx, hdr); /* true means edit */
}
* @retval 0 Message edited successfully
* @retval -1 Error
*/
-int mutt_view_message(struct Context *ctx, struct Header *hdr)
+int mutt_view_message(struct Context *ctx, struct Email *hdr)
{
return edit_or_view_message(false, ctx, hdr); /* false means only view */
}
*/
struct AttachCtx
{
- struct Header *hdr; /**< used by recvattach for updating */
+ struct Email *hdr; /**< used by recvattach for updating */
FILE *root_fp; /**< used by recvattach for updating */
struct AttachPtr **idx;
#include <unistd.h>
#include "mutt/mutt.h"
#include "body.h"
-#include "header.h"
+#include "email.h"
#include "mime.h"
#include "parameter.h"
{
/* Don't free twice (b->hdr->content = b->parts) */
b->hdr->content = NULL;
- mutt_header_free(&b->hdr);
+ mutt_email_free(&b->hdr);
}
if (b->parts)
* is required when sending mail. */
struct Body *next; /**< next attachment in the list */
struct Body *parts; /**< parts of a multipart or message/rfc822 */
- struct Header *hdr; /**< header information for message/rfc822 */
+ struct Email *hdr; /**< header information for message/rfc822 */
struct AttachPtr *aptr; /**< Menu information, used in recvattach.c */
/**
* @file
- * Representation of the email's header
+ * Representation of an email
*
* @authors
* Copyright (C) 1996-2009,2012 Michael R. Elkins <me@mutt.org>
*/
/**
- * @page email_header Representation of the email's header
+ * @page email_email Representation of an email
*
- * Representation of the email's header
+ * Representation of an email
*/
#include "config.h"
#include <stdbool.h>
#include "mutt/mutt.h"
-#include "header.h"
+#include "email.h"
#include "body.h"
#include "envelope.h"
#include "tags.h"
/**
- * mutt_header_free - Free an email Header
- * @param h Header to free
+ * mutt_email_free - Free an Email
+ * @param h Email to free
*/
-void mutt_header_free(struct Header **h)
+void mutt_email_free(struct Email **h)
{
if (!h || !*h)
return;
}
/**
- * mutt_header_new - Create a new email Header
- * @retval ptr Newly created Header
+ * mutt_email_new - Create a new Email
+ * @retval ptr Newly created Email
*/
-struct Header *mutt_header_new(void)
+struct Email *mutt_email_new(void)
{
- struct Header *h = mutt_mem_calloc(1, sizeof(struct Header));
+ struct Email *h = mutt_mem_calloc(1, sizeof(struct Email));
#ifdef MIXMASTER
STAILQ_INIT(&h->chain);
#endif
}
/**
- * mutt_header_cmp_strict - Strictly compare message headers
- * @param h1 First Header
- * @param h2 Second Header
- * @retval true Headers are strictly identical
+ * mutt_email_cmp_strict - Strictly compare message emails
+ * @param h1 First Email
+ * @param h2 Second Email
+ * @retval true Emails are strictly identical
*/
-bool mutt_header_cmp_strict(const struct Header *h1, const struct Header *h2)
+bool mutt_email_cmp_strict(const struct Email *h1, const struct Email *h2)
{
if (h1 && h2)
{
/**
* @file
- * Representation of the email's header
+ * Representation of an email
*
* @authors
* Copyright (C) 2017 Richard Russon <rich@flatcap.org>
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef MUTT_EMAIL_HEADER_H
-#define MUTT_EMAIL_HEADER_H
+#ifndef MUTT_EMAIL_EMAIL_H
+#define MUTT_EMAIL_EMAIL_H
#include <stddef.h>
#include <stdbool.h>
#include "tags.h"
/**
- * struct Header - The header/envelope of an email
+ * struct Email - The email/envelope of an email
*/
-struct Header
+struct Email
{
unsigned int security : 12; /**< bit 0-8: flags, bit 9,10: application.
see: mutt_crypt.h pgplib.h, smime.h */
- bool mime : 1; /**< has a MIME-Version header? */
+ bool mime : 1; /**< has a MIME-Version email? */
bool flagged : 1; /**< marked important? */
bool tagged : 1;
bool deleted : 1;
struct TagHead tags; /**< for drivers that support server tagging */
- void *data; /**< driver-specific data */
- void (*free_cb)(struct Header *); /**< driver-specific data free function */
+ void *data; /**< driver-specific data */
+ void (*free_cb)(struct Email *); /**< driver-specific data free function */
char *maildir_flags; /**< unknown maildir flags */
};
-bool mutt_header_cmp_strict(const struct Header *h1, const struct Header *h2);
-void mutt_header_free(struct Header **h);
-struct Header *mutt_header_new(void);
+bool mutt_email_cmp_strict(const struct Email *h1, const struct Email *h2);
+void mutt_email_free(struct Email **h);
+struct Email *mutt_email_new(void);
-#endif /* MUTT_EMAIL_HEADER_H */
+#endif /* MUTT_EMAIL_EMAIL_H */
* | email/email_globals.c | @subpage email_globals |
* | email/envelope.c | @subpage email_envelope |
* | email/from.c | @subpage email_from |
- * | email/header.c | @subpage email_header |
+ * | email/email.c | @subpage email_email |
* | email/idna.c | @subpage email_idna |
* | email/mime.c | @subpage email_mime |
* | email/parameter.c | @subpage email_parameter |
#include "attach.h"
#include "body.h"
#include "content.h"
+#include "email.h"
#include "email_globals.h"
#include "envelope.h"
#include "from.h"
-#include "header.h"
#include "idna2.h"
#include "mime.h"
#include "parameter.h"
#include "parse.h"
#include "address.h"
#include "body.h"
+#include "email.h"
#include "email_globals.h"
#include "envelope.h"
#include "from.h"
-#include "header.h"
#include "mime.h"
#include "parameter.h"
#include "rfc2047.h"
* Process a line from an email header. Each line that is recognised is parsed
* and the information put in the Envelope or Header.
*/
-int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
+int mutt_rfc822_parse_line(struct Envelope *e, struct Email *hdr, char *line,
char *p, bool user_hdrs, bool weed, bool do_2047)
{
bool matched = false;
*
* Caller should free the Envelope using mutt_env_free().
*/
-struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr, bool user_hdrs, bool weed)
+struct Envelope *mutt_rfc822_read_header(FILE *f, struct Email *hdr, bool user_hdrs, bool weed)
{
struct Envelope *e = mutt_env_new();
char *line = mutt_mem_malloc(LONG_STRING);
*/
struct Body *mutt_rfc822_parse_message(FILE *fp, struct Body *parent)
{
- parent->hdr = mutt_header_new();
+ parent->hdr = mutt_email_new();
parent->hdr->offset = ftello(fp);
parent->hdr->env = mutt_rfc822_read_header(fp, parent->hdr, false, false);
struct Body *msg = parent->hdr->content;
struct Body;
struct Envelope;
-struct Header;
+struct Email;
int mutt_check_encoding(const char *c);
int mutt_check_mime_type(const char *s);
struct Body * mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off, bool digest);
void mutt_parse_part(FILE *fp, struct Body *b);
struct Body * mutt_read_mime_header(FILE *fp, bool digest);
-int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line, char *p, bool user_hdrs, bool weed, bool do_2047);
+int mutt_rfc822_parse_line(struct Envelope *e, struct Email *hdr, char *line, char *p, bool user_hdrs, bool weed, bool do_2047);
struct Body * mutt_rfc822_parse_message(FILE *fp, struct Body *parent);
-struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr, bool user_hdrs, bool weed);
+struct Envelope *mutt_rfc822_read_header(FILE *f, struct Email *hdr, bool user_hdrs, bool weed);
char * mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen);
#endif /* MUTT_EMAIL_PARSE_H */
#include <stdlib.h>
#include "mutt/mutt.h"
#include "thread.h"
+#include "email.h"
#include "envelope.h"
-#include "header.h"
/**
* is_descendant - Is one thread a descendant of another
* @param reverse If true, reverse the direction of the search
* @retval ptr Matching Header
*/
-struct Header *find_virtual(struct MuttThread *cur, int reverse)
+struct Email *find_virtual(struct MuttThread *cur, int reverse)
{
struct MuttThread *top = NULL;
if (done)
{
- struct Header *h = cur->message;
+ struct Email *h = cur->message;
/* clearing the References: header from obsolete Message-ID(s) */
struct ListNode *np = NULL;
* mutt_break_thread - Break the email Thread
* @param hdr Email Header to break at
*/
-void mutt_break_thread(struct Header *hdr)
+void mutt_break_thread(struct Email *hdr)
{
mutt_list_free(&hdr->env->in_reply_to);
mutt_list_free(&hdr->env->references);
#include <stdbool.h>
#include <stdint.h>
-struct Header;
+struct Email;
/**
* struct MuttThread - An email conversation
struct MuttThread *child;
struct MuttThread *next;
struct MuttThread *prev;
- struct Header *message;
- struct Header *sort_key;
+ struct Email *message;
+ struct Email *sort_key;
};
void clean_references(struct MuttThread *brk, struct MuttThread *cur);
-struct Header *find_virtual(struct MuttThread *cur, int reverse);
+struct Email *find_virtual(struct MuttThread *cur, int reverse);
void insert_message(struct MuttThread **new, struct MuttThread *newparent, struct MuttThread *cur);
bool is_descendant(struct MuttThread *a, struct MuttThread *b);
-void mutt_break_thread(struct Header *hdr);
+void mutt_break_thread(struct Email *hdr);
void thread_hash_destructor(int type, void *obj, intptr_t data);
void unlink_message(struct MuttThread **old, struct MuttThread *cur);
* @param bf true: set the flag; false: clear the flag
* @param upd_ctx true: update the Context
*/
-void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, bool bf, bool upd_ctx)
+void mutt_set_flag_update(struct Context *ctx, struct Email *h, int flag, bool bf, bool upd_ctx)
{
if (!ctx || !h)
return;
* @retval 0 Success
* @retval -1 Failure
*/
-int mutt_thread_set_flag(struct Header *hdr, int flag, int bf, int subthread)
+int mutt_thread_set_flag(struct Email *hdr, int flag, int bf, int subthread)
{
struct MuttThread *start = NULL, *cur = hdr->thread;
* @retval 0 Success
* @retval -1 Failure
*/
-int mutt_change_flag(struct Header *h, int bf)
+int mutt_change_flag(struct Email *h, int bf)
{
int i, flag;
struct Event event;
* mutt_hcache_store - Multiplexor for HcacheOps::store
*/
int mutt_hcache_store(header_cache_t *h, const char *key, size_t keylen,
- struct Header *header, unsigned int uidvalidity)
+ struct Email *header, unsigned int uidvalidity)
{
char *data = NULL;
int dlen;
#include <stddef.h>
#include <sys/time.h>
-struct Header;
+struct Email;
/**
- * struct HeaderCache - header cache structure
+ * struct EmailCache - header cache structure
*
* This struct holds both the backend-agnostic and the backend-specific parts
* of the header cache. Backend code MUST initialize the fetch, store,
* delete and close function pointers in hcache_open, and MAY store
* backend-specific context in the ctx pointer.
*/
-struct HeaderCache
+struct EmailCache
{
char *folder;
unsigned int crc;
void *ctx;
};
-typedef struct HeaderCache header_cache_t;
+typedef struct EmailCache header_cache_t;
/**
* typedef hcache_namer_t - Prototype for function to compose hcache file names
* @retval ptr Success, the restored header (cannot be NULL)
*
* @note The returned Header must be free'd by caller code with
- * mutt_header_free().
+ * mutt_email_free().
*/
-struct Header *mutt_hcache_restore(const unsigned char *d);
+struct Email *mutt_hcache_restore(const unsigned char *d);
/**
* mutt_hcache_store - store a Header along with a validity datum
* @retval num Generic or backend-specific error code otherwise
*/
int mutt_hcache_store(header_cache_t *h, const char *key, size_t keylen,
- struct Header *header, unsigned int uidvalidity);
+ struct Email *header, unsigned int uidvalidity);
/**
* mutt_hcache_store_raw - store a key / data pair
* This function transforms a header into a char so that it is useable by
* db_store.
*/
-void *mutt_hcache_dump(header_cache_t *h, const struct Header *header, int *off,
+void *mutt_hcache_dump(header_cache_t *h, const struct Email *header, int *off,
unsigned int uidvalidity)
{
- struct Header nh;
+ struct Email nh;
bool convert = !CharsetIsUtf8;
*off = 0;
d = serial_dump_int(h->crc, d, off);
- lazy_realloc(&d, *off + sizeof(struct Header));
- memcpy(&nh, header, sizeof(struct Header));
+ lazy_realloc(&d, *off + sizeof(struct Email));
+ memcpy(&nh, header, sizeof(struct Email));
/* some fields are not safe to cache */
nh.tagged = false;
#endif
nh.data = NULL;
- memcpy(d + *off, &nh, sizeof(struct Header));
- *off += sizeof(struct Header);
+ memcpy(d + *off, &nh, sizeof(struct Email));
+ *off += sizeof(struct Email);
d = serial_dump_envelope(nh.env, d, off, convert);
d = serial_dump_body(nh.content, d, off, convert);
* @param d Binary blob
* @retval ptr Reconstructed Header
*/
-struct Header *mutt_hcache_restore(const unsigned char *d)
+struct Email *mutt_hcache_restore(const unsigned char *d)
{
int off = 0;
- struct Header *h = mutt_header_new();
+ struct Email *h = mutt_email_new();
bool convert = !CharsetIsUtf8;
/* skip validate */
/* skip crc */
off += sizeof(unsigned int);
- memcpy(h, d + off, sizeof(struct Header));
- off += sizeof(struct Header);
+ memcpy(h, d + off, sizeof(struct Email));
+ off += sizeof(struct Email);
STAILQ_INIT(&h->tags);
#ifdef MIXMASTER
struct Body;
struct Buffer;
struct Envelope;
-struct Header;
+struct Email;
struct ListHead;
struct ParameterList;
void serial_restore_parameter(struct ParameterList *p, const unsigned char *d, int *off, bool convert);
void serial_restore_stailq(struct ListHead *l, const unsigned char *d, int *off, bool convert);
-void * mutt_hcache_dump(header_cache_t *h, const struct Header *header, int *off, unsigned int uidvalidity);
-struct Header *mutt_hcache_restore(const unsigned char *d);
+void * mutt_hcache_dump(header_cache_t *h, const struct Email *header, int *off, unsigned int uidvalidity);
+struct Email *mutt_hcache_restore(const unsigned char *d);
#endif /* MUTT_HCACHE_SERIALIZE_H */
* @retval 4 User is originator
* @retval 5 Sent to a subscribed mailinglist
*/
-static int user_is_recipient(struct Header *h)
+static int user_is_recipient(struct Email *h)
{
if (!h || !h->env)
return 0;
* @param hdr Header of an email
* @retval true If thread contains new mail
*/
-static bool thread_is_new(struct Context *ctx, struct Header *hdr)
+static bool thread_is_new(struct Context *ctx, struct Email *hdr)
{
return hdr->collapsed && (hdr->num_hidden > 1) &&
(mutt_thread_contains_unread(ctx, hdr) == 1);
* @param hdr Header of an email
* @retval true If thread contains unread mail
*/
-static bool thread_is_old(struct Context *ctx, struct Header *hdr)
+static bool thread_is_old(struct Context *ctx, struct Email *hdr)
{
return hdr->collapsed && (hdr->num_hidden > 1) &&
(mutt_thread_contains_unread(ctx, hdr) == 2);
int is_index = (flags & MUTT_FORMAT_INDEX);
size_t colorlen;
- struct Header *hdr = hfi->hdr;
+ struct Email *hdr = hfi->hdr;
struct Context *ctx = hfi->ctx;
if (!hdr || !hdr->env)
if (hdr->env->x_label)
{
i = 1; /* reduce reuse recycle */
- struct Header *htmp = NULL;
+ struct Email *htmp = NULL;
if (flags & MUTT_FORMAT_TREE && (hdr->thread->prev && hdr->thread->prev->message &&
hdr->thread->prev->message->env->x_label))
{
* @param flags Format flags
*/
void mutt_make_string_flags(char *buf, size_t buflen, const char *s,
- struct Context *ctx, struct Header *hdr, enum FormatFlag flags)
+ struct Context *ctx, struct Email *hdr, enum FormatFlag flags)
{
struct HdrFormatInfo hfi;
struct Address;
struct Context;
-struct Header;
+struct Email;
/* These Config Variables are only used in hdrline.c */
extern struct MbTable *FlagChars;
struct HdrFormatInfo
{
struct Context *ctx;
- struct Header *hdr;
+ struct Email *hdr;
const char *pager_progress;
};
bool mutt_is_mail_list(struct Address *addr);
bool mutt_is_subscribed_list(struct Address *addr);
-void mutt_make_string_flags(char *buf, size_t buflen, const char *s, struct Context *ctx, struct Header *hdr, enum FormatFlag flags);
+void mutt_make_string_flags(char *buf, size_t buflen, const char *s, struct Context *ctx, struct Email *hdr, enum FormatFlag flags);
void mutt_make_string_info(char *buf, size_t buflen, int cols, const char *s, struct HdrFormatInfo *hfi, enum FormatFlag flags);
#define mutt_make_string(A, B, C, D, E) mutt_make_string_flags(A, B, C, D, E, 0)
* @param hdr Email Header
* @param type Hook type, e.g. #MUTT_MESSAGE_HOOK
*/
-void mutt_message_hook(struct Context *ctx, struct Header *hdr, int type)
+void mutt_message_hook(struct Context *ctx, struct Email *hdr, int type)
{
struct Buffer err, token;
struct Hook *hook = NULL;
* @retval -1 Failure
*/
static int addr_hook(char *path, size_t pathlen, int type, struct Context *ctx,
- struct Header *hdr)
+ struct Email *hdr)
{
struct Hook *hook = NULL;
struct PatternCache cache = { 0 };
* @param pathlen Length of buffer
* @param hdr Email Header
*/
-void mutt_default_save(char *path, size_t pathlen, struct Header *hdr)
+void mutt_default_save(char *path, size_t pathlen, struct Email *hdr)
{
*path = '\0';
if (addr_hook(path, pathlen, MUTT_SAVE_HOOK, Context, hdr) == 0)
* @param pathlen Length of the buffer
* @param hdr Email Header
*/
-void mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr)
+void mutt_select_fcc(char *path, size_t pathlen, struct Email *hdr)
{
if (addr_hook(path, pathlen, MUTT_FCC_HOOK, NULL, hdr) != 0)
{
struct Address;
struct Buffer;
struct Context;
-struct Header;
+struct Email;
struct ListHead;
/* These Config Variables are only used in hook.c */
void mutt_account_hook(const char *url);
void mutt_crypt_hook(struct ListHead *list, struct Address *addr);
-void mutt_default_save(char *path, size_t pathlen, struct Header *hdr);
+void mutt_default_save(char *path, size_t pathlen, struct Email *hdr);
void mutt_delete_hooks(int type);
char *mutt_find_hook(int type, const char *pat);
void mutt_folder_hook(const char *path);
-void mutt_message_hook(struct Context *ctx, struct Header *hdr, int type);
+void mutt_message_hook(struct Context *ctx, struct Email *hdr, int type);
int mutt_parse_hook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-void mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr);
+void mutt_select_fcc(char *path, size_t pathlen, struct Email *hdr);
void mutt_startup_shutdown_hook(int type);
void mutt_timeout_hook(void);
static void cmd_parse_expunge(struct ImapData *idata, const char *s)
{
unsigned int exp_msn;
- struct Header *h = NULL;
+ struct Email *h = NULL;
mutt_debug(2, "Handling EXPUNGE\n");
while ((rc = mutt_seqset_iterator_next(iter, &uid)) == 0)
{
- struct Header *h = mutt_hash_int_find(idata->uid_hash, uid);
+ struct Email *h = mutt_hash_int_find(idata->uid_hash, uid);
if (!h)
continue;
static void cmd_parse_fetch(struct ImapData *idata, char *s)
{
unsigned int msn, uid;
- struct Header *h = NULL;
+ struct Email *h = NULL;
char *flags = NULL;
int uid_checked = 0;
int server_changes = 0;
static void cmd_parse_search(struct ImapData *idata, const char *s)
{
unsigned int uid;
- struct Header *h = NULL;
+ struct Email *h = NULL;
mutt_debug(2, "Handling SEARCH\n");
unsigned int setstart = 0; /* start of current message range */
int n;
bool started = false;
- struct Header **hdrs = idata->ctx->mailbox->hdrs;
+ struct Email **hdrs = idata->ctx->mailbox->hdrs;
for (n = *pos; n < idata->ctx->mailbox->msg_count && buf->dptr - buf->data < IMAP_MAX_CMDLEN;
n++)
*
* The comparison of flags EXCLUDES the deleted flag.
*/
-static bool compare_flags_for_copy(struct Header *h)
+static bool compare_flags_for_copy(struct Email *h)
{
struct ImapHeaderData *hd = h->data;
*/
void imap_expunge_mailbox(struct ImapData *idata)
{
- struct Header *h = NULL;
+ struct Email *h = NULL;
int cacheno;
short old_sort;
int imap_exec_msgset(struct ImapData *idata, const char *pre, const char *post,
int flag, bool changed, bool invert)
{
- struct Header **hdrs = NULL;
+ struct Email **hdrs = NULL;
short oldsort;
int pos;
int rc;
{
hdrs = idata->ctx->mailbox->hdrs;
idata->ctx->mailbox->hdrs =
- mutt_mem_malloc(idata->ctx->mailbox->msg_count * sizeof(struct Header *));
+ mutt_mem_malloc(idata->ctx->mailbox->msg_count * sizeof(struct Email *));
memcpy(idata->ctx->mailbox->hdrs, hdrs,
- idata->ctx->mailbox->msg_count * sizeof(struct Header *));
+ idata->ctx->mailbox->msg_count * sizeof(struct Email *));
Sort = SORT_ORDER;
qsort(idata->ctx->mailbox->hdrs, idata->ctx->mailbox->msg_count,
- sizeof(struct Header *), mutt_get_sort_func(SORT_ORDER));
+ sizeof(struct Email *), mutt_get_sort_func(SORT_ORDER));
}
pos = 0;
* @note This does not sync the "deleted" flag state, because it is not
* desirable to propagate that flag into the copy.
*/
-int imap_sync_message_for_copy(struct ImapData *idata, struct Header *hdr,
+int imap_sync_message_for_copy(struct ImapData *idata, struct Email *hdr,
struct Buffer *cmd, int *err_continue)
{
char flags[LONG_STRING];
int imap_sync_mailbox(struct Context *ctx, bool expunge)
{
struct Context *appendctx = NULL;
- struct Header *h = NULL;
- struct Header **hdrs = NULL;
+ struct Email *h = NULL;
+ struct Email **hdrs = NULL;
int oldsort;
int rc;
{
hdrs = ctx->mailbox->hdrs;
ctx->mailbox->hdrs =
- mutt_mem_malloc(ctx->mailbox->msg_count * sizeof(struct Header *));
- memcpy(ctx->mailbox->hdrs, hdrs, ctx->mailbox->msg_count * sizeof(struct Header *));
+ mutt_mem_malloc(ctx->mailbox->msg_count * sizeof(struct Email *));
+ memcpy(ctx->mailbox->hdrs, hdrs, ctx->mailbox->msg_count * sizeof(struct Email *));
Sort = SORT_ORDER;
- qsort(ctx->mailbox->hdrs, ctx->mailbox->msg_count, sizeof(struct Header *),
+ qsort(ctx->mailbox->hdrs, ctx->mailbox->msg_count, sizeof(struct Email *),
mutt_get_sort_func(SORT_ORDER));
}
}
ctx->mailbox->hdrmax = count;
- ctx->mailbox->hdrs = mutt_mem_calloc(count, sizeof(struct Header *));
+ ctx->mailbox->hdrs = mutt_mem_calloc(count, sizeof(struct Email *));
ctx->mailbox->v2r = mutt_mem_calloc(count, sizeof(int));
ctx->mailbox->msg_count = 0;
/**
* imap_msg_open_new - Implements MxOps::msg_open_new()
*/
-static int imap_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr)
+static int imap_msg_open_new(struct Context *ctx, struct Message *msg, struct Email *hdr)
{
char tmp[PATH_MAX];
* Also this method check that each flags is support by the server
* first and remove unsupported one.
*/
-static int imap_tags_commit(struct Context *ctx, struct Header *hdr, char *buf)
+static int imap_tags_commit(struct Context *ctx, struct Email *hdr, char *buf)
{
struct Buffer *cmd = NULL;
char uid[11];
struct BrowserState;
struct Context;
-struct Header;
+struct Email;
struct Pattern;
/* These Config Variables are only used in imap/auth.c */
int imap_mailbox_rename(const char *mailbox);
/* message.c */
-int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, bool delete);
+int imap_copy_messages(struct Context *ctx, struct Email *h, char *dest, bool delete);
/* socket.c */
void imap_logout_all(void);
struct ConnAccount;
struct Context;
-struct Header;
+struct Email;
struct ImapHeaderData;
struct ImapMbox;
struct Message;
unsigned int uid_validity;
unsigned int uidnext;
unsigned long long modseq;
- struct Header **msn_index; /**< look up headers by (MSN-1) */
+ struct Email **msn_index; /**< look up headers by (MSN-1) */
size_t msn_index_size; /**< allocation size */
unsigned int max_msn; /**< the largest MSN fetched so far */
struct BodyCache *bcache;
int imap_read_literal(FILE *fp, struct ImapData *idata, unsigned long bytes, struct Progress *pbar);
void imap_expunge_mailbox(struct ImapData *idata);
void imap_logout(struct ImapData **idata);
-int imap_sync_message_for_copy(struct ImapData *idata, struct Header *hdr, struct Buffer *cmd, int *err_continue);
+int imap_sync_message_for_copy(struct ImapData *idata, struct Email *hdr, struct Buffer *cmd, int *err_continue);
bool imap_has_flag(struct ListHead *flag_list, const char *flag);
/* auth.c */
/* message.c */
void imap_free_header_data(struct ImapHeaderData **data);
int imap_read_headers(struct ImapData *idata, unsigned int msn_begin, unsigned int msn_end, bool initial_download);
-char *imap_set_flags(struct ImapData *idata, struct Header *h, char *s, int *server_changes);
-int imap_cache_del(struct ImapData *idata, struct Header *h);
+char *imap_set_flags(struct ImapData *idata, struct Email *h, char *s, int *server_changes);
+int imap_cache_del(struct ImapData *idata, struct Email *h);
int imap_cache_clean(struct ImapData *idata);
int imap_append_message(struct Context *ctx, struct Message *msg);
#ifdef USE_HCACHE
header_cache_t *imap_hcache_open(struct ImapData *idata, const char *path);
void imap_hcache_close(struct ImapData *idata);
-struct Header *imap_hcache_get(struct ImapData *idata, unsigned int uid);
-int imap_hcache_put(struct ImapData *idata, struct Header *h);
+struct Email *imap_hcache_get(struct ImapData *idata, unsigned int uid);
+int imap_hcache_put(struct ImapData *idata, struct Email *h);
int imap_hcache_del(struct ImapData *idata, unsigned int uid);
int imap_hcache_store_uid_seqset(struct ImapData *idata);
int imap_hcache_clear_uid_seqset(struct ImapData *idata);
* @retval ptr Success, handle of cache entry
* @retval NULL Failure
*/
-static FILE *msg_cache_get(struct ImapData *idata, struct Header *h)
+static FILE *msg_cache_get(struct ImapData *idata, struct Email *h)
{
if (!idata || !h)
return NULL;
* @retval ptr Success, handle of cache entry
* @retval NULL Failure
*/
-static FILE *msg_cache_put(struct ImapData *idata, struct Header *h)
+static FILE *msg_cache_put(struct ImapData *idata, struct Email *h)
{
if (!idata || !h)
return NULL;
* @retval 0 Success
* @retval -1 Failure
*/
-static int msg_cache_commit(struct ImapData *idata, struct Header *h)
+static int msg_cache_commit(struct ImapData *idata, struct Email *h)
{
if (!idata || !h)
return -1;
/* This is a conservative check to protect against a malicious imap
* server. Most likely size_t is bigger than an unsigned int, but
* if msn_count is this big, we have a serious problem. */
- if (msn_count >= (UINT_MAX / sizeof(struct Header *)))
+ if (msn_count >= (UINT_MAX / sizeof(struct Email *)))
{
mutt_error(_("Out of memory"));
mutt_exit(1);
new_size = msn_count + 25;
if (!idata->msn_index)
- idata->msn_index = mutt_mem_calloc(new_size, sizeof(struct Header *));
+ idata->msn_index = mutt_mem_calloc(new_size, sizeof(struct Email *));
else
{
- mutt_mem_realloc(&idata->msn_index, sizeof(struct Header *) * new_size);
+ mutt_mem_realloc(&idata->msn_index, sizeof(struct Email *) * new_size);
memset(idata->msn_index + idata->msn_index_size, 0,
- sizeof(struct Header *) * (new_size - idata->msn_index_size));
+ sizeof(struct Email *) * (new_size - idata->msn_index_size));
}
idata->msn_index_size = new_size;
* case of local_changes, if a change to a flag _would_ have been
* made.
*/
-static void set_changed_flag(struct Context *ctx, struct Header *h,
+static void set_changed_flag(struct Context *ctx, struct Email *h,
int local_changes, int *server_changes, int flag_name,
int old_hd_flag, int new_hd_flag, int h_flag)
{
if (msn > idata->msn_index_size)
alloc_msn_index(idata, msn);
- struct Header *h = imap_hcache_get(idata, uid);
+ struct Email *h = imap_hcache_get(idata, uid);
if (h)
{
idata->max_msn = MAX(idata->max_msn, msn);
continue;
}
- ctx->mailbox->hdrs[idx] = mutt_header_new();
+ ctx->mailbox->hdrs[idx] = mutt_email_new();
idata->max_msn = MAX(idata->max_msn, h.data->msn);
idata->msn_index[h.data->msn - 1] = ctx->mailbox->hdrs[idx];
* @retval 0 Success
* @retval 1 Non-fatal error - try fetch/append
*/
-int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, bool delete)
+int imap_copy_messages(struct Context *ctx, struct Email *h, char *dest, bool delete)
{
struct Buffer cmd, sync_cmd;
char mbox[PATH_MAX];
* @retval 0 Success
* @retval -1 Failure
*/
-int imap_cache_del(struct ImapData *idata, struct Header *h)
+int imap_cache_del(struct ImapData *idata, struct Email *h)
{
if (!idata || !h)
return -1;
* case of h->changed, if a change to a flag _would_ have been
* made.
*/
-char *imap_set_flags(struct ImapData *idata, struct Header *h, char *s, int *server_changes)
+char *imap_set_flags(struct ImapData *idata, struct Email *h, char *s, int *server_changes)
{
struct Context *ctx = idata->ctx;
struct ImapHeader newh = { 0 };
int output_progress;
struct ImapData *idata = ctx->mailbox->data;
- struct Header *h = ctx->mailbox->hdrs[msgno];
+ struct Email *h = ctx->mailbox->hdrs[msgno];
msg->fp = msg_cache_get(idata, h);
if (msg->fp)
match = false;
if (msn <= idata->max_msn)
{
- struct Header *cur_header = idata->msn_index[msn - 1];
+ struct Email *cur_header = idata->msn_index[msn - 1];
cur_uid = cur_header ? HEADER_DATA(cur_header)->uid : 0;
if (!state || (cur_uid && ((cur_uid - 1) == last_uid)))
match = true;
* @retval ptr Email Header
* @retval NULL Failure
*/
-struct Header *imap_hcache_get(struct ImapData *idata, unsigned int uid)
+struct Email *imap_hcache_get(struct ImapData *idata, unsigned int uid)
{
char key[16];
void *uv = NULL;
- struct Header *h = NULL;
+ struct Email *h = NULL;
if (!idata->hcache)
return NULL;
* @retval 0 Success
* @retval -1 Failure
*/
-int imap_hcache_put(struct ImapData *idata, struct Header *h)
+int imap_hcache_put(struct ImapData *idata, struct Email *h)
{
char key[16];
*/
static bool test_last_status_new(FILE *f)
{
- struct Header *hdr = NULL;
+ struct Email *hdr = NULL;
struct Envelope *tmp_envelope = NULL;
bool result = false;
if (fseek_last_message(f) == -1)
return false;
- hdr = mutt_header_new();
+ hdr = mutt_email_new();
tmp_envelope = mutt_rfc822_read_header(f, hdr, false, false);
if (!(hdr->read || hdr->old))
result = true;
mutt_env_free(&tmp_envelope);
- mutt_header_free(&hdr);
+ mutt_email_free(&hdr);
return result;
}
int msg_unread; /**< number of unread messages */
int msg_flagged; /**< number of flagged messages */
- struct Header **hdrs;
+ struct Email **hdrs;
int hdrmax; /**< number of pointers in hdrs */
int *v2r; /**< mapping from virtual to real msgno */
int vcount; /**< the number of virtual messages */
struct Mailbox;
struct Context;
-struct Header;
+struct Email;
/* These Config Variables are only used in maildir/mh.c */
extern bool CheckNew;
extern struct MxOps mx_mh_ops;
int maildir_check_empty(const char *path);
-void maildir_gen_flags(char *dest, size_t destlen, struct Header *hdr);
+void maildir_gen_flags(char *dest, size_t destlen, struct Email *hdr);
FILE * maildir_open_find_message(const char *folder, const char *msg, char **newname);
-void maildir_parse_flags(struct Header *h, const char *path);
-struct Header *maildir_parse_message(enum MailboxType magic, const char *fname, bool is_old, struct Header *h);
-struct Header *maildir_parse_stream(enum MailboxType magic, FILE *f, const char *fname, bool is_old, struct Header *h);
-bool maildir_update_flags(struct Context *ctx, struct Header *o, struct Header *n);
+void maildir_parse_flags(struct Email *h, const char *path);
+struct Email *maildir_parse_message(enum MailboxType magic, const char *fname, bool is_old, struct Email *h);
+struct Email *maildir_parse_stream(enum MailboxType magic, FILE *f, const char *fname, bool is_old, struct Email *h);
+bool maildir_update_flags(struct Context *ctx, struct Email *o, struct Email *n);
bool mh_mailbox(struct Mailbox *mailbox, bool check_stats);
int mh_check_empty(const char *path);
*/
struct Maildir
{
- struct Header *h;
+ struct Email *h;
char *canon_fname;
bool header_parsed : 1;
ino_t inode;
FREE(&(*md)->canon_fname);
if ((*md)->h)
- mutt_header_free(&(*md)->h);
+ mutt_email_free(&(*md)->h);
FREE(md);
}
char buf[PATH_MAX];
int is_old = 0;
struct Maildir *entry = NULL;
- struct Header *h = NULL;
+ struct Email *h = NULL;
if (subdir)
{
/* FOO - really ignore the return value? */
mutt_debug(2, "queueing %s\n", de->d_name);
- h = mutt_header_new();
+ h = mutt_email_new();
h->old = is_old;
if (mailbox->magic == MUTT_MAILDIR)
maildir_parse_flags(h, de->d_name);
if (data && !ret && lastchanged.st_mtime <= when->tv_sec)
{
- struct Header *h = mutt_hcache_restore((unsigned char *) data);
+ struct Email *h = mutt_hcache_restore((unsigned char *) data);
h->old = p->h->old;
h->path = mutt_str_strdup(p->h->path);
- mutt_header_free(&p->h);
+ mutt_email_free(&p->h);
p->h = h;
if (mailbox->magic == MUTT_MAILDIR)
maildir_parse_flags(p->h, fn);
#endif
}
else
- mutt_header_free(&p->h);
+ mutt_email_free(&p->h);
#ifdef USE_HCACHE
}
mutt_hcache_free(hc, &data);
static int maildir_mh_open_message(struct Mailbox *mailbox, struct Message *msg,
int msgno, int is_maildir)
{
- struct Header *cur = mailbox->hdrs[msgno];
+ struct Email *cur = mailbox->hdrs[msgno];
char path[PATH_MAX];
snprintf(path, sizeof(path), "%s/%s", mailbox->path, cur->path);
* @retval -1 Failure
*/
static int mh_commit_msg(struct Mailbox *mailbox, struct Message *msg,
- struct Header *hdr, bool updseq)
+ struct Email *hdr, bool updseq)
{
struct dirent *de = NULL;
char *cp = NULL, *dep = NULL;
*
* See also maildir_msg_open_new().
*/
-static int md_commit_message(struct Mailbox *mailbox, struct Message *msg, struct Header *hdr)
+static int md_commit_message(struct Mailbox *mailbox, struct Message *msg, struct Email *hdr)
{
char subdir[4];
char suffix[16];
*/
static int mh_rewrite_message(struct Context *ctx, int msgno)
{
- struct Header *h = ctx->mailbox->hdrs[msgno];
+ struct Email *h = ctx->mailbox->hdrs[msgno];
bool restore = true;
long old_body_offset = h->content->offset;
*/
static int mh_sync_message(struct Context *ctx, int msgno)
{
- struct Header *h = ctx->mailbox->hdrs[msgno];
+ struct Email *h = ctx->mailbox->hdrs[msgno];
if (h->attach_del || h->xlabel_changed ||
(h->env && (h->env->refs_changed || h->env->irt_changed)))
*/
static int maildir_sync_message(struct Context *ctx, int msgno)
{
- struct Header *h = ctx->mailbox->hdrs[msgno];
+ struct Email *h = ctx->mailbox->hdrs[msgno];
if (h->attach_del || h->xlabel_changed ||
(h->env && (h->env->refs_changed || h->env->irt_changed)))
* @param h Header of email
* @param path Path to email file
*/
-void maildir_parse_flags(struct Header *h, const char *path)
+void maildir_parse_flags(struct Email *h, const char *path)
{
char *q = NULL;
* Actually parse a maildir message. This may also be used to fill
* out a fake header structure generated by lazy maildir parsing.
*/
-struct Header *maildir_parse_stream(enum MailboxType magic, FILE *f,
- const char *fname, bool is_old, struct Header *h)
+struct Email *maildir_parse_stream(enum MailboxType magic, FILE *f,
+ const char *fname, bool is_old, struct Email *h)
{
struct stat st;
if (!h)
- h = mutt_header_new();
+ h = mutt_email_new();
h->env = mutt_rfc822_read_header(f, h, false, false);
fstat(fileno(f), &st);
* This may also be used to fill out a fake header structure generated by lazy
* maildir parsing.
*/
-struct Header *maildir_parse_message(enum MailboxType magic, const char *fname,
- bool is_old, struct Header *h)
+struct Email *maildir_parse_message(enum MailboxType magic, const char *fname,
+ bool is_old, struct Email *h)
{
FILE *f = fopen(fname, "r");
if (!f)
* @param destlen Length of buffer
* @param hdr Header of the email
*/
-void maildir_gen_flags(char *dest, size_t destlen, struct Header *hdr)
+void maildir_gen_flags(char *dest, size_t destlen, struct Email *hdr)
{
*dest = '\0';
int mh_sync_mailbox_message(struct Context *ctx, int msgno)
#endif
{
- struct Header *h = ctx->mailbox->hdrs[msgno];
+ struct Email *h = ctx->mailbox->hdrs[msgno];
if (h->deleted && (ctx->mailbox->magic != MUTT_MAILDIR || !MaildirTrash))
{
* @retval true If the flags changed
* @retval false Otherwise
*/
-bool maildir_update_flags(struct Context *ctx, struct Header *o, struct Header *n)
+bool maildir_update_flags(struct Context *ctx, struct Email *o, struct Email *n)
{
/* save the global state here so we can reset it at the
* end of list block if required.
ctx->mailbox->hdrs[i]->trash = p->h->trash;
/* this is a duplicate of an existing header, so remove it */
- mutt_header_free(&p->h);
+ mutt_email_free(&p->h);
}
/* This message was not in the list of messages we just scanned.
* Check to see if we have enough information to know if the
* @note This uses _almost_ the maildir file name format,
* but with a {cur,new} prefix.
*/
-static int maildir_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr)
+static int maildir_msg_open_new(struct Context *ctx, struct Message *msg, struct Email *hdr)
{
int fd;
char path[PATH_MAX];
ctx->mailbox->hdrs[i]->active = false;
p = mutt_hash_find(fnames, ctx->mailbox->hdrs[i]->path);
- if (p && p->h && mutt_header_cmp_strict(ctx->mailbox->hdrs[i], p->h))
+ if (p && p->h && mutt_email_cmp_strict(ctx->mailbox->hdrs[i], p->h))
{
ctx->mailbox->hdrs[i]->active = true;
/* found the right message */
if (maildir_update_flags(ctx, ctx->mailbox->hdrs[i], p->h))
flags_changed = true;
- mutt_header_free(&p->h);
+ mutt_email_free(&p->h);
}
else /* message has disappeared */
occult = true;
*
* Open a new (temporary) message in an MH folder.
*/
-static int mh_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr)
+static int mh_msg_open_new(struct Context *ctx, struct Message *msg, struct Email *hdr)
{
return mh_mkstemp(ctx->mailbox, &msg->fp, &msg->path);
}
#ifdef USE_NNTP
char *cli_nntp = NULL;
#endif
- struct Header *msg = NULL;
+ struct Email *msg = NULL;
struct ListHead attach = STAILQ_HEAD_INITIALIZER(attach);
struct ListHead commands = STAILQ_HEAD_INITIALIZER(commands);
struct ListHead queries = STAILQ_HEAD_INITIALIZER(queries);
if (!STAILQ_EMPTY(&cc_list) || !STAILQ_EMPTY(&bcc_list))
{
- msg = mutt_header_new();
+ msg = mutt_email_new();
msg->env = mutt_env_new();
struct ListNode *np = NULL;
mutt_flushinp();
if (!msg)
- msg = mutt_header_new();
+ msg = mutt_email_new();
if (!msg->env)
msg->env = mutt_env_new();
/* Set up a "context" header with just enough information so that
* mutt_prepare_template() can parse the message in fin.
*/
- struct Header *context_hdr = mutt_header_new();
+ struct Email *context_hdr = mutt_email_new();
context_hdr->offset = 0;
context_hdr->content = mutt_body_new();
if (fstat(fileno(fin), &st) != 0)
{
mutt_error(_("Cannot parse message template: %s"), draft_file);
mutt_env_free(&opts_env);
- mutt_header_free(&context_hdr);
+ mutt_email_free(&context_hdr);
goto main_curses;
}
mutt_str_replace(&msg->env->subject, opts_env->subject);
mutt_env_free(&opts_env);
- mutt_header_free(&context_hdr);
+ mutt_email_free(&context_hdr);
}
/* Editing the include_file: pass it directly in.
* Note that SEND_NO_FREE_HEADER is set above so it isn't unlinked.
mutt_file_fclose(&fout);
}
- mutt_header_free(&msg);
+ mutt_email_free(&msg);
}
/* !edit_infile && draft_file will leave the tempfile around */
int lines;
time_t t;
LOFF_T loc, tmploc;
- struct Header *hdr = NULL;
+ struct Email *hdr = NULL;
struct stat sb;
struct Progress progress;
if (ctx->mailbox->msg_count == ctx->mailbox->hdrmax)
mx_alloc_memory(ctx->mailbox);
- hdr = mutt_header_new();
+ hdr = mutt_email_new();
ctx->mailbox->hdrs[ctx->mailbox->msg_count] = hdr;
hdr->offset = loc;
hdr->index = ctx->mailbox->msg_count;
struct stat sb;
char buf[HUGE_STRING], return_path[STRING];
- struct Header *curhdr = NULL;
+ struct Email *curhdr = NULL;
time_t t;
int count = 0, lines = 0;
LOFF_T loc;
/* Save the Content-Length of the previous message */
if (count > 0)
{
- struct Header *h = ctx->mailbox->hdrs[ctx->mailbox->msg_count - 1];
+ struct Email *h = ctx->mailbox->hdrs[ctx->mailbox->msg_count - 1];
if (h->content->length < 0)
{
h->content->length = loc - h->content->offset - 1;
if (ctx->mailbox->msg_count == ctx->mailbox->hdrmax)
mx_alloc_memory(ctx->mailbox);
- ctx->mailbox->hdrs[ctx->mailbox->msg_count] = mutt_header_new();
+ ctx->mailbox->hdrs[ctx->mailbox->msg_count] = mutt_email_new();
curhdr = ctx->mailbox->hdrs[ctx->mailbox->msg_count];
curhdr->received = t - mutt_date_local_tz(t);
curhdr->offset = loc;
*/
if (count > 0)
{
- struct Header *h = ctx->mailbox->hdrs[ctx->mailbox->msg_count - 1];
+ struct Email *h = ctx->mailbox->hdrs[ctx->mailbox->msg_count - 1];
if (h->content->length < 0)
{
h->content->length = ftello(mdata->fp) - h->content->offset - 1;
if (!mdata)
return -1;
- bool (*cmp_headers)(const struct Header *, const struct Header *) = NULL;
- struct Header **old_hdrs = NULL;
+ bool (*cmp_headers)(const struct Email *, const struct Email *) = NULL;
+ struct Email **old_hdrs = NULL;
int old_msgcount;
bool msg_mod = false;
bool index_hint_set;
if (ctx->mailbox->readonly)
{
for (i = 0; i < ctx->mailbox->msg_count; i++)
- mutt_header_free(&(ctx->mailbox->hdrs[i])); /* nothing to do! */
+ mutt_email_free(&(ctx->mailbox->hdrs[i])); /* nothing to do! */
FREE(&ctx->mailbox->hdrs);
}
else
{
case MUTT_MBOX:
case MUTT_MMDF:
- cmp_headers = mutt_header_cmp_strict;
+ cmp_headers = mutt_email_cmp_strict;
mutt_file_fclose(&mdata->fp);
mdata->fp = mutt_file_fopen(ctx->mailbox->path, "r");
if (!mdata->fp)
{
/* free the old headers */
for (j = 0; j < old_msgcount; j++)
- mutt_header_free(&(old_hdrs[j]));
+ mutt_email_free(&(old_hdrs[j]));
FREE(&old_hdrs);
ctx->mailbox->quiet = false;
mutt_set_flag(ctx, ctx->mailbox->hdrs[i], MUTT_TAG, old_hdrs[j]->tagged);
/* we don't need this header any more */
- mutt_header_free(&(old_hdrs[j]));
+ mutt_email_free(&(old_hdrs[j]));
}
}
{
if (old_hdrs[j])
{
- mutt_header_free(&(old_hdrs[j]));
+ mutt_email_free(&(old_hdrs[j]));
msg_mod = true;
}
}
* mbox_msg_open_new - Implements MxOps::msg_open_new()
* @retval 0 Always
*/
-static int mbox_msg_open_new(struct Context *ctx, struct Message *msg, struct Header *hdr)
+static int mbox_msg_open_new(struct Context *ctx, struct Message *msg, struct Email *hdr)
{
struct MboxData *mdata = get_mboxdata(ctx->mailbox);
if (!mdata)
{
struct ColorLineHead *color = NULL;
struct ColorLine *np = NULL;
- struct Header *hdr = Context->mailbox->hdrs[Context->mailbox->v2r[index]];
+ struct Email *hdr = Context->mailbox->hdrs[Context->mailbox->v2r[index]];
int type = *s;
switch (type)
* attachment this way will block the main neomutt process until the viewer process
* exits.
*/
-int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr,
+int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Email *hdr,
struct AttachCtx *actx)
{
char tempfile[PATH_MAX] = "";
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct Header *hdr)
+int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct Email *hdr)
{
if (!m)
return -1;
int chflags = 0;
int r = -1;
- struct Header *hn = m->hdr;
+ struct Email *hn = m->hdr;
hn->msgno = hdr->msgno; /* required for MH/maildir */
hn->read = true;
struct State s = { 0 };
unsigned int saved_encoding = 0;
struct Body *saved_parts = NULL;
- struct Header *saved_hdr = NULL;
+ struct Email *saved_hdr = NULL;
int rc = 0;
s.flags = displaying;
m->encoding = saved_encoding;
if (saved_parts)
{
- mutt_header_free(&m->hdr);
+ mutt_email_free(&m->hdr);
m->parts = saved_parts;
m->hdr = saved_hdr;
}
struct AttachCtx;
struct Menu;
-struct Header;
+struct Email;
struct Body;
int mutt_tag_attach(struct Menu *menu, int n, int m);
-int mutt_attach_display_loop(struct Menu *menu, int op, struct Header *hdr,
+int mutt_attach_display_loop(struct Menu *menu, int op, struct Email *hdr,
struct AttachCtx *actx, bool recv);
void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
- struct Body *top, struct Header *hdr, struct Menu *menu);
+ struct Body *top, struct Email *hdr, struct Menu *menu);
void mutt_pipe_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
struct Body *top, bool filter);
void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
struct Body *top);
-int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr, struct AttachCtx *actx);
+int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Email *hdr, struct AttachCtx *actx);
void mutt_check_lookup_list(struct Body *b, char *type, size_t len);
int mutt_compose_attachment(struct Body *a);
int mutt_get_tmp_attachment(struct Body *a);
int mutt_pipe_attachment(FILE *fp, struct Body *b, const char *path, char *outfile);
int mutt_print_attachment(FILE *fp, struct Body *a);
-int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct Header *hdr);
+int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct Email *hdr);
#endif /* MUTT_MUTT_ATTACH_H */
* @param[out] new Set to true if this is a new label
* @retval true If the label was added
*/
-static bool label_message(struct Mailbox *mailbox, struct Header *hdr, char *new)
+static bool label_message(struct Mailbox *mailbox, struct Email *hdr, char *new)
{
if (!hdr)
return false;
*
* If hdr isn't given, then tagged messages will be labelled.
*/
-int mutt_label_message(struct Header *hdr)
+int mutt_label_message(struct Email *hdr)
{
char buf[LONG_STRING], *new = NULL;
int changed;
if (!message_is_tagged(Context, i))
continue;
- struct Header *h = Context->mailbox->hdrs[i];
+ struct Email *h = Context->mailbox->hdrs[i];
if (label_message(Context->mailbox, h, new))
{
changed++;
* @param fcc Buffer for the fcc field
* @param fcclen Length of buffer
*/
-void mutt_edit_headers(const char *editor, const char *body, struct Header *msg,
+void mutt_edit_headers(const char *editor, const char *body, struct Email *msg,
char *fcc, size_t fcclen)
{
char path[PATH_MAX]; /* tempfile used to edit headers + body */
* @param mailbox Mailbox
* @param hdr Header of message
*/
-void mutt_label_hash_add(struct Mailbox *mailbox, struct Header *hdr)
+void mutt_label_hash_add(struct Mailbox *mailbox, struct Email *hdr)
{
if (!mailbox || !mailbox->label_hash)
return;
* @param mailbox Mailbox
* @param hdr Header of message
*/
-void mutt_label_hash_remove(struct Mailbox *mailbox, struct Header *hdr)
+void mutt_label_hash_remove(struct Mailbox *mailbox, struct Email *hdr)
{
if (!mailbox || !mailbox->label_hash)
return;
#include <stddef.h>
struct Context;
-struct Header;
+struct Email;
-void mutt_edit_headers(const char *editor, const char *body, struct Header *msg, char *fcc, size_t fcclen);
-void mutt_label_hash_add(struct Mailbox *mailbox, struct Header *hdr);
-void mutt_label_hash_remove(struct Mailbox *mailbox, struct Header *hdr);
-int mutt_label_message(struct Header *hdr);
+void mutt_edit_headers(const char *editor, const char *body, struct Email *msg, char *fcc, size_t fcclen);
+void mutt_label_hash_add(struct Mailbox *mailbox, struct Email *hdr);
+void mutt_label_hash_remove(struct Mailbox *mailbox, struct Email *hdr);
+int mutt_label_message(struct Email *hdr);
void mutt_make_label_hash(struct Mailbox *mailbox);
#endif /* MUTT_MUTT_HEADER_H */
* @param ctx Mailbox
* @param cur Header of email
*/
-void mutt_parse_mime_message(struct Context *ctx, struct Header *cur)
+void mutt_parse_mime_message(struct Context *ctx, struct Email *cur)
{
struct Message *msg = NULL;
* @param hdr Header of email
* @retval num Number of MIME Body parts
*/
-int mutt_count_body_parts(struct Context *ctx, struct Header *hdr)
+int mutt_count_body_parts(struct Context *ctx, struct Email *hdr)
{
bool keep_parts = false;
#define MUTT_MUTT_PARSE_H
struct Context;
-struct Header;
+struct Email;
-int mutt_count_body_parts(struct Context *ctx, struct Header *hdr);
-void mutt_parse_mime_message(struct Context *ctx, struct Header *cur);
+int mutt_count_body_parts(struct Context *ctx, struct Email *hdr);
+void mutt_parse_mime_message(struct Context *ctx, struct Email *cur);
#endif /* MUTT_MUTT_PARSE_H */
* @param ctx Mailbox
* @retval true If the message is not hidden in some way
*/
-static bool is_visible(struct Header *hdr, struct Context *ctx)
+static bool is_visible(struct Email *hdr, struct Context *ctx)
{
return hdr->virtual >= 0 || (hdr->collapsed && (!ctx->pattern || hdr->limited));
}
* @param hdr Header of email
* @retval true If the subject should be displayed
*/
-bool need_display_subject(struct Context *ctx, struct Header *hdr)
+bool need_display_subject(struct Context *ctx, struct Email *hdr)
{
struct MuttThread *tmp = NULL, *tree = hdr->thread;
static void linearize_tree(struct Context *ctx)
{
struct MuttThread *tree = ctx->tree;
- struct Header **array =
+ struct Email **array =
ctx->mailbox->hdrs + ((Sort & SORT_REVERSE) ? ctx->mailbox->msg_count - 1 : 0);
while (tree)
{
for (ptr = mutt_hash_find_bucket(ctx->mailbox->subj_hash, np->data); ptr; ptr = ptr->next)
{
- tmp = ((struct Header *) ptr->data)->thread;
+ tmp = ((struct Email *) ptr->data)->thread;
if (tmp != cur && /* don't match the same message */
!tmp->fake_thread && /* don't match pseudo threads */
tmp->message->subject_changed && /* only match interesting replies */
for (int i = 0; i < ctx->mailbox->msg_count; i++)
{
- struct Header *hdr = ctx->mailbox->hdrs[i];
+ struct Email *hdr = ctx->mailbox->hdrs[i];
if (hdr->env->real_subj)
mutt_hash_insert(hash, hdr->env->real_subj, hdr);
}
struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, bool init)
{
struct MuttThread **array = NULL, *sort_key = NULL, *top = NULL, *tmp = NULL;
- struct Header *oldsort_key = NULL;
+ struct Email *oldsort_key = NULL;
int i, array_size, sort_top = 0;
/* we put things into the array backwards to save some cycles,
*/
static void check_subjects(struct Context *ctx, bool init)
{
- struct Header *cur = NULL;
+ struct Email *cur = NULL;
struct MuttThread *tmp = NULL;
for (int i = 0; i < ctx->mailbox->msg_count; i++)
{
*/
void mutt_sort_threads(struct Context *ctx, bool init)
{
- struct Header *cur = NULL;
+ struct Email *cur = NULL;
int i, oldsort, using_refs = 0;
struct MuttThread *thread = NULL, *new = NULL, *tmp = NULL, top;
memset(&top, 0, sizeof(top));
* @param subthreads Search subthreads: 'true' subthread, 'false' not
* @retval num Index into the virtual email table
*/
-int mutt_aside_thread(struct Header *hdr, bool forwards, bool subthreads)
+int mutt_aside_thread(struct Email *hdr, bool forwards, bool subthreads)
{
struct MuttThread *cur = NULL;
- struct Header *tmp = NULL;
+ struct Email *tmp = NULL;
if ((Sort & SORT_MASK) != SORT_THREADS)
{
* @retval >=0 Virtual index number of parent/root message
* @retval -1 Error
*/
-int mutt_parent_message(struct Context *ctx, struct Header *hdr, bool find_root)
+int mutt_parent_message(struct Context *ctx, struct Email *hdr, bool find_root)
{
struct MuttThread *thread = NULL;
- struct Header *parent = NULL;
+ struct Email *parent = NULL;
if ((Sort & SORT_MASK) != SORT_THREADS)
{
*/
void mutt_set_virtual(struct Context *ctx)
{
- struct Header *cur = NULL;
+ struct Email *cur = NULL;
ctx->mailbox->vcount = 0;
ctx->vsize = 0;
* @param flag Flag to set, e.g. #MUTT_THREAD_NEXT_UNREAD
* @retval num Number of matches
*/
-int mutt_traverse_thread(struct Context *ctx, struct Header *cur, int flag)
+int mutt_traverse_thread(struct Context *ctx, struct Email *cur, int flag)
{
struct MuttThread *thread = NULL, *top = NULL;
- struct Header *roothdr = NULL;
+ struct Email *roothdr = NULL;
int final, reverse = (Sort & SORT_REVERSE), minmsgno;
int num_hidden = 0, new = 0, old = 0;
bool flagged = false;
* If flag is 0, we want to know how many messages are in the thread.
* If flag is 1, we want to know our position in the thread.
*/
-int mutt_messages_in_thread(struct Context *ctx, struct Header *hdr, int flag)
+int mutt_messages_in_thread(struct Context *ctx, struct Email *hdr, int flag)
{
struct MuttThread *threads[2];
int rc;
for (int i = 0; i < mailbox->msg_count; i++)
{
- struct Header *hdr = mailbox->hdrs[i];
+ struct Email *hdr = mailbox->hdrs[i];
if (hdr->env->message_id)
mutt_hash_insert(hash, hdr->env->message_id, hdr);
}
* @param ctx Mailbox
* @retval true On success
*/
-static bool link_threads(struct Header *parent, struct Header *child, struct Context *ctx)
+static bool link_threads(struct Email *parent, struct Email *child, struct Context *ctx)
{
if (child == parent)
return false;
*
* if last is omitted, all the tagged threads will be used.
*/
-int mutt_link_threads(struct Header *cur, struct Header *last, struct Context *ctx)
+int mutt_link_threads(struct Email *cur, struct Email *last, struct Context *ctx)
{
bool changed = false;
#include <stdbool.h>
struct Context;
-struct Header;
+struct Email;
struct Mailbox;
struct MuttThread;
#define MUTT_THREAD_NEXT_UNREAD (1 << 4)
#define MUTT_THREAD_FLAGGED (1 << 5)
-int mutt_aside_thread(struct Header *hdr, bool forwards, bool subthreads);
+int mutt_aside_thread(struct Email *hdr, bool forwards, bool subthreads);
#define mutt_next_thread(x) mutt_aside_thread(x, true, false)
#define mutt_previous_thread(x) mutt_aside_thread(x, false, false)
#define mutt_next_subthread(x) mutt_aside_thread(x, true, true)
#define mutt_previous_subthread(x) mutt_aside_thread(x, false, true)
-int mutt_traverse_thread(struct Context *ctx, struct Header *cur, int flag);
+int mutt_traverse_thread(struct Context *ctx, struct Email *cur, int flag);
#define mutt_collapse_thread(x, y) mutt_traverse_thread(x, y, MUTT_THREAD_COLLAPSE)
#define mutt_uncollapse_thread(x, y) mutt_traverse_thread(x, y, MUTT_THREAD_UNCOLLAPSE)
#define mutt_get_hidden(x, y) mutt_traverse_thread(x, y, MUTT_THREAD_GET_HIDDEN)
#define mutt_thread_contains_flagged(x, y) mutt_traverse_thread(x, y, MUTT_THREAD_FLAGGED)
#define mutt_thread_next_unread(x, y) mutt_traverse_thread(x, y, MUTT_THREAD_NEXT_UNREAD)
-int mutt_link_threads(struct Header *cur, struct Header *last, struct Context *ctx);
-int mutt_messages_in_thread(struct Context *ctx, struct Header *hdr, int flag);
+int mutt_link_threads(struct Email *cur, struct Email *last, struct Context *ctx);
+int mutt_messages_in_thread(struct Context *ctx, struct Email *hdr, int flag);
void mutt_draw_tree(struct Context *ctx);
void mutt_clear_threads(struct Context *ctx);
struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, bool init);
void mutt_sort_threads(struct Context *ctx, bool init);
-int mutt_parent_message(struct Context *ctx, struct Header *hdr, bool find_root);
+int mutt_parent_message(struct Context *ctx, struct Email *hdr, bool find_root);
void mutt_set_virtual(struct Context *ctx);
struct Hash *mutt_make_id_hash(struct Mailbox *mailbox);
struct Address *alias = mutt_alias_lookup(buf + 1);
if (alias)
{
- struct Header *h = mutt_header_new();
+ struct Email *h = mutt_email_new();
h->env = mutt_env_new();
h->env->from = alias;
h->env->to = alias;
mutt_default_save(p, sizeof(p), h);
h->env->from = NULL;
h->env->to = NULL;
- mutt_header_free(&h);
+ mutt_email_free(&h);
/* Avoid infinite recursion if the resulting folder starts with '@' */
if (*p != '@')
recurse = true;
mutt_hash_destroy(&ctx->mailbox->label_hash);
mutt_clear_threads(ctx);
for (int i = 0; i < ctx->mailbox->msg_count; i++)
- mutt_header_free(&ctx->mailbox->hdrs[i]);
+ mutt_email_free(&ctx->mailbox->hdrs[i]);
FREE(&ctx->mailbox->hdrs);
FREE(&ctx->mailbox->v2r);
FREE(&ctx->pattern);
*/
if (ctx->last_tag == ctx->mailbox->hdrs[i])
ctx->last_tag = NULL;
- mutt_header_free(&ctx->mailbox->hdrs[i]);
+ mutt_email_free(&ctx->mailbox->hdrs[i]);
}
}
ctx->mailbox->msg_count = j;
* @param flags Flags, e.g. #MUTT_SET_DRAFT
* @retval ptr New Message
*/
-struct Message *mx_msg_open_new(struct Context *ctx, struct Header *hdr, int flags)
+struct Message *mx_msg_open_new(struct Context *ctx, struct Email *hdr, int flags)
{
struct Address *p = NULL;
struct Message *msg = NULL;
*/
void mx_alloc_memory(struct Mailbox *mailbox)
{
- size_t s = MAX(sizeof(struct Header *), sizeof(int));
+ size_t s = MAX(sizeof(struct Email *), sizeof(int));
if ((mailbox->hdrmax + 25) * s < mailbox->hdrmax * s)
{
if (mailbox->hdrs)
{
- mutt_mem_realloc(&mailbox->hdrs, sizeof(struct Header *) * (mailbox->hdrmax += 25));
+ mutt_mem_realloc(&mailbox->hdrs, sizeof(struct Email *) * (mailbox->hdrmax += 25));
mutt_mem_realloc(&mailbox->v2r, sizeof(int) * mailbox->hdrmax);
}
else
{
- mailbox->hdrs = mutt_mem_calloc((mailbox->hdrmax += 25), sizeof(struct Header *));
+ mailbox->hdrs = mutt_mem_calloc((mailbox->hdrmax += 25), sizeof(struct Email *));
mailbox->v2r = mutt_mem_calloc(mailbox->hdrmax, sizeof(int));
}
for (int i = mailbox->msg_count; i < mailbox->hdrmax; i++)
*/
void mx_update_context(struct Context *ctx, int new_messages)
{
- struct Header *h = NULL;
+ struct Email *h = NULL;
for (int msgno = ctx->mailbox->msg_count - new_messages;
msgno < ctx->mailbox->msg_count; msgno++)
{
if (h->env->supersedes)
{
- struct Header *h2 = NULL;
+ struct Email *h2 = NULL;
if (!ctx->mailbox->id_hash)
ctx->mailbox->id_hash = mutt_make_id_hash(ctx->mailbox);
* @retval 0 Success
* @retval -1 Failure
*/
-int mx_tags_commit(struct Context *ctx, struct Header *hdr, char *tags)
+int mx_tags_commit(struct Context *ctx, struct Email *hdr, char *tags)
{
if (ctx->mailbox->mx_ops->tags_commit)
return ctx->mailbox->mx_ops->tags_commit(ctx, hdr, tags);
if (!alias)
break;
- struct Header *h = mutt_header_new();
+ struct Email *h = mutt_email_new();
h->env = mutt_env_new();
h->env->from = alias;
h->env->to = alias;
mutt_default_save(buf, buflen, h);
h->env->from = NULL;
h->env->to = NULL;
- mutt_header_free(&h);
+ mutt_email_free(&h);
break;
}
else
#include "hcache/hcache.h"
#endif
-struct Header;
+struct Email;
struct Context;
struct Mailbox;
struct stat;
* @retval 0 Success
* @retval -1 Failure
*/
- int (*msg_open_new) (struct Context *ctx, struct Message *msg, struct Header *hdr);
+ int (*msg_open_new) (struct Context *ctx, struct Message *msg, struct Email *hdr);
/**
* msg_commit - Save changes to an email
* @param ctx Mailbox
* @retval 0 Success
* @retval -1 Failure
*/
- int (*tags_commit) (struct Context *ctx, struct Header *hdr, char *buf);
+ int (*tags_commit) (struct Context *ctx, struct Email *hdr, char *buf);
/**
* path_probe - Does this mailbox type recognise this path?
* @param path Path to examine
int mx_mbox_sync (struct Context *ctx, int *index_hint);
int mx_msg_close (struct Context *ctx, struct Message **msg);
int mx_msg_commit (struct Context *ctx, struct Message *msg);
-struct Message *mx_msg_open_new (struct Context *ctx, struct Header *hdr, int flags);
+struct Message *mx_msg_open_new (struct Context *ctx, struct Email *hdr, int flags);
struct Message *mx_msg_open (struct Context *ctx, int msgno);
int mx_msg_padding_size(struct Context *ctx);
int mx_path_canon (char *buf, size_t buflen, const char *folder);
int mx_path_parent (char *buf, size_t buflen);
int mx_path_pretty (char *buf, size_t buflen, const char *folder);
int mx_path_probe (const char *path, const struct stat *st);
-int mx_tags_commit (struct Context *ctx, struct Header *hdr, char *tags);
+int mx_tags_commit (struct Context *ctx, struct Email *hdr, char *tags);
int mx_tags_edit (struct Context *ctx, const char *tags, char *buf, size_t buflen);
int mx_access(const char *path, int flags);
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_protect(struct Header *msg, char *keylist)
+int mutt_protect(struct Email *msg, char *keylist)
{
struct Body *pbody = NULL, *tmp_pbody = NULL;
struct Body *tmp_smime_pbody = NULL;
*
* The extracted keys will be added to the user's keyring.
*/
-void crypt_extract_keys_from_messages(struct Header *h)
+void crypt_extract_keys_from_messages(struct Email *h)
{
char tempfname[PATH_MAX], *mbox = NULL;
struct Address *tmp = NULL;
if (!message_is_tagged(Context, i))
continue;
- struct Header *hi = Context->mailbox->hdrs[i];
+ struct Email *hi = Context->mailbox->hdrs[i];
mutt_parse_mime_message(Context, hi);
if (hi->security & ENCRYPT && !crypt_valid_passphrase(hi->security))
* If oppenc_mode is true, only keys that can be determined without
* prompting will be used.
*/
-int crypt_get_keys(struct Header *msg, char **keylist, bool oppenc_mode)
+int crypt_get_keys(struct Email *msg, char **keylist, bool oppenc_mode)
{
struct Address *addrlist = NULL, *last = NULL;
const char *fqdn = mutt_fqdn(true);
* Check if all recipients keys can be automatically determined.
* Enable encryption if they can, otherwise disable encryption.
*/
-void crypt_opportunistic_encrypt(struct Header *msg)
+void crypt_opportunistic_encrypt(struct Email *msg)
{
char *pgpkeylist = NULL;
* @param is_smime True if an SMIME message
* @retval num Flags, e.g. #APPLICATION_SMIME | #ENCRYPT
*/
-static int gpgme_send_menu(struct Header *msg, int is_smime)
+static int gpgme_send_menu(struct Email *msg, int is_smime)
{
struct CryptKeyInfo *p = NULL;
const char *prompt = NULL;
/**
* pgp_gpgme_send_menu - Implements CryptModuleSpecs::send_menu()
*/
-int pgp_gpgme_send_menu(struct Header *msg)
+int pgp_gpgme_send_menu(struct Email *msg)
{
return gpgme_send_menu(msg, 0);
}
/**
* smime_gpgme_send_menu - Implements CryptModuleSpecs::send_menu()
*/
-int smime_gpgme_send_menu(struct Header *msg)
+int smime_gpgme_send_menu(struct Email *msg)
{
return gpgme_send_menu(msg, 1);
}
* @param h Header of the email
* @retval true If sender is verified
*/
-static bool verify_sender(struct Header *h)
+static bool verify_sender(struct Email *h)
{
struct Address *sender = NULL;
bool rc = true;
/**
* smime_gpgme_verify_sender - Implements CryptModuleSpecs::smime_verify_sender()
*/
-int smime_gpgme_verify_sender(struct Header *h)
+int smime_gpgme_verify_sender(struct Email *h)
{
return verify_sender(h);
}
struct Address;
struct Body;
-struct Header;
+struct Email;
struct State;
void pgp_gpgme_set_sender(const char *sender);
void pgp_gpgme_init(void);
void pgp_gpgme_invoke_import(const char *fname);
struct Body *pgp_gpgme_make_key_attachment(void);
-int pgp_gpgme_send_menu(struct Header *msg);
+int pgp_gpgme_send_menu(struct Email *msg);
struct Body *pgp_gpgme_sign_message(struct Body *a);
int pgp_gpgme_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile);
int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur);
char * smime_gpgme_find_keys(struct Address *addrlist, bool oppenc_mode);
void smime_gpgme_init(void);
-int smime_gpgme_send_menu(struct Header *msg);
+int smime_gpgme_send_menu(struct Email *msg);
struct Body *smime_gpgme_sign_message(struct Body *a);
int smime_gpgme_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile);
-int smime_gpgme_verify_sender(struct Header *h);
+int smime_gpgme_verify_sender(struct Email *h);
const char *mutt_gpgme_print_version(void);
struct Address;
struct Body;
struct Envelope;
-struct Header;
+struct Email;
struct State;
/**
* @param msg Header of the email
* @retval num Flags, e.g. #APPLICATION_PGP | #ENCRYPT
*/
- int (*send_menu)(struct Header *msg);
+ int (*send_menu)(struct Email *msg);
/**
* set_sender - Set the sender of the email
* @param sender Email address
* @retval 0 Success
* @retval 1 Failure
*/
- int (*smime_verify_sender)(struct Header *h);
+ int (*smime_verify_sender)(struct Email *h);
/**
* smime_build_smime_entity - Encrypt the email body to all recipients
* @param a Body of email
struct Address;
struct Body;
struct Envelope;
-struct Header;
+struct Email;
struct State;
/* These Config Variables are only used in ncrypt/cryptglue.c */
/**
* crypt_pgp_send_menu - Wrapper for CryptModuleSpecs::send_menu()
*/
-int crypt_pgp_send_menu(struct Header *msg)
+int crypt_pgp_send_menu(struct Email *msg)
{
if (CRYPT_MOD_CALL_CHECK(PGP, send_menu))
return CRYPT_MOD_CALL(PGP, send_menu)(msg);
/**
* crypt_smime_verify_sender - Wrapper for CryptModuleSpecs::smime_verify_sender()
*/
-int crypt_smime_verify_sender(struct Header *h)
+int crypt_smime_verify_sender(struct Email *h)
{
if (CRYPT_MOD_CALL_CHECK(SMIME, smime_verify_sender))
return CRYPT_MOD_CALL(SMIME, smime_verify_sender)(h);
/**
* crypt_smime_send_menu - Wrapper for CryptModuleSpecs::send_menu()
*/
-int crypt_smime_send_menu(struct Header *msg)
+int crypt_smime_send_menu(struct Email *msg)
{
if (CRYPT_MOD_CALL_CHECK(SMIME, send_menu))
return CRYPT_MOD_CALL(SMIME, send_menu)(msg);
struct Address;
struct Body;
struct Envelope;
-struct Header;
+struct Email;
struct State;
/* These Config Variables are only used in ncrypt/crypt.c */
#define KEYFLAG_ABILITIES (KEYFLAG_CANSIGN | KEYFLAG_CANENCRYPT | KEYFLAG_PREFER_ENCRYPTION | KEYFLAG_PREFER_SIGNING)
/* crypt.c */
-void crypt_extract_keys_from_messages(struct Header *h);
+void crypt_extract_keys_from_messages(struct Email *h);
void crypt_forget_passphrase(void);
-int crypt_get_keys(struct Header *msg, char **keylist, bool oppenc_mode);
-void crypt_opportunistic_encrypt(struct Header *msg);
+int crypt_get_keys(struct Email *msg, char **keylist, bool oppenc_mode);
+void crypt_opportunistic_encrypt(struct Email *msg);
int crypt_query(struct Body *m);
int crypt_valid_passphrase(int flags);
int mutt_is_application_pgp(struct Body *m);
int mutt_is_multipart_encrypted(struct Body *b);
int mutt_is_multipart_signed(struct Body *b);
int mutt_is_valid_multipart_pgp_encrypted(struct Body *b);
-int mutt_protect(struct Header *msg, char *keylist);
+int mutt_protect(struct Email *msg, char *keylist);
int mutt_signed_handler(struct Body *a, struct State *s);
/* cryptglue.c */
void crypt_pgp_extract_key_from_attachment(FILE *fp, struct Body *top);
void crypt_pgp_invoke_getkeys(struct Address *addr);
struct Body *crypt_pgp_make_key_attachment(void);
-int crypt_pgp_send_menu(struct Header *msg);
+int crypt_pgp_send_menu(struct Email *msg);
int crypt_smime_application_handler(struct Body *m, struct State *s);
int crypt_smime_decrypt_mime(FILE *a, FILE **b, struct Body *c, struct Body **d);
void crypt_smime_getkeys(struct Envelope *env);
-int crypt_smime_send_menu(struct Header *msg);
-int crypt_smime_verify_sender(struct Header *h);
+int crypt_smime_send_menu(struct Email *msg);
+int crypt_smime_verify_sender(struct Email *h);
/* crypt_mod.c */
void crypto_module_free(void);
/**
* pgp_class_send_menu - Implements CryptModuleSpecs::send_menu()
*/
-int pgp_class_send_menu(struct Header *msg)
+int pgp_class_send_menu(struct Email *msg)
{
struct PgpKeyInfo *p = NULL;
const char *prompt = NULL;
struct Address;
struct Body;
-struct Header;
+struct Email;
struct PgpKeyInfo;
struct State;
struct Body *pgp_class_encrypt_message(struct Body *a, char *keylist, bool sign);
struct Body *pgp_class_sign_message(struct Body *a);
-int pgp_class_send_menu(struct Header *msg);
+int pgp_class_send_menu(struct Email *msg);
#endif /* MUTT_NCRYPT_PGP_H */
/**
* smime_class_verify_sender - Implements CryptModuleSpecs::smime_verify_sender()
*/
-int smime_class_verify_sender(struct Header *h)
+int smime_class_verify_sender(struct Email *h)
{
char *mbox = NULL, *certfile = NULL, tempfname[PATH_MAX];
int retval = 1;
/**
* smime_class_send_menu - Implements CryptModuleSpecs::send_menu()
*/
-int smime_class_send_menu(struct Header *msg)
+int smime_class_send_menu(struct Email *msg)
{
struct SmimeKey *key = NULL;
const char *prompt = NULL;
struct Address;
struct Body;
struct Envelope;
-struct Header;
+struct Email;
struct State;
/**
char * smime_class_find_keys(struct Address *addrlist, bool oppenc_mode);
void smime_class_getkeys(struct Envelope *env);
void smime_class_invoke_import(char *infile, char *mailbox);
-int smime_class_send_menu(struct Header *msg);
+int smime_class_send_menu(struct Email *msg);
struct Body *smime_class_sign_message(struct Body *a);
int smime_class_valid_passphrase(void);
int smime_class_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile);
-int smime_class_verify_sender(struct Header *h);
+int smime_class_verify_sender(struct Email *h);
void smime_class_void_passphrase(void);
#endif /* MUTT_NCRYPT_SMIME_H */
* New = not read and not cached
* Old = not read but cached
*/
-void nntp_article_status(struct Mailbox *mailbox, struct Header *hdr, char *group, anum_t anum)
+void nntp_article_status(struct Mailbox *mailbox, struct Email *hdr, char *group, anum_t anum)
{
struct NntpData *nntp_data = mailbox->data;
*
* Update read flag and set article number if empty
*/
-static void nntp_parse_xref(struct Mailbox *mailbox, struct Header *hdr)
+static void nntp_parse_xref(struct Mailbox *mailbox, struct Email *hdr)
{
struct NntpData *nntp_data = mailbox->data;
struct FetchCtx *fc = data;
struct Context *ctx = fc->ctx;
struct NntpData *nntp_data = ctx->mailbox->data;
- struct Header *hdr = NULL;
+ struct Email *hdr = NULL;
char *header = NULL, *field = NULL;
bool save = true;
anum_t anum;
mx_alloc_memory(ctx->mailbox);
/* parse header */
- ctx->mailbox->hdrs[ctx->mailbox->msg_count] = mutt_header_new();
+ ctx->mailbox->hdrs[ctx->mailbox->msg_count] = mutt_email_new();
hdr = ctx->mailbox->hdrs[ctx->mailbox->msg_count];
hdr->env = mutt_rfc822_read_header(fp, hdr, false, false);
hdr->env->newsgroups = mutt_str_strdup(nntp_data->group);
if (hdata)
{
mutt_debug(2, "mutt_hcache_fetch %s\n", buf);
- mutt_header_free(&hdr);
+ mutt_email_free(&hdr);
hdr = mutt_hcache_restore(hdata);
ctx->mailbox->hdrs[ctx->mailbox->msg_count] = hdr;
mutt_hcache_free(fc->hc, &hdata);
nntp_data->last_loaded = anum;
}
else
- mutt_header_free(&hdr);
+ mutt_email_free(&hdr);
/* progress */
if (!ctx->mailbox->quiet)
{
struct NntpData *nntp_data = ctx->mailbox->data;
struct FetchCtx fc;
- struct Header *hdr = NULL;
+ struct Email *hdr = NULL;
char buf[HUGE_STRING];
int rc = 0;
int oldmsgcount = ctx->mailbox->msg_count;
/* skip header marked as deleted in cache */
if (hdr->deleted && !restore)
{
- mutt_header_free(&hdr);
+ mutt_email_free(&hdr);
if (nntp_data->bcache)
{
mutt_debug(2, "#2 mutt_bcache_del %s\n", buf);
}
/* parse header */
- ctx->mailbox->hdrs[ctx->mailbox->msg_count] = mutt_header_new();
+ ctx->mailbox->hdrs[ctx->mailbox->msg_count] = mutt_email_new();
hdr = ctx->mailbox->hdrs[ctx->mailbox->msg_count];
hdr->env = mutt_rfc822_read_header(fp, hdr, false, false);
hdr->received = hdr->date_sent;
if (nntp_data->last_message < nntp_data->last_loaded)
{
for (int i = 0; i < ctx->mailbox->msg_count; i++)
- mutt_header_free(&ctx->mailbox->hdrs[i]);
+ mutt_email_free(&ctx->mailbox->hdrs[i]);
ctx->mailbox->msg_count = 0;
ctx->tagged = 0;
unsigned char *messages = NULL;
char buf[16];
void *hdata = NULL;
- struct Header *hdr = NULL;
+ struct Email *hdr = NULL;
anum_t first = nntp_data->first_message;
if (NntpContext && nntp_data->last_message - first + 1 > NntpContext)
hdr->data = NULL;
deleted = hdr->deleted;
flagged = hdr->flagged;
- mutt_header_free(&hdr);
+ mutt_email_free(&hdr);
/* header marked as deleted, removing from context */
if (deleted)
{
mutt_set_flag(ctx, ctx->mailbox->hdrs[i], MUTT_TAG, 0);
- mutt_header_free(&ctx->mailbox->hdrs[i]);
+ mutt_email_free(&ctx->mailbox->hdrs[i]);
continue;
}
}
hdr->data = NULL;
if (hdr->deleted)
{
- mutt_header_free(&hdr);
+ mutt_email_free(&hdr);
if (nntp_data->bcache)
{
mutt_debug(2, "mutt_bcache_del %s\n", buf);
/* parse header */
if (ctx->mailbox->msg_count == ctx->mailbox->hdrmax)
mx_alloc_memory(ctx->mailbox);
- ctx->mailbox->hdrs[ctx->mailbox->msg_count] = mutt_header_new();
- struct Header *hdr = ctx->mailbox->hdrs[ctx->mailbox->msg_count];
+ ctx->mailbox->hdrs[ctx->mailbox->msg_count] = mutt_email_new();
+ struct Email *hdr = ctx->mailbox->hdrs[ctx->mailbox->msg_count];
hdr->data = mutt_mem_calloc(1, sizeof(struct NntpHeaderData));
hdr->env = mutt_rfc822_read_header(fp, hdr, false, false);
mutt_file_fclose(&fp);
snprintf(buf, sizeof(buf), "STAT %s\r\n", msgid);
if (nntp_query(nntp_data, buf, sizeof(buf)) < 0)
{
- mutt_header_free(&hdr);
+ mutt_email_free(&hdr);
return -1;
}
sscanf(buf + 4, ANUM, &NHDR(hdr)->article_num);
*/
int nntp_compare_order(const void *a, const void *b)
{
- struct Header **ha = (struct Header **) a;
- struct Header **hb = (struct Header **) b;
+ struct Email **ha = (struct Email **) a;
+ struct Email **hb = (struct Email **) b;
anum_t na = NHDR(*ha)->article_num;
anum_t nb = NHDR(*hb)->article_num;
for (int i = 0; i < ctx->mailbox->msg_count; i++)
{
- struct Header *hdr = ctx->mailbox->hdrs[i];
+ struct Email *hdr = ctx->mailbox->hdrs[i];
char buf[16];
snprintf(buf, sizeof(buf), "%d", NHDR(hdr)->article_num);
static int nntp_msg_open(struct Context *ctx, struct Message *msg, int msgno)
{
struct NntpData *nntp_data = ctx->mailbox->data;
- struct Header *hdr = ctx->mailbox->hdrs[msgno];
+ struct Email *hdr = ctx->mailbox->hdrs[msgno];
char article[16];
/* try to get article from cache */
#include "mx.h"
struct ConnAccount;
-struct Header;
+struct Email;
struct Context;
/* These Config Variables are only used in nntp/nntp.c */
const char *src, const char *prec, const char *if_str,
const char *else_str, unsigned long data, enum FormatFlag flags);
-void nntp_article_status(struct Mailbox *mailbox, struct Header *hdr, char *group, anum_t anum);
+void nntp_article_status(struct Mailbox *mailbox, struct Email *hdr, char *group, anum_t anum);
extern struct NntpServer *CurrentNewsSrv;
* @retval ptr ID string
* @retval NULL Error
*/
-static char *header_get_id(struct Header *h)
+static char *header_get_id(struct Email *h)
{
return (h && h->data) ? ((struct NmHdrData *) h->data)->virtual_id : NULL;
}
* @param buflen Length of the buffer
* @retval ptr Path string
*/
-static char *header_get_fullpath(struct Header *h, char *buf, size_t buflen)
+static char *header_get_fullpath(struct Email *h, char *buf, size_t buflen)
{
snprintf(buf, buflen, "%s/%s", nm_header_get_folder(h), h->path);
return buf;
* @retval 0 Success
* @retval 1 Tags unchanged
*/
-static int update_header_tags(struct Header *h, notmuch_message_t *msg)
+static int update_header_tags(struct Email *h, notmuch_message_t *msg)
{
struct NmHdrData *data = h->data;
char *new_tags = NULL;
* @retval 0 Success
* @retval 1 Failure
*/
-static int update_message_path(struct Header *h, const char *path)
+static int update_message_path(struct Email *h, const char *path)
{
struct NmHdrData *data = h->data;
* deinit_header - Free the Notmuch data
* @param h Email Header
*/
-static void deinit_header(struct Header *h)
+static void deinit_header(struct Email *h)
{
free_hdrdata(h->data);
h->data = NULL;
* @retval 0 Success
* @retval -1 Failure
*/
-static int init_header(struct Header *h, const char *path, notmuch_message_t *msg)
+static int init_header(struct Email *h, const char *path, notmuch_message_t *msg)
{
if (h->data)
return 0;
* @retval ptr Email Header
* @retval NULL Error
*/
-static struct Header *get_mutt_header(struct Mailbox *mailbox, notmuch_message_t *msg)
+static struct Email *get_mutt_header(struct Mailbox *mailbox, notmuch_message_t *msg)
{
if (!mailbox || !msg)
return NULL;
char *mid = nm2mutt_message_id(id);
mutt_debug(2, "nm: neomutt id='%s'\n", mid);
- struct Header *h = mutt_hash_find(mailbox->id_hash, mid);
+ struct Email *h = mutt_hash_find(mailbox->id_hash, mid);
FREE(&mid);
return h;
}
notmuch_message_t *msg, bool dedup)
{
char *newpath = NULL;
- struct Header *h = NULL;
+ struct Email *h = NULL;
struct NmMboxData *data = get_mboxdata(mailbox);
if (!data)
}
if (init_header(h, newpath ? newpath : path, msg) != 0)
{
- mutt_header_free(&h);
+ mutt_email_free(&h);
mutt_debug(1, "nm: failed to append header!\n");
goto done;
}
* @param hdr Email Header
* @retval ptr Handle to the Notmuch message
*/
-static notmuch_message_t *get_nm_message(notmuch_database_t *db, struct Header *hdr)
+static notmuch_message_t *get_nm_message(notmuch_database_t *db, struct Email *hdr)
{
notmuch_message_t *msg = NULL;
char *id = header_get_id(hdr);
* update_header_tags and update_header_flags, which are given an array of
* tags.
*/
-static int update_header_flags(struct Context *ctx, struct Header *hdr, const char *tags)
+static int update_header_flags(struct Context *ctx, struct Email *hdr, const char *tags)
{
char *buf = mutt_str_strdup(tags);
if (!buf)
* @retval 1 Success, no change
* @retval -1 Failure
*/
-static int rename_maildir_filename(const char *old, char *buf, size_t buflen,
- struct Header *h)
+static int rename_maildir_filename(const char *old, char *buf, size_t buflen, struct Email *h)
{
char filename[PATH_MAX];
char suffix[PATH_MAX];
* @retval -1 Failure
*/
static int rename_filename(struct NmMboxData *data, const char *old,
- const char *new, struct Header *h)
+ const char *new, struct Email *h)
{
notmuch_database_t *db = get_db(data, true);
if (!db || !new || !old || (access(new, F_OK) != 0))
* @retval ptr Folder containing email
* @retval NULL Error
*/
-char *nm_header_get_folder(struct Header *h)
+char *nm_header_get_folder(struct Email *h)
{
return (h && h->data) ? ((struct NmHdrData *) h->data)->folder : NULL;
}
* @retval 0 Success
* @retval -1 Failure
*/
-int nm_read_entire_thread(struct Context *ctx, struct Header *h)
+int nm_read_entire_thread(struct Context *ctx, struct Email *h)
{
struct NmMboxData *data = get_mboxdata(ctx->mailbox);
if (!data)
* @param hdr Email Header
* @retval true Message is still in query
*/
-bool nm_message_is_still_queried(struct Mailbox *mailbox, struct Header *hdr)
+bool nm_message_is_still_queried(struct Mailbox *mailbox, struct Email *hdr)
{
struct NmMboxData *data = get_mboxdata(mailbox);
notmuch_database_t *db = get_db(data, false);
* @retval -1 Failure
*/
int nm_update_filename(struct Mailbox *mailbox, const char *old,
- const char *new, struct Header *h)
+ const char *new, struct Email *h)
{
char buf[PATH_MAX];
struct NmMboxData *data = get_mboxdata(mailbox);
* @retval 0 Success
* @retval -1 Failure
*/
-int nm_record_message(struct Mailbox *mailbox, char *path, struct Header *h)
+int nm_record_message(struct Mailbox *mailbox, char *path, struct Email *h)
{
notmuch_database_t *db = NULL;
notmuch_status_t st;
const char *new = NULL;
notmuch_message_t *m = notmuch_messages_get(msgs);
- struct Header *h = get_mutt_header(ctx->mailbox, m);
+ struct Email *h = get_mutt_header(ctx->mailbox, m);
if (!h)
{
* this message, update the flags we just
* detected.
*/
- struct Header tmp = { 0 };
+ struct Email tmp = { 0 };
maildir_parse_flags(&tmp, new);
maildir_update_flags(ctx, h, &tmp);
}
for (int i = 0; i < ctx->mailbox->msg_count; i++)
{
char old[PATH_MAX], new[PATH_MAX];
- struct Header *h = ctx->mailbox->hdrs[i];
+ struct Email *h = ctx->mailbox->hdrs[i];
struct NmHdrData *hd = h->data;
if (!ctx->mailbox->quiet)
{
if (!ctx || !msg)
return 1;
- struct Header *cur = ctx->mailbox->hdrs[msgno];
+ struct Email *cur = ctx->mailbox->hdrs[msgno];
char path[PATH_MAX];
char *folder = nm_header_get_folder(cur);
/**
* nm_tags_commit - Implements MxOps::tags_commit()
*/
-static int nm_tags_commit(struct Context *ctx, struct Header *hdr, char *buf)
+static int nm_tags_commit(struct Context *ctx, struct Email *hdr, char *buf)
{
struct NmMboxData *data = get_mboxdata(ctx->mailbox);
if (!buf || !*buf || !data)
#include "mx.h"
struct Context;
-struct Header;
+struct Email;
/* These Config Variables are only used in notmuch/mutt_notmuch.c */
extern int NmDbLimit;
int nm_description_to_path (const char *desc, char *buf, size_t buflen);
int nm_get_all_tags (struct Mailbox *mailbox, char **tag_list, int *tag_count);
char *nm_get_description (struct Mailbox *mailbox);
-char *nm_header_get_folder (struct Header *h);
+char *nm_header_get_folder (struct Email *h);
void nm_longrun_done (struct Mailbox *mailbox);
void nm_longrun_init (struct Mailbox *mailbox, bool writable);
-bool nm_message_is_still_queried(struct Mailbox *mailbox, struct Header *hdr);
+bool nm_message_is_still_queried(struct Mailbox *mailbox, struct Email *hdr);
int nm_nonctx_get_count (char *path, int *all, int *new);
bool nm_normalize_uri (const char *uri, char *buf, size_t buflen);
int nm_path_probe (const char *path, const struct stat *st);
void nm_query_window_backward (void);
void nm_query_window_forward (void);
-int nm_read_entire_thread (struct Context *ctx, struct Header *h);
-int nm_record_message (struct Mailbox *mailbox, char *path, struct Header *h);
-int nm_update_filename (struct Mailbox *mailbox, const char *old, const char *new, struct Header *h);
+int nm_read_entire_thread (struct Context *ctx, struct Email *h);
+int nm_record_message (struct Mailbox *mailbox, char *path, struct Email *h);
+int nm_update_filename (struct Mailbox *mailbox, const char *old, const char *new, struct Email *h);
char *nm_uri_from_query (struct Mailbox *mailbox, char *buf, size_t buflen);
#endif /* MUTT_NOTMUCH_MUTT_NOTMUCH_H */
/* hack to return to position when returning from index to same message */
static int TopLine = 0;
-static struct Header *OldHdr = NULL;
+static struct Email *OldHdr = NULL;
#define CHECK_MODE(x) \
if (!(x)) \
{
for (i = oldcount; i < Context->mailbox->msg_count; i++)
{
- struct Header *h = Context->mailbox->hdrs[i];
+ struct Email *h = Context->mailbox->hdrs[i];
if (h && !h->read)
{
struct Pager
{
struct Context *ctx; /**< current mailbox */
- struct Header *hdr; /**< current message */
+ struct Email *hdr; /**< current message */
struct Body *bdy; /**< current attachment */
FILE *fp; /**< source stream */
struct AttachCtx *actx; /**< attachment information */
FILE *fp = NULL;
long lng = 0;
- struct Header *h = ctx->mailbox->hdrs[msgno];
+ struct Email *h = ctx->mailbox->hdrs[msgno];
#ifdef USE_FMEMOPEN
char *temp = NULL;
size_t tempsize;
* @retval true If ALL of the Patterns evaluates to true
*/
static bool perform_and(struct Pattern *pat, enum PatternExecFlag flags,
- struct Context *ctx, struct Header *hdr, struct PatternCache *cache)
+ struct Context *ctx, struct Email *hdr, struct PatternCache *cache)
{
for (; pat; pat = pat->next)
if (mutt_pattern_exec(pat, flags, ctx, hdr, cache) <= 0)
* @retval true If ONE (or more) of the Patterns evaluates to true
*/
static int perform_or(struct Pattern *pat, enum PatternExecFlag flags,
- struct Context *ctx, struct Header *hdr, struct PatternCache *cache)
+ struct Context *ctx, struct Email *hdr, struct PatternCache *cache)
{
for (; pat; pat = pat->next)
if (mutt_pattern_exec(pat, flags, ctx, hdr, cache) > 0)
int left, int up, int right, int down)
{
int a;
- struct Header *h = NULL;
+ struct Email *h = NULL;
if (!t)
return 0;
* @retval 0 Pattern did not match
*/
static int match_mime_content_type(const struct Pattern *pat,
- struct Context *ctx, struct Header *hdr)
+ struct Context *ctx, struct Email *hdr)
{
mutt_parse_mime_message(ctx, hdr);
return match_content_type(pat, hdr->content);
* store some of the cacheable pattern matches in this structure.
*/
int mutt_pattern_exec(struct Pattern *pat, enum PatternExecFlag flags,
- struct Context *ctx, struct Header *h, struct PatternCache *cache)
+ struct Context *ctx, struct Email *h, struct PatternCache *cache)
{
int result;
int *cache_entry = NULL;
* @retval ptr Success, email found
* @retval NULL Error
*/
-static struct MuttThread *top_of_thread(struct Header *h)
+static struct MuttThread *top_of_thread(struct Email *h)
{
struct MuttThread *t = NULL;
* @retval true Success
* @retval false Failure
*/
-bool mutt_limit_current_thread(struct Header *h)
+bool mutt_limit_current_thread(struct Email *h)
{
struct MuttThread *me = NULL;
}
}
- struct Header *h = Context->mailbox->hdrs[Context->mailbox->v2r[i]];
+ struct Email *h = Context->mailbox->hdrs[Context->mailbox->v2r[i]];
if (h->searched)
{
/* if we've already evaluated this message, use the cached value */
struct Address;
struct Buffer;
-struct Header;
+struct Email;
struct Context;
/* These Config Variables are only used in pattern.c */
struct Pattern *mutt_pattern_new(void);
int mutt_pattern_exec(struct Pattern *pat, enum PatternExecFlag flags,
- struct Context *ctx, struct Header *h, struct PatternCache *cache);
+ struct Context *ctx, struct Email *h, struct PatternCache *cache);
struct Pattern *mutt_pattern_comp(/* const */ char *s, int flags, struct Buffer *err);
void mutt_check_simple(char *s, size_t len, const char *simple);
void mutt_pattern_free(struct Pattern **pat);
int mutt_pattern_func(int op, char *prompt);
int mutt_search_command(int cur, int op);
-bool mutt_limit_current_thread(struct Header *h);
+bool mutt_limit_current_thread(struct Email *h);
#endif /* MUTT_PATTERN_H */
email/address.c
email/attach.c
email/body.c
+email/email.c
email/email_globals.c
email/envelope.c
email/from.c
-email/header.c
email/idna.c
email/mime.c
email/parameter.c
* @retval -2 Invalid command or execution error
* @retval -3 Error writing to tempfile
*/
-static int pop_read_header(struct PopData *pop_data, struct Header *h)
+static int pop_read_header(struct PopData *pop_data, struct Email *h)
{
FILE *f = mutt_file_mkstemp();
if (!f)
mx_alloc_memory(mailbox);
mailbox->msg_count++;
- mailbox->hdrs[i] = mutt_header_new();
+ mailbox->hdrs[i] = mutt_email_new();
mailbox->hdrs[i]->data = mutt_str_strdup(line);
}
else if (mailbox->hdrs[i]->index != index - 1)
* (the old h->data should point inside a malloc'd block from
* hcache so there shouldn't be a memleak here)
*/
- struct Header *h = mutt_hcache_restore((unsigned char *) data);
+ struct Email *h = mutt_hcache_restore((unsigned char *) data);
mutt_hcache_free(hc, &data);
- mutt_header_free(&ctx->mailbox->hdrs[i]);
+ mutt_email_free(&ctx->mailbox->hdrs[i]);
ctx->mailbox->hdrs[i] = h;
ctx->mailbox->hdrs[i]->refno = refno;
ctx->mailbox->hdrs[i]->index = index;
if (ret < 0)
{
for (int i = ctx->mailbox->msg_count; i < new_count; i++)
- mutt_header_free(&ctx->mailbox->hdrs[i]);
+ mutt_email_free(&ctx->mailbox->hdrs[i]);
return ret;
}
char path[PATH_MAX];
struct Progress progressbar;
struct PopData *pop_data = ctx->mailbox->data;
- struct Header *h = ctx->mailbox->hdrs[msgno];
+ struct Email *h = ctx->mailbox->hdrs[msgno];
bool bcache = true;
/* see if we already have the message in body cache */
* select_msg - Create a Menu to select a postponed message
* @retval ptr Email Header
*/
-static struct Header *select_msg(void)
+static struct Email *select_msg(void)
{
int r = -1;
bool done = false;
* @retval 0 Normal exit
* @retval #SEND_REPLY Recalled message is a reply
*/
-int mutt_get_postponed(struct Context *ctx, struct Header *hdr,
- struct Header **cur, char *fcc, size_t fcclen)
+int mutt_get_postponed(struct Context *ctx, struct Email *hdr,
+ struct Email **cur, char *fcc, size_t fcclen)
{
- struct Header *h = NULL;
+ struct Email *h = NULL;
int code = SEND_POSTPONED;
const char *p = NULL;
int opt_delete;
* @retval 0 Success
* @retval -1 Error
*/
-int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr,
- struct Header *hdr, bool resend)
+int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Email *newhdr,
+ struct Email *hdr, bool resend)
{
struct Message *msg = NULL;
char file[PATH_MAX];
struct Context;
struct EnterState;
struct Envelope;
-struct Header;
+struct Email;
/**
* enum XdgType - XDG variable types
int mutt_set_xdg_path(enum XdgType type, char *buf, size_t bufsize);
void mutt_help(int menu);
void mutt_make_help(char *d, size_t dlen, const char *txt, int menu, int op);
-void mutt_set_flag_update(struct Context *ctx, struct Header *h, int flag, bool bf, bool upd_ctx);
+void mutt_set_flag_update(struct Context *ctx, struct Email *h, int flag, bool bf, bool upd_ctx);
#define mutt_set_flag(a, b, c, d) mutt_set_flag_update(a, b, c, d, true)
void mutt_signal_init(void);
void mutt_tag_set_flag(int flag, int bf);
-int mutt_change_flag(struct Header *h, int bf);
+int mutt_change_flag(struct Email *h, int bf);
int mutt_complete(char *buf, size_t buflen);
-int mutt_edit_message(struct Context *ctx, struct Header *hdr);
-int mutt_view_message(struct Context *ctx, struct Header *hdr);
-int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, struct Header *hdr, bool resend);
+int mutt_edit_message(struct Context *ctx, struct Email *hdr);
+int mutt_view_message(struct Context *ctx, struct Email *hdr);
+int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Email *newhdr, struct Email *hdr, bool resend);
int mutt_enter_string(char *buf, size_t buflen, int col, int flags);
int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, bool multiple,
char ***files, int *numfiles, struct EnterState *state);
-int mutt_get_postponed(struct Context *ctx, struct Header *hdr, struct Header **cur, char *fcc, size_t fcclen);
+int mutt_get_postponed(struct Context *ctx, struct Email *hdr, struct Email **cur, char *fcc, size_t fcclen);
int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app);
int mutt_num_postponed(bool force);
-int mutt_thread_set_flag(struct Header *hdr, int flag, int bf, int subthread);
+int mutt_thread_set_flag(struct Email *hdr, int flag, int bf, int subthread);
void mutt_update_num_postponed(void);
int url_parse_mailto(struct Envelope *e, char **body, const char *src);
int mutt_is_quote_line(char *buf, regmatch_t *pmatch);
static void query_menu(char *buf, size_t buflen, struct Query *results, bool retbuf)
{
struct Menu *menu = NULL;
- struct Header *msg = NULL;
+ struct Email *msg = NULL;
struct Entry *QueryTable = NULL;
struct Query *queryp = NULL;
char title[STRING];
}
/* fallthrough */
case OP_MAIL:
- msg = mutt_header_new();
+ msg = mutt_email_new();
msg->env = mutt_env_new();
if (!menu->tagprefix)
{
* @retval 0 Success
* @retval -1 Failure
*/
-static int query_save_attachment(FILE *fp, struct Body *body,
- struct Header *hdr, char **directory)
+static int query_save_attachment(FILE *fp, struct Body *body, struct Email *hdr, char **directory)
{
char *prompt = NULL;
char buf[PATH_MAX], tfile[PATH_MAX];
* @param menu Menu listing attachments
*/
void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag,
- struct Body *top, struct Header *hdr, struct Menu *menu)
+ struct Body *top, struct Email *hdr, struct Menu *menu)
{
char buf[PATH_MAX], tfile[PATH_MAX];
char *directory = NULL;
* @param hdr Header of the email
*/
static void recvattach_edit_content_type(struct AttachCtx *actx,
- struct Menu *menu, struct Header *hdr)
+ struct Menu *menu, struct Email *hdr)
{
if (mutt_edit_content_type(hdr, CURATTACH->content, CURATTACH->fp) != 1)
return;
* @param recv true if these are received attachments (rather than in compose)
* @retval num Operation performed
*/
-int mutt_attach_display_loop(struct Menu *menu, int op, struct Header *hdr,
+int mutt_attach_display_loop(struct Menu *menu, int op, struct Email *hdr,
struct AttachCtx *actx, bool recv)
{
do
* @param level Attachment depth
* @param decrypted True if attachment has been decrypted
*/
-static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Header *hdr,
+static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Email *hdr,
struct Body *m, FILE *fp, int parent_type,
int level, bool decrypted)
{
* mutt_view_attachments - Show the attachments in a Menu
* @param hdr Header of the email
*/
-void mutt_view_attachments(struct Header *hdr)
+void mutt_view_attachments(struct Email *hdr)
{
char helpstr[LONG_STRING];
struct Body *cur = NULL;
#include "format_flags.h"
struct AttachCtx;
-struct Header;
+struct Email;
/* These Config Variables are only used in recvattach.c */
extern char *AttachSep;
void mutt_update_tree(struct AttachCtx *actx);
const char *attach_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, unsigned long data, enum FormatFlag flags);
-void mutt_view_attachments(struct Header *hdr);
+void mutt_view_attachments(struct Email *hdr);
#endif /* MUTT_RECVATTACH_H */
* @param ofp File to write to
* @param prefix Prefix for each line (OPTIONAL)
*/
-static void include_header(bool quote, FILE *ifp, struct Header *hdr, FILE *ofp, char *prefix)
+static void include_header(bool quote, FILE *ifp, struct Email *hdr, FILE *ofp, char *prefix)
{
int chflags = CH_DECODE;
char prefix2[SHORT_STRING];
*
* (non-message types)
*/
-static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
+static void attach_forward_bodies(FILE *fp, struct Email *hdr, struct AttachCtx *actx,
struct Body *cur, short nattach)
{
bool mime_fwd_all = false;
bool mime_fwd_any = true;
- struct Header *parent_hdr = NULL;
+ struct Email *parent_hdr = NULL;
FILE *parent_fp = NULL;
char tmpbody[PATH_MAX];
char prefix[STRING];
parent_fp = actx->root_fp;
}
- struct Header *tmphdr = mutt_header_new();
+ struct Email *tmphdr = mutt_email_new();
tmphdr->env = mutt_env_new();
mutt_make_forward_subject(tmphdr->env, Context, parent_hdr);
if (!tmpfp)
{
mutt_error(_("Can't open temporary file %s"), tmpbody);
- mutt_header_free(&tmphdr);
+ mutt_email_free(&tmphdr);
return;
}
mutt_file_unlink(tmpbody);
}
- mutt_header_free(&tmphdr);
+ mutt_email_free(&tmphdr);
}
/**
*/
static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx, struct Body *cur, int flags)
{
- struct Header *curhdr = NULL;
- struct Header *tmphdr = NULL;
+ struct Email *curhdr = NULL;
+ struct Email *tmphdr = NULL;
int rc;
struct Body **last = NULL;
}
}
- tmphdr = mutt_header_new();
+ tmphdr = mutt_email_new();
tmphdr->env = mutt_env_new();
mutt_make_forward_subject(tmphdr->env, Context, curhdr);
if (!tmpfp)
{
mutt_error(_("Can't create %s"), tmpbody);
- mutt_header_free(&tmphdr);
+ mutt_email_free(&tmphdr);
return;
}
}
}
else
- mutt_header_free(&tmphdr);
+ mutt_email_free(&tmphdr);
ci_send_message(flags, tmphdr, *tmpbody ? tmpbody : NULL, NULL, curhdr);
}
* @param cur Current message
* @param flags Send mode, e.g. #SEND_RESEND
*/
-void mutt_attach_forward(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
+void mutt_attach_forward(FILE *fp, struct Email *hdr, struct AttachCtx *actx,
struct Body *cur, int flags)
{
if (check_all_msg(actx, cur, false))
* Note that this code is horribly similar to envelope_defaults() from send.c.
*/
static int attach_reply_envelope_defaults(struct Envelope *env, struct AttachCtx *actx,
- struct Header *parent, int flags)
+ struct Email *parent, int flags)
{
struct Envelope *curenv = NULL;
- struct Header *curhdr = NULL;
+ struct Email *curhdr = NULL;
if (!parent)
{
* @param tmpfp File handle to temporary file
* @param cur Header of email
*/
-static void attach_include_reply(FILE *fp, FILE *tmpfp, struct Header *cur)
+static void attach_include_reply(FILE *fp, FILE *tmpfp, struct Email *cur)
{
int cmflags = MUTT_CM_PREFIX | MUTT_CM_DECODE | MUTT_CM_CHARCONV;
int chflags = CH_DECODE;
* @param cur Current message
* @param flags Send mode, e.g. #SEND_RESEND
*/
-void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
+void mutt_attach_reply(FILE *fp, struct Email *hdr, struct AttachCtx *actx,
struct Body *cur, int flags)
{
bool mime_reply_any = false;
short nattach = 0;
struct AttachPtr *parent = NULL;
- struct Header *parent_hdr = NULL;
+ struct Email *parent_hdr = NULL;
FILE *parent_fp = NULL;
- struct Header *tmphdr = NULL;
+ struct Email *tmphdr = NULL;
struct State st;
char tmpbody[PATH_MAX];
else if (nattach == 1)
mime_reply_any = true;
- tmphdr = mutt_header_new();
+ tmphdr = mutt_email_new();
tmphdr->env = mutt_env_new();
if (attach_reply_envelope_defaults(
tmphdr->env, actx, parent_hdr ? parent_hdr : (cur ? cur->hdr : NULL), flags) == -1)
{
- mutt_header_free(&tmphdr);
+ mutt_email_free(&tmphdr);
return;
}
if (!tmpfp)
{
mutt_error(_("Can't create %s"), tmpbody);
- mutt_header_free(&tmphdr);
+ mutt_email_free(&tmphdr);
return;
}
if (mime_reply_any && !cur && !copy_problematic_attachments(&tmphdr->content, actx, false))
{
- mutt_header_free(&tmphdr);
+ mutt_email_free(&tmphdr);
mutt_file_fclose(&tmpfp);
return;
}
* @param actx Attachment Context
* @param cur Current attachment
*/
-void mutt_attach_mail_sender(FILE *fp, struct Header *hdr,
+void mutt_attach_mail_sender(FILE *fp, struct Email *hdr,
struct AttachCtx *actx, struct Body *cur)
{
if (!check_all_msg(actx, cur, 0))
return;
}
- struct Header *tmphdr = mutt_header_new();
+ struct Email *tmphdr = mutt_email_new();
tmphdr->env = mutt_env_new();
if (cur)
struct AttachCtx;
struct Body;
-struct Header;
+struct Email;
/* These Config Variables are only used in recvcmd.c */
extern unsigned char MimeForwardRest;
void mutt_attach_bounce(FILE *fp, struct AttachCtx *actx, struct Body *cur);
void mutt_attach_resend(FILE *fp, struct AttachCtx *actx, struct Body *cur);
-void mutt_attach_forward(FILE *fp, struct Header *hdr, struct AttachCtx *actx, struct Body *cur, int flags);
-void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx, struct Body *cur, int flags);
-void mutt_attach_mail_sender(FILE *fp, struct Header *hdr, struct AttachCtx *actx, struct Body *cur);
+void mutt_attach_forward(FILE *fp, struct Email *hdr, struct AttachCtx *actx, struct Body *cur, int flags);
+void mutt_attach_reply(FILE *fp, struct Email *hdr, struct AttachCtx *actx, struct Body *cur, int flags);
+void mutt_attach_mail_sender(FILE *fp, struct Email *hdr, struct AttachCtx *actx, struct Body *cur);
#endif /* MUTT_RECVCMD_H */
* @retval 0 Success
* @retval -1 Error
*/
-int mix_check_message(struct Header *msg)
+int mix_check_message(struct Email *msg)
{
const char *fqdn = NULL;
bool need_hostname = false;
#include <stddef.h>
struct ListHead;
-struct Header;
+struct Email;
/* These Config Variables are only used in remailer.c */
extern char *MixEntryFormat;
};
int mix_send_message(struct ListHead *chain, const char *tempfile);
-int mix_check_message(struct Header *msg);
+int mix_check_message(struct Email *msg);
void mix_make_chain(struct ListHead *chainhead);
#endif /* MUTT_REMAILER_H */
* freshly created copy in a tempfile and modifies the file's mtime so we don't
* trigger code paths watching for mtime changes
*/
-void rfc3676_space_stuff(struct Header *hdr)
+void rfc3676_space_stuff(struct Email *hdr)
{
int lc = 0;
size_t len = 0;
#include <stdbool.h>
struct Body;
-struct Header;
+struct Email;
struct State;
/* These Config Variables are only used in rfc3676.c */
extern short ReflowWrap;
int rfc3676_handler(struct Body *a, struct State *s);
-void rfc3676_space_stuff(struct Header *hdr);
+void rfc3676_space_stuff(struct Email *hdr);
#endif /* MUTT_RFC3676_H */
* @param hdr Email header
* @param upd_ctx If true, update the Context too
*/
-void mutt_score_message(struct Context *ctx, struct Header *hdr, bool upd_ctx)
+void mutt_score_message(struct Context *ctx, struct Email *hdr, bool upd_ctx)
{
struct Score *tmp = NULL;
struct PatternCache cache = { 0 };
#include <stdbool.h>
struct Buffer;
-struct Header;
+struct Email;
struct Context;
/* These Config Variables are only used in score.c */
void mutt_check_rescore(struct Context *ctx);
int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
int mutt_parse_unscore(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
-void mutt_score_message(struct Context *ctx, struct Header *hdr, bool upd_ctx);
+void mutt_score_message(struct Context *ctx, struct Email *hdr, bool upd_ctx);
#endif /* MUTT_SCORE_H */
* @param cur Header of email
* @param fp File to write to
*/
-void mutt_forward_intro(struct Context *ctx, struct Header *cur, FILE *fp)
+void mutt_forward_intro(struct Context *ctx, struct Email *cur, FILE *fp)
{
if (!ForwardAttributionIntro || !fp)
return;
* @param cur Header of email
* @param fp File to write to
*/
-void mutt_forward_trailer(struct Context *ctx, struct Header *cur, FILE *fp)
+void mutt_forward_trailer(struct Context *ctx, struct Email *cur, FILE *fp)
{
if (!ForwardAttributionTrailer || !fp)
return;
* @retval 0 Success
* @retval -1 Failure
*/
-static int include_forward(struct Context *ctx, struct Header *cur, FILE *out)
+static int include_forward(struct Context *ctx, struct Email *cur, FILE *out)
{
int chflags = CH_DECODE, cmflags = 0;
* @param cur Header of email
* @param out File to write to
*/
-void mutt_make_attribution(struct Context *ctx, struct Header *cur, FILE *out)
+void mutt_make_attribution(struct Context *ctx, struct Email *cur, FILE *out)
{
if (!Attribution || !out)
return;
* @param cur Header of email
* @param out File to write to
*/
-void mutt_make_post_indent(struct Context *ctx, struct Header *cur, FILE *out)
+void mutt_make_post_indent(struct Context *ctx, struct Email *cur, FILE *out)
{
if (!PostIndentString || !out)
return;
* @retval 0 Success
* @retval -1 Failure
*/
-static int include_reply(struct Context *ctx, struct Header *cur, FILE *out)
+static int include_reply(struct Context *ctx, struct Email *cur, FILE *out)
{
int cmflags = MUTT_CM_PREFIX | MUTT_CM_DECODE | MUTT_CM_CHARCONV | MUTT_CM_REPLYING;
int chflags = CH_DECODE;
* @param ctx Mailbox
* @param cur Header of email
*/
-void mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Header *cur)
+void mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Email *cur)
{
if (!env)
return;
* @retval -1 Failure
*/
static int envelope_defaults(struct Envelope *env, struct Context *ctx,
- struct Header *cur, int flags)
+ struct Email *cur, int flags)
{
struct Envelope *curenv = NULL;
bool tag = false;
* @retval 0 Success
* @retval -1 Error
*/
-static int generate_body(FILE *tempfp, struct Header *msg, int flags,
- struct Context *ctx, struct Header *cur)
+static int generate_body(FILE *tempfp, struct Email *msg, int flags,
+ struct Context *ctx, struct Email *cur)
{
int i;
struct Body *tmp = NULL;
* @retval 0 Success
* @retval -1 Failure
*/
-static int send_message(struct Header *msg)
+static int send_message(struct Email *msg)
{
char tempfile[PATH_MAX];
int i;
* @retval -1 Message was aborted or an error occurred
* @retval 1 Message was postponed
*/
-int mutt_resend_message(FILE *fp, struct Context *ctx, struct Header *cur)
+int mutt_resend_message(FILE *fp, struct Context *ctx, struct Email *cur)
{
- struct Header *msg = mutt_header_new();
+ struct Email *msg = mutt_email_new();
if (mutt_prepare_template(fp, ctx, msg, cur, true) < 0)
{
- mutt_header_free(&msg);
+ mutt_email_free(&msg);
return -1;
}
* @retval 1 It is a reply
* @retval 0 It is not a reply
*/
-static int is_reply(struct Header *reply, struct Header *orig)
+static int is_reply(struct Email *reply, struct Email *orig)
{
if (!reply || !reply->env || !orig || !orig->env)
return 0;
* @retval -1 Message was aborted or an error occurred
* @retval 1 Message was postponed
*/
-int ci_send_message(int flags, struct Header *msg, char *tempfile,
- struct Context *ctx, struct Header *cur)
+int ci_send_message(int flags, struct Email *msg, char *tempfile,
+ struct Context *ctx, struct Email *cur)
{
char buffer[LONG_STRING];
char fcc[PATH_MAX] = ""; /* where to copy this message */
if (!msg)
{
- msg = mutt_header_new();
+ msg = mutt_email_new();
if (flags == SEND_POSTPONED)
{
mutt_file_fclose(&tempfp);
if (!(flags & SEND_NO_FREE_HEADER))
- mutt_header_free(&msg);
+ mutt_email_free(&msg);
FREE(&finalpath);
return rc;
struct Body;
struct Context;
struct Envelope;
-struct Header;
+struct Email;
/* These Config Variables are only used in send.c */
extern unsigned char AbortNoattach; /* forgotten attachment detector */
#define SEND_TO_SENDER (1 << 12)
#define SEND_NEWS (1 << 13)
-int ci_send_message(int flags, struct Header *msg, char *tempfile, struct Context *ctx, struct Header *cur);
+int ci_send_message(int flags, struct Email *msg, char *tempfile, struct Context *ctx, struct Email *cur);
void mutt_add_to_reference_headers(struct Envelope *env, struct Envelope *curenv);
struct Address *mutt_default_from(void);
void mutt_encode_descriptions(struct Body *b, bool recurse);
int mutt_fetch_recips(struct Envelope *out, struct Envelope *in, int flags);
void mutt_fix_reply_recipients(struct Envelope *env);
-void mutt_forward_intro(struct Context *ctx, struct Header *cur, FILE *fp);
-void mutt_forward_trailer(struct Context *ctx, struct Header *cur, FILE *fp);
-void mutt_make_attribution(struct Context *ctx, struct Header *cur, FILE *out);
-void mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Header *cur);
+void mutt_forward_intro(struct Context *ctx, struct Email *cur, FILE *fp);
+void mutt_forward_trailer(struct Context *ctx, struct Email *cur, FILE *fp);
+void mutt_make_attribution(struct Context *ctx, struct Email *cur, FILE *out);
+void mutt_make_forward_subject(struct Envelope *env, struct Context *ctx, struct Email *cur);
void mutt_make_misc_reply_headers(struct Envelope *env, struct Envelope *curenv);
-void mutt_make_post_indent(struct Context *ctx, struct Header *cur, FILE *out);
+void mutt_make_post_indent(struct Context *ctx, struct Email *cur, FILE *out);
struct Address *mutt_remove_xrefs(struct Address *a, struct Address *b);
-int mutt_resend_message(FILE *fp, struct Context *ctx, struct Header *cur);
+int mutt_resend_message(FILE *fp, struct Context *ctx, struct Email *cur);
void mutt_set_followup_to(struct Envelope *e);
#endif /* MUTT_SEND_H */
* @retval ptr Newly allocated Body
* @retval NULL Error
*/
-struct Body *mutt_make_message_attach(struct Context *ctx, struct Header *hdr, bool attach_msg)
+struct Body *mutt_make_message_attach(struct Context *ctx, struct Email *hdr, bool attach_msg)
{
char buffer[LONG_STRING];
struct Body *body = NULL;
fflush(fp);
rewind(fp);
- body->hdr = mutt_header_new();
+ body->hdr = mutt_email_new();
body->hdr->offset = 0;
/* we don't need the user headers here */
body->hdr->env = mutt_rfc822_read_header(fp, body->hdr, false, false);
* @retval 0 Success
* @retval -1 Failure
*/
-static int bounce_message(FILE *fp, struct Header *h, struct Address *to,
+static int bounce_message(FILE *fp, struct Email *h, struct Address *to,
const char *resent_from, struct Address *env_from)
{
int rc = 0;
* @retval 0 Success
* @retval -1 Failure
*/
-int mutt_bounce_message(FILE *fp, struct Header *h, struct Address *to)
+int mutt_bounce_message(FILE *fp, struct Email *h, struct Address *to)
{
const char *fqdn = mutt_fqdn(true);
char resent_from[STRING];
* @retval 0 Success
* @retval -1 Failure
*/
-int mutt_write_multiple_fcc(const char *path, struct Header *hdr, const char *msgid,
+int mutt_write_multiple_fcc(const char *path, struct Email *hdr, const char *msgid,
bool post, char *fcc, char **finalpath)
{
char fcc_tok[PATH_MAX];
* @retval 0 Success
* @retval -1 Failure
*/
-int mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid,
+int mutt_write_fcc(const char *path, struct Email *hdr, const char *msgid,
bool post, char *fcc, char **finalpath)
{
struct Message *msg = NULL;
struct Body;
struct Context;
struct Envelope;
-struct Header;
+struct Email;
struct ListHead;
struct ParameterList;
extern short WrapHeaders;
char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen);
-int mutt_bounce_message(FILE *fp, struct Header *h, struct Address *to);
+int mutt_bounce_message(FILE *fp, struct Email *h, struct Address *to);
const char * mutt_fqdn(bool may_hide_host);
void mutt_generate_boundary(struct ParameterList *parm);
struct Content *mutt_get_content_info(const char *fname, struct Body *b);
int mutt_invoke_sendmail(struct Address *from, struct Address *to, struct Address *cc, struct Address *bcc, const char *msg, int eightbit);
int mutt_lookup_mime_type(struct Body *att, const char *path);
struct Body * mutt_make_file_attach(const char *path);
-struct Body * mutt_make_message_attach(struct Context *ctx, struct Header *hdr, bool attach_msg);
+struct Body * mutt_make_message_attach(struct Context *ctx, struct Email *hdr, bool attach_msg);
struct Body * mutt_make_multipart(struct Body *b);
void mutt_message_to_7bit(struct Body *a, FILE *fp);
void mutt_prepare_envelope(struct Envelope *env, bool final);
void mutt_unprepare_envelope(struct Envelope *env);
void mutt_update_encoding(struct Body *a);
void mutt_write_address_list(struct Address *addr, FILE *fp, int linelen, bool display);
-int mutt_write_fcc(const char *path, struct Header *hdr, const char *msgid, bool post, char *fcc, char **finalpath);
+int mutt_write_fcc(const char *path, struct Email *hdr, const char *msgid, bool post, char *fcc, char **finalpath);
int mutt_write_mime_body(struct Body *a, FILE *f);
int mutt_write_mime_header(struct Body *a, FILE *f);
-int mutt_write_multiple_fcc(const char *path, struct Header *hdr, const char *msgid, bool post, char *fcc, char **finalpath);
+int mutt_write_multiple_fcc(const char *path, struct Email *hdr, const char *msgid, bool post, char *fcc, char **finalpath);
int mutt_write_one_header(FILE *fp, const char *tag, const char *value, const char *pfx, int wraplen, int flags);
void mutt_write_references(const struct ListHead *r, FILE *f, size_t trim);
/* If the items still match, use their index positions
* to maintain a stable sort order */
if (retval == 0)
- retval = (*((struct Header **) a))->index - (*((struct Header **) b))->index;
+ retval = (*((struct Email **) a))->index - (*((struct Email **) b))->index;
return retval;
}
*/
static int compare_score(const void *a, const void *b)
{
- struct Header **pa = (struct Header **) a;
- struct Header **pb = (struct Header **) b;
+ struct Email **pa = (struct Email **) a;
+ struct Email **pb = (struct Email **) b;
int result = (*pb)->score - (*pa)->score; /* note that this is reverse */
result = perform_auxsort(result, a, b);
return SORTCODE(result);
*/
static int compare_size(const void *a, const void *b)
{
- struct Header **pa = (struct Header **) a;
- struct Header **pb = (struct Header **) b;
+ struct Email **pa = (struct Email **) a;
+ struct Email **pb = (struct Email **) b;
int result = (*pa)->content->length - (*pb)->content->length;
result = perform_auxsort(result, a, b);
return SORTCODE(result);
*/
static int compare_date_sent(const void *a, const void *b)
{
- struct Header **pa = (struct Header **) a;
- struct Header **pb = (struct Header **) b;
+ struct Email **pa = (struct Email **) a;
+ struct Email **pb = (struct Email **) b;
int result = (*pa)->date_sent - (*pb)->date_sent;
result = perform_auxsort(result, a, b);
return SORTCODE(result);
*/
static int compare_subject(const void *a, const void *b)
{
- struct Header **pa = (struct Header **) a;
- struct Header **pb = (struct Header **) b;
+ struct Email **pa = (struct Email **) a;
+ struct Email **pb = (struct Email **) b;
int rc;
if (!(*pa)->env->real_subj)
*/
static int compare_to(const void *a, const void *b)
{
- struct Header **ppa = (struct Header **) a;
- struct Header **ppb = (struct Header **) b;
+ struct Email **ppa = (struct Email **) a;
+ struct Email **ppb = (struct Email **) b;
char fa[SHORT_STRING];
mutt_str_strfcpy(fa, mutt_get_name((*ppa)->env->to), SHORT_STRING);
*/
static int compare_from(const void *a, const void *b)
{
- struct Header **ppa = (struct Header **) a;
- struct Header **ppb = (struct Header **) b;
+ struct Email **ppa = (struct Email **) a;
+ struct Email **ppb = (struct Email **) b;
char fa[SHORT_STRING];
mutt_str_strfcpy(fa, mutt_get_name((*ppa)->env->from), SHORT_STRING);
*/
static int compare_date_received(const void *a, const void *b)
{
- struct Header **pa = (struct Header **) a;
- struct Header **pb = (struct Header **) b;
+ struct Email **pa = (struct Email **) a;
+ struct Email **pb = (struct Email **) b;
int result = (*pa)->received - (*pb)->received;
result = perform_auxsort(result, a, b);
return SORTCODE(result);
*/
static int compare_order(const void *a, const void *b)
{
- struct Header **ha = (struct Header **) a;
- struct Header **hb = (struct Header **) b;
+ struct Email **ha = (struct Email **) a;
+ struct Email **hb = (struct Email **) b;
/* no need to auxsort because you will never have equality here */
return SORTCODE((*ha)->index - (*hb)->index);
*/
static int compare_spam(const void *a, const void *b)
{
- struct Header **ppa = (struct Header **) a;
- struct Header **ppb = (struct Header **) b;
+ struct Email **ppa = (struct Email **) a;
+ struct Email **ppb = (struct Email **) b;
char *aptr = NULL, *bptr = NULL;
int ahas, bhas;
int result = 0;
*/
static int compare_label(const void *a, const void *b)
{
- struct Header **ppa = (struct Header **) a;
- struct Header **ppb = (struct Header **) b;
+ struct Email **ppa = (struct Email **) a;
+ struct Email **ppb = (struct Email **) b;
int ahas, bhas, result = 0;
/* As with compare_spam, not all messages will have the x-label
*/
void mutt_sort_headers(struct Context *ctx, bool init)
{
- struct Header *h = NULL;
+ struct Email *h = NULL;
struct MuttThread *thread = NULL, *top = NULL;
sort_t *sortfunc = NULL;
}
else
qsort((void *) ctx->mailbox->hdrs, ctx->mailbox->msg_count,
- sizeof(struct Header *), sortfunc);
+ sizeof(struct Email *), sortfunc);
/* adjust the virtual message numbers */
ctx->mailbox->vcount = 0;
for (int i = 0; i < ctx->mailbox->msg_count; i++)
{
- struct Header *cur = ctx->mailbox->hdrs[i];
+ struct Email *cur = ctx->mailbox->hdrs[i];
if (cur->virtual != -1 || (cur->collapsed && (!ctx->pattern || cur->limited)))
{
cur->virtual = ctx->mailbox->vcount;