]> granicus.if.org Git - neomutt/commitdiff
rename Header to Email
authorRichard Russon <rich@flatcap.org>
Wed, 12 Sep 2018 20:05:46 +0000 (21:05 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 13 Sep 2018 23:14:54 +0000 (00:14 +0100)
96 files changed:
Makefile.autosetup
commands.c
commands.h
compose.c
compose.h
compress.c
context.h
copy.c
copy.h
curs_main.c
curs_main.h
edit.c
edit.h
editmsg.c
email/attach.h
email/body.c
email/body.h
email/email.c [moved from email/header.c with 73% similarity]
email/email.h [moved from email/header.h with 86% similarity]
email/lib.h
email/parse.c
email/parse.h
email/thread.c
email/thread.h
flags.c
hcache/hcache.c
hcache/hcache.h
hcache/serialize.c
hcache/serialize.h
hdrline.c
hdrline.h
hook.c
hook.h
imap/command.c
imap/imap.c
imap/imap.h
imap/imap_private.h
imap/message.c
imap/util.c
mailbox.c
mailbox.h
maildir/maildir.h
maildir/mh.c
main.c
mbox/mbox.c
menu.c
mutt_attach.c
mutt_attach.h
mutt_header.c
mutt_header.h
mutt_parse.c
mutt_parse.h
mutt_thread.c
mutt_thread.h
muttlib.c
mx.c
mx.h
ncrypt/crypt.c
ncrypt/crypt_gpgme.c
ncrypt/crypt_gpgme.h
ncrypt/crypt_mod.h
ncrypt/cryptglue.c
ncrypt/ncrypt.h
ncrypt/pgp.c
ncrypt/pgp.h
ncrypt/smime.c
ncrypt/smime.h
nntp/newsrc.c
nntp/nntp.c
nntp/nntp.h
notmuch/mutt_notmuch.c
notmuch/mutt_notmuch.h
pager.c
pager.h
pattern.c
pattern.h
po/POTFILES.in
pop/pop.c
postpone.c
protos.h
query.c
recvattach.c
recvattach.h
recvcmd.c
recvcmd.h
remailer.c
remailer.h
rfc3676.c
rfc3676.h
score.c
score.h
send.c
send.h
sendlib.c
sendlib.h
sort.c

index 44cd14753f5c32568476adae9565309248559188..697134f1c72d507b4ff9c8a8cfe6ef6ef04913d5 100644 (file)
@@ -238,7 +238,7 @@ ALLOBJS+=   $(LIBCONFIGOBJS)
 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)
@@ -377,8 +377,8 @@ git_ver.h: $(ALL_FILES)
 
 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 \
@@ -387,8 +387,8 @@ hcache/hcversion.h: $(SRCDIR)/email/address.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) - | \
index f6580a17286a1985ec5444b3e1a365b9677614b8..ea7418b8c3141cb52c0677f97a17942bc6c29890 100644 (file)
@@ -89,7 +89,7 @@ static char LastSaveFolder[PATH_MAX] = "";
  * @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;
@@ -279,7 +279,7 @@ int mutt_display_message(struct Header *cur)
  * 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];
@@ -409,7 +409,7 @@ static void pipe_set_flags(bool decode, bool print, int *cmflags, int *chflags)
  * @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;
@@ -442,7 +442,7 @@ static void pipe_msg(struct Header *h, FILE *fp, bool decode, bool print)
  *
  * 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;
@@ -557,7 +557,7 @@ static int pipe_message(struct Header *h, char *cmd, bool decode, bool print,
  * 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];
 
@@ -576,7 +576,7 @@ void mutt_pipe_message(struct Header *h)
  * 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
@@ -781,7 +781,7 @@ void mutt_display_address(struct Envelope *env)
  * @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;
@@ -835,7 +835,7 @@ static void set_copy_flags(struct Header *hdr, bool decode, bool decrypt,
  * @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;
@@ -870,7 +870,7 @@ int mutt_save_message_ctx(struct Header *h, bool delete, bool decode,
  * @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;
@@ -1040,7 +1040,7 @@ int mutt_save_message(struct Header *h, bool delete, bool decode, bool decrypt)
 #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++;
@@ -1085,7 +1085,7 @@ int mutt_save_message(struct Header *h, bool delete, bool decode, bool decrypt)
  *
  * 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];
@@ -1163,7 +1163,7 @@ int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp)
   {
     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)))
@@ -1189,7 +1189,7 @@ int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp)
  * @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;
 
@@ -1217,7 +1217,7 @@ static bool check_traditional_pgp(struct Header *h, int *redraw)
  * @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))
index d1018949b2a90b962d552d1a79e7cfdaea707aec..2f701eee6690cb63e2b66881e3309b449e81f8ea 100644 (file)
@@ -29,7 +29,7 @@
 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 */
@@ -41,17 +41,17 @@ extern bool          PrintDecode;
 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);
 
index f4349a65277decf8bf6b3ff2c08b0bc23a97c261..012991630ef77ed2a91938fb4aedb02e019eef6a 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -267,7 +267,7 @@ static void snd_entry(char *buf, size_t buflen, struct Menu *menu, int num)
  * 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",
@@ -455,7 +455,7 @@ static void draw_envelope_addr(int line, struct Address *addr)
  * @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
@@ -670,7 +670,7 @@ static void update_idx(struct Menu *menu, struct AttachCtx *actx, struct AttachP
  */
 struct ComposeRedrawData
 {
-  struct Header *msg;
+  struct Email *msg;
   char *fcc;
 };
 
@@ -887,8 +887,7 @@ static void compose_status_line(char *buf, size_t buflen, size_t col, int cols,
  * @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];
index af96dc3e568c8df84373c37dab230b1e45ac66b0..866d83f65313494eaa1ac6bd275b49b49152ee44 100644 (file)
--- a/compose.h
+++ b/compose.h
@@ -25,7 +25,7 @@
 
 #include <stdio.h>
 
-struct Header;
+struct Email;
 
 /* These Config Variables are only used in compose.c */
 extern char *        ComposeFormat;
@@ -35,6 +35,6 @@ extern unsigned char Postpone;
 /* 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 */
index f8bff32ad63b9a83db805192b2f3a7762b0e0d90..ed51ce1188a955952523359cf5aaf715e998a7af 100644 (file)
@@ -48,7 +48,7 @@
 #include "mx.h"
 #include "protos.h"
 
-struct Header;
+struct Email;
 
 /* Notes:
  * Any references to compressed files also apply to encrypted files.
@@ -837,7 +837,7 @@ static int comp_msg_open(struct Context *ctx, struct Message *msg, int msgno)
 /**
  * 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;
@@ -937,7 +937,7 @@ static int comp_tags_edit(struct Context *ctx, const char *tags, char *buf, size
 /**
  * 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;
index 4f81fe1cd74f079f08e5bee3303613e7797b73f7..f4525ca859655f8f477387d86782acec0549861d 100644 (file)
--- a/context.h
+++ b/context.h
@@ -36,7 +36,7 @@ struct Context
   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? */
diff --git a/copy.c b/copy.c
index 4d30d1ceadc4945251cb8d87deca50ba39c1572f..21eb6361a55825f9fe7d8c4d9445243d9a7f43b1 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -399,7 +399,7 @@ int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
  * 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)
   {
@@ -577,7 +577,7 @@ static int count_delete_lines(FILE *fp, struct Body *b, LOFF_T *length, size_t d
  * * #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];
@@ -786,7 +786,7 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Header *hdr, int flags,
  * 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);
@@ -816,7 +816,7 @@ int mutt_copy_message_ctx(FILE *fpout, struct Context *src, struct Header *hdr,
  * @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;
@@ -858,7 +858,7 @@ static int append_message(struct Context *dest, FILE *fpin, struct Context *src,
  * @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)
diff --git a/copy.h b/copy.h
index 4f52bab82695aab6bc4f70b02329998fa898d8eb..38f939a0ff73dee7cf6ac5f92a4c7128721da76d 100644 (file)
--- a/copy.h
+++ b/copy.h
@@ -25,7 +25,7 @@
 
 #include <stdio.h>
 
-struct Header;
+struct Email;
 struct Context;
 
 /**< flags to mutt_copy_message */
@@ -69,11 +69,11 @@ struct Context;
 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 */
index ee3b5dad8558d30f941497a848091a3dfa71c814..1d73a7dc5d995e88aed0f0441c64d01d606a8ef8 100644 (file)
@@ -181,7 +181,7 @@ static const char *NoVisible = N_("No visible messages");
  */
 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;
 
@@ -343,7 +343,7 @@ static int mx_toggle_write(struct Context *ctx)
  */
 static void resort_index(struct Menu *menu)
 {
-  struct Header *current = CURHDR;
+  struct Email *current = CURHDR;
 
   menu->current = -1;
   mutt_sort_headers(Context, false);
@@ -375,12 +375,12 @@ static void resort_index(struct Menu *menu)
  */
 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];
   }
@@ -395,7 +395,7 @@ static void update_index_threaded(struct Context *ctx, int check, int oldcount)
   {
     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];
@@ -652,7 +652,7 @@ void index_make_entry(char *buf, size_t buflen, struct Menu *menu, int num)
   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;
 
@@ -727,7 +727,7 @@ int index_color(int index_no)
   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;
@@ -1310,7 +1310,7 @@ int mutt_index_menu(void)
         CHECK_ATTACH;
         if (Context->mailbox->magic == MUTT_NNTP)
         {
-          struct Header *hdr = NULL;
+          struct Email *hdr = NULL;
 
           if (op == OP_GET_MESSAGE)
           {
@@ -1419,8 +1419,8 @@ int mutt_index_menu(void)
           /* 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)
@@ -1495,7 +1495,7 @@ int mutt_index_menu(void)
           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)
           {
@@ -1845,7 +1845,7 @@ int mutt_index_menu(void)
           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)
@@ -1939,7 +1939,7 @@ int mutt_index_menu(void)
         }
         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);
@@ -2343,7 +2343,7 @@ int mutt_index_menu(void)
                  !STAILQ_EMPTY(&CURHDR->env->references))
         {
           {
-            struct Header *oldcur = CURHDR;
+            struct Email *oldcur = CURHDR;
 
             mutt_break_thread(CURHDR);
             mutt_sort_headers(Context, true);
@@ -2385,7 +2385,7 @@ int mutt_index_menu(void)
           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))
           {
@@ -2588,7 +2588,7 @@ int mutt_index_menu(void)
             }
           }
 
-          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)
@@ -3519,7 +3519,7 @@ int mutt_index_menu(void)
  * @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 };
index 839ccb630cf4bdae3598dccdf6c1a1c2c310e834..e47d423caa21b9c52babccb960e4f093310e6af0 100644 (file)
@@ -27,7 +27,7 @@
 #include <stdio.h>
 
 struct Context;
-struct Header;
+struct Email;
 struct Menu;
 
 /* These Config Variables are only used in curs_main.c */
@@ -44,7 +44,7 @@ int  index_color(int index_no);
 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 */
diff --git a/edit.c b/edit.c
index 0ace0b78b21f5a4ffc17163cab045a6c454bf24b..3c0d7c14793efabf41d5f05dc09819c7d2de4416 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -388,7 +388,7 @@ static void be_edit_header(struct Envelope *e, bool force)
  * @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;
diff --git a/edit.h b/edit.h
index 934386095ad99ccfeaee2cf32d32c87372843ef3..72afa421496552d7e045f4e48793fb3183848d3f 100644 (file)
--- a/edit.h
+++ b/edit.h
 #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 */
index 6752092bf6e3588d06dac16ef596ae2e39df6598..c7efa48b0bcd1c9875ac126d112af145dc161ce1 100644 (file)
--- a/editmsg.c
+++ b/editmsg.c
@@ -58,7 +58,7 @@
  * @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];
@@ -270,7 +270,7 @@ bail:
  * @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);
@@ -295,7 +295,7 @@ int edit_or_view_message(bool edit, struct Context *ctx, struct Header *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 */
 }
@@ -308,7 +308,7 @@ int mutt_edit_message(struct Context *ctx, struct Header *hdr)
  * @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 */
 }
index 2e2e99c363937751dd09082f1ee95e067544a312..84150815fa8a40d5a7a164dfb79b47d2368cfb64 100644 (file)
@@ -48,7 +48,7 @@ struct AttachPtr
  */
 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;
index a37b67a87dde4bc7d3f5f7c4803d62e44c4d0520..de0320efdea7e3b4febc5cce0ac3fefbbae4323a 100644 (file)
@@ -31,7 +31,7 @@
 #include <unistd.h>
 #include "mutt/mutt.h"
 #include "body.h"
-#include "header.h"
+#include "email.h"
 #include "mime.h"
 #include "parameter.h"
 
@@ -83,7 +83,7 @@ void mutt_body_free(struct Body **p)
     {
       /* 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)
index 9bfb7f2d0122edff86d660aa3b9fcaeac05e774d..af7b05545d3c5f034b92ef136f4dd5a7ccd7693f 100644 (file)
@@ -56,7 +56,7 @@ struct Body
                                    * 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 */
 
similarity index 73%
rename from email/header.c
rename to email/email.c
index a90677d95d61827415713aa530808ffb215490cd..94dada99a839329b2c0bae6992cb87a4640cc561 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * @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;
@@ -58,12 +58,12 @@ void mutt_header_free(struct Header **h)
 }
 
 /**
- * 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
@@ -72,12 +72,12 @@ struct Header *mutt_header_new(void)
 }
 
 /**
- * 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)
   {
similarity index 86%
rename from email/header.h
rename to email/email.h
index 5b9913f662088aedf63af4fb12bcd76820358d72..c4776b30bc73e2e1a818cb71d356788df2082de4 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * @file
- * Representation of the email's header
+ * Representation of an email
  *
  * @authors
  * Copyright (C) 2017 Richard Russon <rich@flatcap.org>
@@ -20,8 +20,8 @@
  * 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;
@@ -108,14 +108,14 @@ struct Header
 
   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 */
index 03f17e3777f5aa5c7a06151bddc0d8411a501e25..ef1a20a8af0d0f768fd96473d9fff43e20ae73ad 100644 (file)
@@ -33,7 +33,7 @@
  * | 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"
index 1f01dd9a75b3389128b8bafa45c2f38c1bac3c80..2a8d21a86fa96f72fae1e2adbb4fdf46cd957413 100644 (file)
 #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"
@@ -495,7 +495,7 @@ void mutt_parse_content_type(char *s, struct Body *ct)
  * 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;
@@ -960,7 +960,7 @@ char *mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen)
  *
  * 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);
@@ -1374,7 +1374,7 @@ struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off
  */
 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;
index d317600a2cd6143d79e8113eeeba2a444725c56c..71c7a9f8efb71df6099c735799e96bb6ec7fbd63 100644 (file)
@@ -28,7 +28,7 @@
 
 struct Body;
 struct Envelope;
-struct Header;
+struct Email;
 
 int              mutt_check_encoding(const char *c);
 int              mutt_check_mime_type(const char *s);
@@ -39,9 +39,9 @@ void             mutt_parse_content_type(char *s, struct Body *ct);
 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 */
index cf72844aca71132cf033857ee7684c4b5b29435e..c6c5e6557ed2b1b002cd00dce706b87127828f4e 100644 (file)
@@ -32,8 +32,8 @@
 #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
@@ -114,7 +114,7 @@ void thread_hash_destructor(int type, void *obj, intptr_t data)
  * @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;
 
@@ -193,7 +193,7 @@ void clean_references(struct MuttThread *brk, struct MuttThread *cur)
 
     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;
@@ -214,7 +214,7 @@ void clean_references(struct MuttThread *brk, struct MuttThread *cur)
  * 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);
index 5fa783151d475eeee0bd7f08fdaf8da2fb20a3ff..cf312c110c6b1047aab4e2e299c2bc4f20ea8b0f 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 
-struct Header;
+struct Email;
 
 /**
  * struct MuttThread - An email conversation
@@ -45,15 +45,15 @@ struct MuttThread
   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);
 
diff --git a/flags.c b/flags.c
index 2e73aa8cd1d0cf59654a917e8ad80af374844f54..22ca77f79a95701dcc94a0e454a9b2e22fd41722 100644 (file)
--- a/flags.c
+++ b/flags.c
@@ -53,7 +53,7 @@
  * @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;
@@ -368,7 +368,7 @@ void mutt_tag_set_flag(int flag, int bf)
  * @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;
 
@@ -424,7 +424,7 @@ done:
  * @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;
index 1fedbf7559beb85c72e241008485c56045954356..11f328db9ab5043c75f615c8bcb0b5337aa1cce6 100644 (file)
@@ -397,7 +397,7 @@ void mutt_hcache_free(header_cache_t *h, void **data)
  * 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;
index 3d14f8854cc58ff1a936f1a6011c9c945f969bed..3fbdccab9d80b9338b0a6dc5a01bae3020100665 100644 (file)
 #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
@@ -152,9 +152,9 @@ void mutt_hcache_free(header_cache_t *h, void **data);
  * @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
@@ -167,7 +167,7 @@ struct Header *mutt_hcache_restore(const unsigned char *d);
  * @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
index 867b3eccc66a7b83a0d96a69814f365e6d3f0715..9acf8638d32d485e61e3cffe9ae5f316ac295112 100644 (file)
@@ -572,10 +572,10 @@ void serial_restore_envelope(struct Envelope *e, const unsigned char *d, int *of
  * 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;
@@ -593,8 +593,8 @@ void *mutt_hcache_dump(header_cache_t *h, const struct Header *header, int *off,
 
   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;
@@ -618,8 +618,8 @@ void *mutt_hcache_dump(header_cache_t *h, const struct Header *header, int *off,
 #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);
@@ -633,10 +633,10 @@ void *mutt_hcache_dump(header_cache_t *h, const struct Header *header, int *off,
  * @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 */
@@ -645,8 +645,8 @@ struct Header *mutt_hcache_restore(const unsigned char *d)
   /* 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
index 96d775ccaa9f9280e603e0d744ec8a482dedee44..800b450492f97de315d7290611f5ad49419953db 100644 (file)
@@ -34,7 +34,7 @@ struct Address;
 struct Body;
 struct Buffer;
 struct Envelope;
-struct Header;
+struct Email;
 struct ListHead;
 struct ParameterList;
 
@@ -57,7 +57,7 @@ void           serial_restore_int(unsigned int *i, const unsigned char *d, int *
 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 */
index 3e3ba000a027370514772117adae8ab43a91375e..2a46b70823104b7a9404c626fa0b7139f7a6929b 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -383,7 +383,7 @@ static bool user_in_addr(struct Address *a)
  * @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;
@@ -446,7 +446,7 @@ static char *apply_subject_mods(struct Envelope *env)
  * @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);
@@ -458,7 +458,7 @@ static bool thread_is_new(struct Context *ctx, struct Header *hdr)
  * @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);
@@ -532,7 +532,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
   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)
@@ -1239,7 +1239,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
       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))
         {
@@ -1425,7 +1425,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
  * @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;
 
index 3b7c70d2f54841961a3eba47196879f89ea54d91..7e3313f192ae7b017b243d22118762223f122a71 100644 (file)
--- a/hdrline.h
+++ b/hdrline.h
@@ -29,7 +29,7 @@
 
 struct Address;
 struct Context;
-struct Header;
+struct Email;
 
 /* These Config Variables are only used in hdrline.c */
 extern struct MbTable *FlagChars;
@@ -42,13 +42,13 @@ extern struct MbTable *ToChars;
 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)
diff --git a/hook.c b/hook.c
index feb8f7e291d16b6874ef6e3077476f8bb75a6058..6440c7cea0f66586ab8346534296124a5215f954 100644 (file)
--- a/hook.c
+++ b/hook.c
@@ -444,7 +444,7 @@ char *mutt_find_hook(int type, const char *pat)
  * @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;
@@ -498,7 +498,7 @@ void mutt_message_hook(struct Context *ctx, struct Header *hdr, int type)
  * @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 };
@@ -529,7 +529,7 @@ static int addr_hook(char *path, size_t pathlen, int type, struct Context *ctx,
  * @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)
@@ -563,7 +563,7 @@ void mutt_default_save(char *path, size_t pathlen, struct Header *hdr)
  * @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)
   {
diff --git a/hook.h b/hook.h
index 1a82e5b101b110567de764fdc9d461d8faccb93f..5b49f1e2fc68455cc95b560025e15ac3e5ffe9f4 100644 (file)
--- a/hook.h
+++ b/hook.h
@@ -29,7 +29,7 @@
 struct Address;
 struct Buffer;
 struct Context;
-struct Header;
+struct Email;
 struct ListHead;
 
 /* These Config Variables are only used in hook.c */
@@ -62,14 +62,14 @@ extern bool  SaveName;
 
 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);
 
index a99d934e46de3a503e8d03552b6faf3176d4f392..dfdf38a2be1148b4a55daf1047b5a01f743d8b7d 100644 (file)
@@ -243,7 +243,7 @@ static int cmd_status(const char *s)
 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");
 
@@ -317,7 +317,7 @@ static void cmd_parse_vanished(struct ImapData *idata, char *s)
 
   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;
 
@@ -378,7 +378,7 @@ static void cmd_parse_vanished(struct ImapData *idata, char *s)
 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;
@@ -744,7 +744,7 @@ static void cmd_parse_myrights(struct ImapData *idata, const char *s)
 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");
 
index 20756245a262b92628fdbe628cb46663e5c1f6a5..13525a00889feb271c07452e4bf2da570847e2f9 100644 (file)
@@ -184,7 +184,7 @@ static int make_msg_set(struct ImapData *idata, struct Buffer *buf, int flag,
   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++)
@@ -267,7 +267,7 @@ static int make_msg_set(struct ImapData *idata, struct Buffer *buf, int flag,
  *
  * 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;
 
@@ -833,7 +833,7 @@ int imap_read_literal(FILE *fp, struct ImapData *idata, unsigned long bytes,
  */
 void imap_expunge_mailbox(struct ImapData *idata)
 {
-  struct Header *h = NULL;
+  struct Email *h = NULL;
   int cacheno;
   short old_sort;
 
@@ -1189,7 +1189,7 @@ bool imap_has_flag(struct ListHead *flag_list, const char *flag)
 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;
@@ -1205,13 +1205,13 @@ int imap_exec_msgset(struct ImapData *idata, const char *pre, const char *post,
   {
     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;
@@ -1262,7 +1262,7 @@ out:
  * @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];
@@ -2003,8 +2003,8 @@ out:
 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;
 
@@ -2101,11 +2101,11 @@ int imap_sync_mailbox(struct Context *ctx, bool expunge)
   {
     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));
   }
 
@@ -2424,7 +2424,7 @@ static int imap_mbox_open(struct Context *ctx)
   }
 
   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;
 
@@ -2579,7 +2579,7 @@ static int imap_mbox_close(struct Context *ctx)
 /**
  * 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];
 
@@ -2683,7 +2683,7 @@ static int imap_tags_edit(struct Context *ctx, const char *tags, char *buf, size
  * 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];
index d1650e54e9f2e137f2651fbbe6c96afbf345b142..17491c20fde78fec6d8c139ae492688146aafc0c 100644 (file)
@@ -55,7 +55,7 @@
 
 struct BrowserState;
 struct Context;
-struct Header;
+struct Email;
 struct Pattern;
 
 /* These Config Variables are only used in imap/auth.c */
@@ -104,7 +104,7 @@ int imap_mailbox_create(const char *folder);
 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);
index 05738d0380cc3bcf66a625ffae2ad8f5ecdefc83..288240f69263ed387f588482cccf3b2845692cc4 100644 (file)
@@ -34,7 +34,7 @@
 
 struct ConnAccount;
 struct Context;
-struct Header;
+struct Email;
 struct ImapHeaderData;
 struct ImapMbox;
 struct Message;
@@ -260,7 +260,7 @@ struct ImapData
   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;
@@ -302,7 +302,7 @@ struct ImapData *imap_conn_find(const struct ConnAccount *account, int flags);
 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 */
@@ -320,8 +320,8 @@ int imap_cmd_idle(struct ImapData *idata);
 /* 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);
 
@@ -333,8 +333,8 @@ int imap_msg_commit(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);
index 8ab10b6ef07ecf58a405075b971fbaee7635c56c..098e28551e13f5429420c93bf3d5f2c2cab18561 100644 (file)
@@ -103,7 +103,7 @@ static struct BodyCache *msg_cache_open(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;
@@ -121,7 +121,7 @@ static FILE *msg_cache_get(struct ImapData *idata, struct Header *h)
  * @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;
@@ -139,7 +139,7 @@ static FILE *msg_cache_put(struct ImapData *idata, struct Header *h)
  * @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;
@@ -501,7 +501,7 @@ static void alloc_msn_index(struct ImapData *idata, size_t msn_count)
   /* 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);
@@ -511,12 +511,12 @@ static void alloc_msn_index(struct ImapData *idata, size_t msn_count)
   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;
@@ -614,7 +614,7 @@ static void imap_fetch_msn_seqset(struct Buffer *b, struct ImapData *idata,
  * 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)
 {
@@ -808,7 +808,7 @@ static int read_headers_qresync_eval_cache(struct ImapData *idata, char *uid_seq
     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);
@@ -1055,7 +1055,7 @@ static int read_headers_fetch_new(struct ImapData *idata, unsigned int msn_begin
           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];
@@ -1475,7 +1475,7 @@ fail:
  * @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];
@@ -1662,7 +1662,7 @@ out:
  * @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;
@@ -1719,7 +1719,7 @@ void imap_free_header_data(struct ImapHeaderData **data)
  * 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 };
@@ -1797,7 +1797,7 @@ int imap_msg_open(struct Context *ctx, struct Message *msg, int msgno)
   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)
index 4f11b7bb5ee556c3c0321557368c5bf09ad14255..e092aa6d77d71c1b07339842651827dc2b290602 100644 (file)
@@ -231,7 +231,7 @@ static void imap_msn_index_to_uid_seqset(struct Buffer *b, struct ImapData *idat
     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;
@@ -338,11 +338,11 @@ void imap_hcache_close(struct ImapData *idata)
  * @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;
@@ -368,7 +368,7 @@ struct Header *imap_hcache_get(struct ImapData *idata, unsigned int uid)
  * @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];
 
index 37be703e31d2f4b6a1a55c2bb0164a84b04f7246..4fb31f7537b264b511265ac486ebb655afb62796 100644 (file)
--- a/mailbox.c
+++ b/mailbox.c
@@ -134,20 +134,20 @@ static int fseek_last_message(FILE *f)
  */
 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;
 }
index 29fdf6fd15186feb8dc8cf8335270a5721421f2b..22efaa435251a6cc14e39baf7e940415ad1ef2bc 100644 (file)
--- a/mailbox.h
+++ b/mailbox.h
@@ -88,7 +88,7 @@ struct Mailbox
   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 */
index 50a612badbb2d7732ed21d4f7571ee43d587f836..3131496527aa46887b7ff16f640b2ae80d8e6bd4 100644 (file)
@@ -42,7 +42,7 @@
 
 struct Mailbox;
 struct Context;
-struct Header;
+struct Email;
 
 /* These Config Variables are only used in maildir/mh.c */
 extern bool  CheckNew;
@@ -56,12 +56,12 @@ extern struct MxOps mx_maildir_ops;
 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);
index 6706aabad4e8c832cba3e0082b9a9f801cd96941..29c98d8fb73eec04e3c961ee279f44acea029eb1 100644 (file)
@@ -87,7 +87,7 @@ char *MhSeqUnseen;  ///< Config: MH sequence for unseen messages
  */
 struct Maildir
 {
-  struct Header *h;
+  struct Email *h;
   char *canon_fname;
   bool header_parsed : 1;
   ino_t inode;
@@ -672,7 +672,7 @@ static void maildir_free_entry(struct Maildir **md)
 
   FREE(&(*md)->canon_fname);
   if ((*md)->h)
-    mutt_header_free(&(*md)->h);
+    mutt_email_free(&(*md)->h);
 
   FREE(md);
 }
@@ -743,7 +743,7 @@ static int maildir_parse_dir(struct Mailbox *mailbox, struct Maildir ***last,
   char buf[PATH_MAX];
   int is_old = 0;
   struct Maildir *entry = NULL;
-  struct Header *h = NULL;
+  struct Email *h = NULL;
 
   if (subdir)
   {
@@ -768,7 +768,7 @@ static int maildir_parse_dir(struct Mailbox *mailbox, struct Maildir ***last,
     /* 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);
@@ -1160,10 +1160,10 @@ static void maildir_delayed_parsing(struct Mailbox *mailbox, struct Maildir **md
 
     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);
@@ -1190,7 +1190,7 @@ static void maildir_delayed_parsing(struct Mailbox *mailbox, struct Maildir **md
 #endif
       }
       else
-        mutt_header_free(&p->h);
+        mutt_email_free(&p->h);
 #ifdef USE_HCACHE
     }
     mutt_hcache_free(hc, &data);
@@ -1308,7 +1308,7 @@ static int ch_compare(const void *a, const void *b)
 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);
@@ -1337,7 +1337,7 @@ static int maildir_mh_open_message(struct Mailbox *mailbox, struct Message *msg,
  * @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;
@@ -1436,7 +1436,7 @@ static int mh_commit_msg(struct Mailbox *mailbox, struct Message *msg,
  *
  * 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];
@@ -1522,7 +1522,7 @@ static int md_commit_message(struct Mailbox *mailbox, struct Message *msg, struc
  */
 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;
@@ -1600,7 +1600,7 @@ static int mh_rewrite_message(struct Context *ctx, int msgno)
  */
 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)))
@@ -1621,7 +1621,7 @@ static int mh_sync_message(struct Context *ctx, int msgno)
  */
 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)))
@@ -1872,7 +1872,7 @@ bool mh_mailbox(struct Mailbox *mailbox, bool check_stats)
  * @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;
 
@@ -1938,13 +1938,13 @@ void maildir_parse_flags(struct Header *h, const char *path)
  * 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);
@@ -1980,8 +1980,8 @@ struct Header *maildir_parse_stream(enum MailboxType magic, FILE *f,
  * 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)
@@ -1998,7 +1998,7 @@ struct Header *maildir_parse_message(enum MailboxType magic, const char *fname,
  * @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';
 
@@ -2036,7 +2036,7 @@ int mh_sync_mailbox_message(struct Context *ctx, int msgno, header_cache_t *hc)
 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))
   {
@@ -2122,7 +2122,7 @@ int mh_sync_mailbox_message(struct Context *ctx, int msgno)
  * @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.
@@ -2451,7 +2451,7 @@ static int maildir_mbox_check(struct Context *ctx, int *index_hint)
       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
@@ -2514,7 +2514,7 @@ static int maildir_msg_open(struct Context *ctx, struct Message *msg, int msgno)
  * @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];
@@ -2803,7 +2803,7 @@ static int mh_mbox_check(struct Context *ctx, int *index_hint)
     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 */
@@ -2811,7 +2811,7 @@ static int mh_mbox_check(struct Context *ctx, int *index_hint)
         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;
@@ -2940,7 +2940,7 @@ static int mh_msg_open(struct Context *ctx, struct Message *msg, int msgno)
  *
  * 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);
 }
diff --git a/main.c b/main.c
index ee256bf057924715a7f0e78ac7d33f0dab256b8d..40dd2074f8079346af3ee1df1edfe6e24332b739 100644 (file)
--- a/main.c
+++ b/main.c
@@ -407,7 +407,7 @@ int main(int argc, char *argv[], char *envp[])
 #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);
@@ -636,7 +636,7 @@ int main(int argc, char *argv[], char *envp[])
 
   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;
@@ -849,7 +849,7 @@ int main(int argc, char *argv[], char *envp[])
       mutt_flushinp();
 
     if (!msg)
-      msg = mutt_header_new();
+      msg = mutt_email_new();
     if (!msg->env)
       msg->env = mutt_env_new();
 
@@ -969,7 +969,7 @@ int main(int argc, char *argv[], char *envp[])
         /* 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)
@@ -983,7 +983,7 @@ int main(int argc, char *argv[], char *envp[])
         {
           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;
         }
 
@@ -1009,7 +1009,7 @@ int main(int argc, char *argv[], char *envp[])
           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.
@@ -1105,7 +1105,7 @@ int main(int argc, char *argv[], char *envp[])
         mutt_file_fclose(&fout);
       }
 
-      mutt_header_free(&msg);
+      mutt_email_free(&msg);
     }
 
     /* !edit_infile && draft_file will leave the tempfile around */
index 99ae88751e858028b04600fda05e7204b9ed7760..f54fb1234133aa02b08f4c478f2e0b4741bbe2b5 100644 (file)
@@ -200,7 +200,7 @@ static int mmdf_parse_mailbox(struct Context *ctx)
   int lines;
   time_t t;
   LOFF_T loc, tmploc;
-  struct Header *hdr = NULL;
+  struct Email *hdr = NULL;
   struct stat sb;
   struct Progress progress;
 
@@ -243,7 +243,7 @@ static int mmdf_parse_mailbox(struct Context *ctx)
 
       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;
@@ -362,7 +362,7 @@ static int mbox_parse_mailbox(struct Context *ctx)
 
   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;
@@ -397,7 +397,7 @@ static int mbox_parse_mailbox(struct Context *ctx)
       /* 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;
@@ -419,7 +419,7 @@ static int mbox_parse_mailbox(struct Context *ctx)
       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;
@@ -523,7 +523,7 @@ static int mbox_parse_mailbox(struct Context *ctx)
    */
   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;
@@ -559,8 +559,8 @@ static int reopen_mailbox(struct Context *ctx, int *index_hint)
   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;
@@ -596,7 +596,7 @@ static int reopen_mailbox(struct Context *ctx, int *index_hint)
   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
@@ -625,7 +625,7 @@ static int reopen_mailbox(struct Context *ctx, int *index_hint)
   {
     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)
@@ -644,7 +644,7 @@ static int reopen_mailbox(struct Context *ctx, int *index_hint)
   {
     /* 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;
@@ -714,7 +714,7 @@ static int reopen_mailbox(struct Context *ctx, int *index_hint)
         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]));
       }
     }
 
@@ -723,7 +723,7 @@ static int reopen_mailbox(struct Context *ctx, int *index_hint)
     {
       if (old_hdrs[j])
       {
-        mutt_header_free(&(old_hdrs[j]));
+        mutt_email_free(&(old_hdrs[j]));
         msg_mod = true;
       }
     }
@@ -1415,7 +1415,7 @@ static int mbox_msg_open(struct Context *ctx, struct Message *msg, int msgno)
  * 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)
diff --git a/menu.c b/menu.c
index 945b88a26e6f2f3a9d47a50bbf0a4c70bc2e03e6..f14861009c722d637031f65347f2c5cebdc0647b 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -79,7 +79,7 @@ static int get_color(int index, unsigned char *s)
 {
   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)
index 7d3183cca70c1122ca9f883e67c690fd5320fdaf..d335e73c5ec2533966de7ab19b993219f60c41e5 100644 (file)
@@ -374,7 +374,7 @@ void mutt_check_lookup_list(struct Body *b, char *type, size_t len)
  * 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] = "";
@@ -777,7 +777,7 @@ static FILE *save_attachment_open(char *path, int flags)
  * @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;
@@ -796,7 +796,7 @@ int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct
       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;
 
@@ -907,7 +907,7 @@ int mutt_decode_save_attachment(FILE *fp, struct Body *m, char *path, int displa
   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;
@@ -977,7 +977,7 @@ int mutt_decode_save_attachment(FILE *fp, struct Body *m, char *path, int displa
     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;
     }
index decae37171086e9c5a593f262bf3b852b6534e13..1f4e277dbfff76b03f3dee75d20c20c2bcc6a2df 100644 (file)
 
 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);
@@ -53,6 +53,6 @@ int mutt_edit_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 */
index b39b64375bac42c14334b1bcddced12b3785e57c..9c9e596501ee36fa1b10107d87d770724752f7cf 100644 (file)
@@ -93,7 +93,7 @@ static void label_ref_inc(struct Mailbox *mailbox, char *label)
  * @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;
@@ -118,7 +118,7 @@ static bool label_message(struct Mailbox *mailbox, struct Header *hdr, char *new
  *
  * 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;
@@ -156,7 +156,7 @@ int mutt_label_message(struct Header *hdr)
       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++;
@@ -177,7 +177,7 @@ int mutt_label_message(struct Header *hdr)
  * @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 */
@@ -380,7 +380,7 @@ void mutt_make_label_hash(struct Mailbox *mailbox)
  * @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;
@@ -393,7 +393,7 @@ void mutt_label_hash_add(struct Mailbox *mailbox, struct Header *hdr)
  * @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;
index 34356833b2057afece84a91f5053f28e901d4cd6..32c842f85e22dcc6505e734ef6001b45184816b2 100644 (file)
 #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 */
index f61e788c13c2204b1fc8c8bf45e24f38a5720bb8..57c9ad41303a337edf7eb1e1e0490795ec2d94ea 100644 (file)
@@ -41,7 +41,7 @@ struct Context;
  * @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;
 
@@ -211,7 +211,7 @@ static int count_body_parts(struct Body *body, int flags)
  * @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;
 
index 509aaafa4c84c99bb18edbe83e150fd666839de7..4e7c831b3bc360295a4ecc95f2d66ca6e6d82ab9 100644 (file)
@@ -24,9 +24,9 @@
 #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 */
index f9d44f4b0ec09c176efbd170babd2913059d79dc..b2483b24d63b03df49ead104e4f88fd4f23456b5 100644 (file)
@@ -56,7 +56,7 @@ bool ThreadReceived; ///< Config: Sort threaded messages by their received date
  * @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));
 }
@@ -67,7 +67,7 @@ static bool is_visible(struct Header *hdr, struct Context *ctx)
  * @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;
 
@@ -118,7 +118,7 @@ bool need_display_subject(struct Context *ctx, struct Header *hdr)
 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)
@@ -464,7 +464,7 @@ static struct MuttThread *find_subject(struct Context *ctx, struct MuttThread *c
   {
     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 */
@@ -495,7 +495,7 @@ static struct Hash *make_subj_hash(struct Context *ctx)
 
   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);
   }
@@ -627,7 +627,7 @@ static int compare_threads(const void *a, const void *b)
 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,
@@ -762,7 +762,7 @@ struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, bool init)
  */
 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++)
   {
@@ -801,7 +801,7 @@ static void check_subjects(struct Context *ctx, bool init)
  */
 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));
@@ -1040,10 +1040,10 @@ void mutt_sort_threads(struct Context *ctx, bool init)
  * @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)
   {
@@ -1104,10 +1104,10 @@ int mutt_aside_thread(struct Header *hdr, bool forwards, bool subthreads)
  * @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)
   {
@@ -1152,7 +1152,7 @@ int mutt_parent_message(struct Context *ctx, struct Header *hdr, bool find_root)
  */
 void mutt_set_virtual(struct Context *ctx)
 {
-  struct Header *cur = NULL;
+  struct Email *cur = NULL;
 
   ctx->mailbox->vcount = 0;
   ctx->vsize = 0;
@@ -1180,10 +1180,10 @@ void mutt_set_virtual(struct Context *ctx)
  * @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;
@@ -1355,7 +1355,7 @@ int mutt_traverse_thread(struct Context *ctx, struct Header *cur, int flag)
  * 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;
@@ -1400,7 +1400,7 @@ struct Hash *mutt_make_id_hash(struct Mailbox *mailbox)
 
   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);
   }
@@ -1415,7 +1415,7 @@ struct Hash *mutt_make_id_hash(struct Mailbox *mailbox)
  * @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;
@@ -1438,7 +1438,7 @@ static bool link_threads(struct Header *parent, struct Header *child, struct Con
  *
  * 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;
 
index a4d953dd0d495ccfb5444895dd4d0b5263eaa955..edb07c542c742b0a1211df41458292497fff6462 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdbool.h>
 
 struct Context;
-struct Header;
+struct Email;
 struct Mailbox;
 struct MuttThread;
 
@@ -49,13 +49,13 @@ extern bool ThreadReceived;
 #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)
@@ -63,14 +63,14 @@ int mutt_traverse_thread(struct Context *ctx, struct Header *cur, int flag);
 #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);
 
index 9d08426533b5e9ede7ce750bc7fffcea9db9a9c5..08514d0ad66dfdff2ac0f1b51ecc643fe5795e69 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -219,14 +219,14 @@ char *mutt_expand_path_regex(char *buf, size_t buflen, bool regex)
         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;
diff --git a/mx.c b/mx.c
index 41643e6f7266c422842a0e6c6b7745589680b493..c5565a86f4354bc2b3e9b94ef0944f99c26a9cad 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -359,7 +359,7 @@ void mx_fastclose_mailbox(struct Context *ctx)
   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);
@@ -856,7 +856,7 @@ void mx_update_tables(struct Context *ctx, bool committing)
        */
       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;
@@ -999,7 +999,7 @@ int mx_mbox_sync(struct Context *ctx, int *index_hint)
  * @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;
@@ -1152,7 +1152,7 @@ int mx_msg_close(struct Context *ctx, struct Message **msg)
  */
 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)
   {
@@ -1162,12 +1162,12 @@ void mx_alloc_memory(struct Mailbox *mailbox)
 
   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++)
@@ -1187,7 +1187,7 @@ void mx_alloc_memory(struct Mailbox *mailbox)
  */
 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++)
   {
@@ -1210,7 +1210,7 @@ void mx_update_context(struct Context *ctx, int new_messages)
 
     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);
@@ -1311,7 +1311,7 @@ int mx_tags_edit(struct Context *ctx, const char *tags, char *buf, size_t buflen
  * @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);
@@ -1441,14 +1441,14 @@ int mx_path_canon(char *buf, size_t buflen, const char *folder)
       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
diff --git a/mx.h b/mx.h
index d3fbae7e404341dd699203ed166e21f26a7a2be8..6e2244e1f23b5cee0d81b4e76af8867d4945cb49 100644 (file)
--- a/mx.h
+++ b/mx.h
@@ -32,7 +32,7 @@
 #include "hcache/hcache.h"
 #endif
 
-struct Header;
+struct Email;
 struct Context;
 struct Mailbox;
 struct stat;
@@ -155,7 +155,7 @@ struct MxOps
    * @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
@@ -197,7 +197,7 @@ struct MxOps
    * @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
@@ -240,14 +240,14 @@ struct Context *mx_mbox_open       (const char *path, int flags);
 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);
index 3b2d0452828ba3d453490ce45eecd857f70cd551..e515448ed4900b63058c4feab71e8b2bc2b2219e 100644 (file)
@@ -165,7 +165,7 @@ int crypt_valid_passphrase(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;
@@ -805,7 +805,7 @@ void crypt_convert_to_7bit(struct Body *a)
  *
  * 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;
@@ -832,7 +832,7 @@ void crypt_extract_keys_from_messages(struct Header *h)
       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))
@@ -944,7 +944,7 @@ void crypt_extract_keys_from_messages(struct Header *h)
  * 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);
@@ -1016,7 +1016,7 @@ int crypt_get_keys(struct Header *msg, char **keylist, bool oppenc_mode)
  * 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;
 
index 3a59d791600c08dcfe240826f54c995abefb2908..7b064dfbec379eebebe9b44800fdb43716a05180 100644 (file)
@@ -5036,7 +5036,7 @@ void smime_gpgme_init(void)
  * @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;
@@ -5197,7 +5197,7 @@ static int gpgme_send_menu(struct Header *msg, int is_smime)
 /**
  * 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);
 }
@@ -5205,7 +5205,7 @@ int pgp_gpgme_send_menu(struct Header *msg)
 /**
  * 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);
 }
@@ -5215,7 +5215,7 @@ int smime_gpgme_send_menu(struct Header *msg)
  * @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;
@@ -5292,7 +5292,7 @@ static bool verify_sender(struct Header *h)
 /**
  * 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);
 }
index 1ae26bce35374738d368185a5b0806cbcf5d4997..292ab8bcd49ccba91cfb866f71cec08bd0d620ac 100644 (file)
@@ -28,7 +28,7 @@
 
 struct Address;
 struct Body;
-struct Header;
+struct Email;
 struct State;
 
 void         pgp_gpgme_set_sender(const char *sender);
@@ -42,7 +42,7 @@ char *       pgp_gpgme_find_keys(struct Address *addrlist, bool oppenc_mode);
 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);
 
@@ -51,10 +51,10 @@ struct Body *smime_gpgme_build_smime_entity(struct Body *a, char *keylist);
 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);
 
index df962ff105e2e9d9ba40307d8c75cc4ac7be208d..6a711bc0d00363f1a3ce1e695eb89a12652467d2 100644 (file)
@@ -29,7 +29,7 @@
 struct Address;
 struct Body;
 struct Envelope;
-struct Header;
+struct Email;
 struct State;
 
 /**
@@ -116,7 +116,7 @@ struct CryptModuleSpecs
    * @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
@@ -186,7 +186,7 @@ struct CryptModuleSpecs
    * @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
index 1e6ef6b82386a423cbc79e93c60b5525d8c84c8a..2a3a745d59ac6e70db8dbe2b8f48d3b84c07f87e 100644 (file)
@@ -46,7 +46,7 @@
 struct Address;
 struct Body;
 struct Envelope;
-struct Header;
+struct Email;
 struct State;
 
 /* These Config Variables are only used in ncrypt/cryptglue.c */
@@ -321,7 +321,7 @@ int crypt_pgp_verify_one(struct Body *sigbdy, struct State *s, const char *tempf
 /**
  * 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);
@@ -412,7 +412,7 @@ void crypt_smime_getkeys(struct Envelope *env)
 /**
  * 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);
@@ -476,7 +476,7 @@ int crypt_smime_verify_one(struct Body *sigbdy, struct State *s, const char *tem
 /**
  * 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);
index 92296336a1b37732893aec0625641212b6d7850d..9b3a02f74318b4278cb8eaf1095e8ed514e65f52 100644 (file)
@@ -55,7 +55,7 @@
 struct Address;
 struct Body;
 struct Envelope;
-struct Header;
+struct Email;
 struct State;
 
 /* These Config Variables are only used in ncrypt/crypt.c */
@@ -178,10 +178,10 @@ extern char *SmimeVerifyOpaqueCommand;
 #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);
@@ -190,7 +190,7 @@ int          mutt_is_malformed_multipart_pgp_encrypted(struct Body *b);
 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 */
@@ -204,12 +204,12 @@ int          crypt_pgp_encrypted_handler(struct Body *a, struct State *s);
 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);
index 2d5ae827ef1eb0b381d7282e0fb5e8198efc96ef..b362bba40b824f69ea9add7d727b38b9c7c59aad 100644 (file)
@@ -1808,7 +1808,7 @@ struct Body *pgp_class_traditional_encryptsign(struct Body *a, int flags, char *
 /**
  * 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;
index eed48e77aaf2ad1efc00de6d2f7ff5ac793cb0c4..1956a4965808c9c575e0f320f6b8e2124b462c2d 100644 (file)
@@ -30,7 +30,7 @@
 
 struct Address;
 struct Body;
-struct Header;
+struct Email;
 struct PgpKeyInfo;
 struct State;
 
@@ -59,6 +59,6 @@ struct Body *pgp_class_traditional_encryptsign(struct Body *a, int flags, char *
 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 */
index 34fe058451bc4b22047a23097c25dd6ea6ca71da..032c1a07811bf37383e51e5ee52a16338bc9862e 100644 (file)
@@ -1427,7 +1427,7 @@ void smime_class_invoke_import(char *infile, char *mailbox)
 /**
  * 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;
@@ -2285,7 +2285,7 @@ int smime_class_application_handler(struct Body *m, struct State *s)
 /**
  * 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;
index c2b9a2d8c7e593be16e6ca5c1bfa2a2bbf57a9f4..3af7c20a4c81561cb68b22c99153538dee031241 100644 (file)
@@ -30,7 +30,7 @@
 struct Address;
 struct Body;
 struct Envelope;
-struct Header;
+struct Email;
 struct State;
 
 /**
@@ -53,11 +53,11 @@ int          smime_class_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b,
 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 */
index 2f8c3b8add5aefc913b20f224dced8e84f3b4bb0..3972f74e148107f98a3e04e274d22515a7826f58 100644 (file)
@@ -1215,7 +1215,7 @@ struct NntpServer *nntp_select_server(struct Mailbox *mailbox, char *server, boo
  * 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;
 
index 85909ed8c0af5cd77e4a9f8f99afd663b9518d81..351c0815f8faaa62899292a142a5b1c6fd88b1a2 100644 (file)
@@ -890,7 +890,7 @@ static int get_description(struct NntpData *nntp_data, const char *wildmat, cons
  *
  * 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;
 
@@ -975,7 +975,7 @@ static int parse_overview_line(char *line, void *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;
@@ -1040,7 +1040,7 @@ static int parse_overview_line(char *line, void *data)
     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);
@@ -1058,7 +1058,7 @@ static int parse_overview_line(char *line, void *data)
     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);
@@ -1107,7 +1107,7 @@ static int parse_overview_line(char *line, void *data)
       nntp_data->last_loaded = anum;
   }
   else
-    mutt_header_free(&hdr);
+    mutt_email_free(&hdr);
 
   /* progress */
   if (!ctx->mailbox->quiet)
@@ -1130,7 +1130,7 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first,
 {
   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;
@@ -1237,7 +1237,7 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first,
       /* 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);
@@ -1303,7 +1303,7 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first,
       }
 
       /* 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;
@@ -1440,7 +1440,7 @@ static int check_mailbox(struct Context *ctx)
   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;
 
@@ -1460,7 +1460,7 @@ static int check_mailbox(struct Context *ctx)
     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)
@@ -1497,13 +1497,13 @@ static int check_mailbox(struct Context *ctx)
           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;
           }
         }
@@ -1545,7 +1545,7 @@ static int check_mailbox(struct Context *ctx)
         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);
@@ -2141,8 +2141,8 @@ int nntp_check_msgid(struct Context *ctx, const char *msgid)
   /* 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);
@@ -2155,7 +2155,7 @@ int nntp_check_msgid(struct Context *ctx, const char *msgid)
     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);
@@ -2244,8 +2244,8 @@ int nntp_check_children(struct Context *ctx, const char *msgid)
  */
 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;
@@ -2435,7 +2435,7 @@ static int nntp_mbox_sync(struct Context *ctx, int *index_hint)
 
   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);
@@ -2500,7 +2500,7 @@ static int nntp_mbox_close(struct Context *ctx)
 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 */
index 9226e5e666e6fe9c9b64af5d1ee0fc86395f1bbc..04477c23b6668390fff931918c1abf7ed0fd9d27 100644 (file)
@@ -45,7 +45,7 @@
 #include "mx.h"
 
 struct ConnAccount;
-struct Header;
+struct Email;
 struct Context;
 
 /* These Config Variables are only used in nntp/nntp.c */
@@ -169,7 +169,7 @@ const char *nntp_format_str(char *buf, size_t buflen, size_t col, int cols, char
                             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;
 
index 3143a0754f6cb63a4f3b84daaca4d887f6f66e50..4b2551055115b60397b315d93a5142838356ffaa 100644 (file)
@@ -266,7 +266,7 @@ static int init_mailbox(struct Mailbox *mailbox)
  * @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;
 }
@@ -278,7 +278,7 @@ static char *header_get_id(struct Header *h)
  * @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;
@@ -823,7 +823,7 @@ err:
  * @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;
@@ -873,7 +873,7 @@ static int update_header_tags(struct Header *h, notmuch_message_t *msg)
  * @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;
 
@@ -932,7 +932,7 @@ static char *get_folder_from_path(const char *path)
  * 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;
@@ -967,7 +967,7 @@ static char *nm2mutt_message_id(const char *id)
  * @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;
@@ -1079,7 +1079,7 @@ static void progress_update(struct Mailbox *mailbox, notmuch_query_t *q)
  * @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;
@@ -1101,7 +1101,7 @@ static struct Header *get_mutt_header(struct Mailbox *mailbox, notmuch_message_t
   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;
 }
@@ -1117,7 +1117,7 @@ static void append_message(struct Mailbox *mailbox, notmuch_query_t *q,
                            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)
@@ -1173,7 +1173,7 @@ static void append_message(struct Mailbox *mailbox, notmuch_query_t *q,
   }
   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;
   }
@@ -1340,7 +1340,7 @@ static bool read_threads_query(struct Mailbox *mailbox, notmuch_query_t *q,
  * @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);
@@ -1452,7 +1452,7 @@ static int update_tags(notmuch_message_t *msg, const char *tags)
  * 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)
@@ -1514,8 +1514,7 @@ static int update_header_flags(struct Context *ctx, struct Header *hdr, const ch
  * @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];
@@ -1630,7 +1629,7 @@ static int remove_filename(struct NmMboxData *data, const char *path)
  * @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))
@@ -1758,7 +1757,7 @@ static unsigned int count_query(notmuch_database_t *db, const char *qstr)
  * @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;
 }
@@ -1815,7 +1814,7 @@ void nm_debug_check(struct Mailbox *mailbox)
  * @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)
@@ -2026,7 +2025,7 @@ void nm_query_window_backward(void)
  * @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);
@@ -2098,7 +2097,7 @@ bool nm_message_is_still_queried(struct Mailbox *mailbox, struct Header *hdr)
  * @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);
@@ -2261,7 +2260,7 @@ int nm_description_to_path(const char *desc, char *buf, size_t buflen)
  * @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;
@@ -2478,7 +2477,7 @@ static int nm_mbox_check(struct Context *ctx, int *index_hint)
     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)
     {
@@ -2506,7 +2505,7 @@ static int nm_mbox_check(struct Context *ctx, int *index_hint)
        * 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);
     }
@@ -2575,7 +2574,7 @@ static int nm_mbox_sync(struct Context *ctx, int *index_hint)
   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)
@@ -2652,7 +2651,7 @@ static int nm_msg_open(struct Context *ctx, struct Message *msg, int msgno)
 {
   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);
 
@@ -2704,7 +2703,7 @@ static int nm_tags_edit(struct Context *ctx, const char *tags, char *buf, size_t
 /**
  * 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)
index 7f2e786782070adc01795f49e7f76b8cd713bcf9..6f569511263c25daea5f32d212b2c521ff6d9f45 100644 (file)
@@ -38,7 +38,7 @@
 #include "mx.h"
 
 struct Context;
-struct Header;
+struct Email;
 
 /* These Config Variables are only used in notmuch/mutt_notmuch.c */
 extern int   NmDbLimit;
@@ -57,18 +57,18 @@ void  nm_debug_check             (struct Mailbox *mailbox);
 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 */
diff --git a/pager.c b/pager.c
index 3954fb30ddc8f72dddc9b2a88092b293fe1a9e98..238c317fa652057f5a866cc9b655d6222b676918 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -101,7 +101,7 @@ static const char *Function_not_permitted_in_attach_message_mode =
 
 /* 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))                                                                    \
@@ -2357,7 +2357,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
         {
           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)
             {
diff --git a/pager.h b/pager.h
index f1fbfc852c04515cda398f4f9a5ac7b75a94b91e..d1368dc25fbb90bf5b389aadb5a386272d7a7238 100644 (file)
--- a/pager.h
+++ b/pager.h
@@ -63,7 +63,7 @@ extern bool          Tilde;
 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 */
index 1ca722f8643834775e96ffdefef023180c668605..73d698938a7b1a550da19d7f3ae0e98aaf4bf609 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -981,7 +981,7 @@ static bool msg_search(struct Context *ctx, struct Pattern *pat, int msgno)
 
   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;
@@ -1503,7 +1503,7 @@ struct Pattern *mutt_pattern_comp(/* const */ char *s, int flags, struct Buffer
  * @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)
@@ -1521,7 +1521,7 @@ static bool perform_and(struct Pattern *pat, enum PatternExecFlag flags,
  * @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)
@@ -1655,7 +1655,7 @@ static int match_threadcomplete(struct Pattern *pat, enum PatternExecFlag flags,
                                 int left, int up, int right, int down)
 {
   int a;
-  struct Header *h = NULL;
+  struct Email *h = NULL;
 
   if (!t)
     return 0;
@@ -1756,7 +1756,7 @@ static int match_content_type(const struct Pattern *pat, struct Body *b)
  * @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);
@@ -1811,7 +1811,7 @@ static int is_pattern_cache_set(int cache_entry)
  *        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;
@@ -2149,7 +2149,7 @@ void mutt_check_simple(char *s, size_t len, const char *simple)
  * @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;
 
@@ -2170,7 +2170,7 @@ static struct MuttThread *top_of_thread(struct Header *h)
  * @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;
 
@@ -2444,7 +2444,7 @@ int mutt_search_command(int cur, int op)
       }
     }
 
-    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 */
index c6e2745c1583b2de36cf329de85cd14f4d599cc6..64e00ace393b108ed0c850d1a62db8f0f8b0c55b 100644 (file)
--- a/pattern.h
+++ b/pattern.h
@@ -29,7 +29,7 @@
 
 struct Address;
 struct Buffer;
-struct Header;
+struct Email;
 struct Context;
 
 /* These Config Variables are only used in pattern.c */
@@ -91,7 +91,7 @@ struct PatternCache
 
 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);
@@ -102,6 +102,6 @@ int mutt_is_list_cc(int alladdr, struct Address *a1, struct Address *a2);
 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 */
index 2949263f15a23a23696b184e5ac3e67ef1acdf24..12379d51201d18edab523b023572ba5add0a7c55 100644 (file)
@@ -39,10 +39,10 @@ editmsg.c
 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
index 3520746022af8921e3bd9eefa2c06183ad81de5a..fc41e9c193b7f7f56ec27fe316d7f77bff36eb3e 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -119,7 +119,7 @@ static int fetch_message(char *line, void *file)
  * @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)
@@ -230,7 +230,7 @@ static int fetch_uidl(char *line, void *data)
       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)
@@ -397,9 +397,9 @@ static int pop_fetch_headers(struct Context *ctx)
          *   (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;
@@ -461,7 +461,7 @@ static int pop_fetch_headers(struct Context *ctx)
   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;
   }
 
@@ -896,7 +896,7 @@ static int pop_msg_open(struct Context *ctx, struct Message *msg, int msgno)
   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 */
index 12a22db29b2e66f873725503e1aa1c9da566ac6f..81ea925095354fe1fb68c3d8c07d70c83c3efdec 100644 (file)
@@ -205,7 +205,7 @@ static void post_entry(char *buf, size_t buflen, struct Menu *menu, int num)
  * 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;
@@ -280,10 +280,10 @@ static struct Header *select_msg(void)
  * @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;
@@ -555,8 +555,8 @@ int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app)
  * @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];
index 6cbab94212cf048f5a15469accc9a7f95b9e8bec..2e1ebc7ab8da9ef740d3b207def7e4a047adb5a7 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -33,7 +33,7 @@
 struct Context;
 struct EnterState;
 struct Envelope;
-struct Header;
+struct Email;
 
 /**
  * enum XdgType - XDG variable types
@@ -49,23 +49,23 @@ int mutt_system(const char *cmd);
 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);
diff --git a/query.c b/query.c
index a5f5bef3bcf6958a623d473582598b1452ffe928..2901711f803ea949fbe8fc40681209af25ee8ed2 100644 (file)
--- a/query.c
+++ b/query.c
@@ -333,7 +333,7 @@ static int query_tag(struct Menu *menu, int n, int m)
 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];
@@ -484,7 +484,7 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, bool ret
           }
         /* fallthrough */
         case OP_MAIL:
-          msg = mutt_header_new();
+          msg = mutt_email_new();
           msg->env = mutt_env_new();
           if (!menu->tagprefix)
           {
index 73049da25c5d10911e69429d831df697aef16cf5..57dc56934ab878f4b53c7df2287a25873ec7dd9e 100644 (file)
@@ -480,8 +480,7 @@ static void prepend_curdir(char *buf, size_t buflen)
  * @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];
@@ -576,7 +575,7 @@ static int query_save_attachment(FILE *fp, struct Body *body,
  * @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;
@@ -1016,7 +1015,7 @@ static int recvattach_pgp_check_traditional(struct AttachCtx *actx, struct Menu
  * @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;
@@ -1045,7 +1044,7 @@ static void recvattach_edit_content_type(struct AttachCtx *actx,
  * @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
@@ -1122,7 +1121,7 @@ int mutt_attach_display_loop(struct Menu *menu, int op, struct Header *hdr,
  * @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)
 {
@@ -1309,7 +1308,7 @@ static void attach_collapse(struct AttachCtx *actx, struct Menu *menu)
  * 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;
index 76224d0161a8450bb5dfd259ba9fff2ac4bc0e55..c48675d4d13e153dd401cae265707dbc6926f888 100644 (file)
@@ -29,7 +29,7 @@
 #include "format_flags.h"
 
 struct AttachCtx;
-struct Header;
+struct Email;
 
 /* These Config Variables are only used in recvattach.c */
 extern char *AttachSep;
@@ -41,6 +41,6 @@ void mutt_attach_init(struct AttachCtx *actx);
 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 */
index b92559671cbfffa229896a1853d5d58a53dc257b..1e70eae6c76f37e2edf941848f45ef364babd65e 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -386,7 +386,7 @@ static struct AttachPtr *find_parent(struct AttachCtx *actx, struct Body *cur, s
  * @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];
@@ -446,12 +446,12 @@ static struct Body **copy_problematic_attachments(struct Body **last,
  *
  * (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];
@@ -473,7 +473,7 @@ static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx
     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);
 
@@ -482,7 +482,7 @@ static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx
   if (!tmpfp)
   {
     mutt_error(_("Can't open temporary file %s"), tmpbody);
-    mutt_header_free(&tmphdr);
+    mutt_email_free(&tmphdr);
     return;
   }
 
@@ -600,7 +600,7 @@ bail:
     mutt_file_unlink(tmpbody);
   }
 
-  mutt_header_free(&tmphdr);
+  mutt_email_free(&tmphdr);
 }
 
 /**
@@ -619,8 +619,8 @@ bail:
  */
 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;
@@ -643,7 +643,7 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx, struct Body *c
     }
   }
 
-  tmphdr = mutt_header_new();
+  tmphdr = mutt_email_new();
   tmphdr->env = mutt_env_new();
   mutt_make_forward_subject(tmphdr->env, Context, curhdr);
 
@@ -659,7 +659,7 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx, struct Body *c
     if (!tmpfp)
     {
       mutt_error(_("Can't create %s"), tmpbody);
-      mutt_header_free(&tmphdr);
+      mutt_email_free(&tmphdr);
       return;
     }
 
@@ -719,7 +719,7 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx, struct Body *c
     }
   }
   else
-    mutt_header_free(&tmphdr);
+    mutt_email_free(&tmphdr);
 
   ci_send_message(flags, tmphdr, *tmpbody ? tmpbody : NULL, NULL, curhdr);
 }
@@ -732,7 +732,7 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx, struct Body *c
  * @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))
@@ -768,10 +768,10 @@ void mutt_attach_forward(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
  * 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)
   {
@@ -857,7 +857,7 @@ static int attach_reply_envelope_defaults(struct Envelope *env, struct AttachCtx
  * @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;
@@ -884,16 +884,16 @@ static void attach_include_reply(FILE *fp, FILE *tmpfp, struct Header *cur)
  * @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];
@@ -937,13 +937,13 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
   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;
   }
 
@@ -952,7 +952,7 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
   if (!tmpfp)
   {
     mutt_error(_("Can't create %s"), tmpbody);
-    mutt_header_free(&tmphdr);
+    mutt_email_free(&tmphdr);
     return;
   }
 
@@ -1021,7 +1021,7 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
 
     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;
     }
@@ -1043,7 +1043,7 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
  * @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))
@@ -1052,7 +1052,7 @@ void mutt_attach_mail_sender(FILE *fp, struct Header *hdr,
     return;
   }
 
-  struct Header *tmphdr = mutt_header_new();
+  struct Email *tmphdr = mutt_email_new();
   tmphdr->env = mutt_env_new();
 
   if (cur)
index fe212011baffec422e179bd693cb6c846e88f5a8..7d3244c5d867b369a72050f2e06d9da51878bc7e 100644 (file)
--- a/recvcmd.h
+++ b/recvcmd.h
 
 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 */
index a2f5726a329431d0a34d7529c52016f0c0e868da..647b6d6d3cadf83a6dc8dbb41bef55add4ce4d62 100644 (file)
@@ -766,7 +766,7 @@ void mix_make_chain(struct ListHead *chainhead)
  * @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;
index cb9d0b66ed1ed088772fdf447b83e76e3beb5a31..b0cb55cd9bd983f87900940ac9f9aa69f07d9f9a 100644 (file)
@@ -26,7 +26,7 @@
 #include <stddef.h>
 
 struct ListHead;
-struct Header;
+struct Email;
 
 /* These Config Variables are only used in remailer.c */
 extern char *MixEntryFormat;
@@ -58,7 +58,7 @@ struct MixChain
 };
 
 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 */
index e34f2930ed720137b4f812fb4abd07b203d66062..18adfb9f4b623ee2097ea57bfea462c62fdcffe3 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -391,7 +391,7 @@ int rfc3676_handler(struct Body *a, struct State *s)
  * 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;
index ce1a8be035e3d25160b42c0b47d234fddffb2b38..61a75c347e64d479aa0c9853b76caa3bb308254b 100644 (file)
--- a/rfc3676.h
+++ b/rfc3676.h
@@ -28,7 +28,7 @@
 #include <stdbool.h>
 
 struct Body;
-struct Header;
+struct Email;
 struct State;
 
 /* These Config Variables are only used in rfc3676.c */
@@ -36,6 +36,6 @@ extern bool  ReflowSpaceQuotes;
 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 */
diff --git a/score.c b/score.c
index 7ca3a6d79e49966bd156f86d41c2a4fc409e53c1..a7a431ee5a426637826b9ae33f17036e30366569 100644 (file)
--- a/score.c
+++ b/score.c
@@ -168,7 +168,7 @@ int mutt_parse_score(struct Buffer *buf, struct Buffer *s, unsigned long data,
  * @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 };
diff --git a/score.h b/score.h
index 18752badf214ab81bfa9e0915aa333d7bb69d2c7..a3fece9174e536e0b5dfacdd44c1e46e81cafd66 100644 (file)
--- a/score.h
+++ b/score.h
@@ -26,7 +26,7 @@
 #include <stdbool.h>
 
 struct Buffer;
-struct Header;
+struct Email;
 struct Context;
 
 /* These Config Variables are only used in score.c */
@@ -37,6 +37,6 @@ extern short ScoreThresholdRead;
 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 */
diff --git a/send.c b/send.c
index e3526d8d70c890dfa346ef0fab88bb9009525726..ca14f21dbf90ccea50f2953f5deced05768cfbbb 100644 (file)
--- a/send.c
+++ b/send.c
@@ -489,7 +489,7 @@ static void process_user_header(struct Envelope *env)
  * @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;
@@ -508,7 +508,7 @@ void mutt_forward_intro(struct Context *ctx, struct Header *cur, FILE *fp)
  * @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;
@@ -530,7 +530,7 @@ void mutt_forward_trailer(struct Context *ctx, struct Header *cur, FILE *fp)
  * @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;
 
@@ -573,7 +573,7 @@ static int include_forward(struct Context *ctx, struct Header *cur, FILE *out)
  * @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;
@@ -592,7 +592,7 @@ void mutt_make_attribution(struct Context *ctx, struct Header *cur, FILE *out)
  * @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;
@@ -611,7 +611,7 @@ void mutt_make_post_indent(struct Context *ctx, struct Header *cur, FILE *out)
  * @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;
@@ -842,7 +842,7 @@ void mutt_fix_reply_recipients(struct Envelope *env)
  * @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;
@@ -937,7 +937,7 @@ static void make_reference_headers(struct Envelope *curenv,
  * @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;
@@ -1030,8 +1030,8 @@ static int envelope_defaults(struct Envelope *env, struct Context *ctx,
  * @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;
@@ -1289,7 +1289,7 @@ struct Address *mutt_default_from(void)
  * @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;
@@ -1418,13 +1418,13 @@ static void fix_end_of_file(const char *data)
  * @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;
   }
 
@@ -1459,7 +1459,7 @@ int mutt_resend_message(FILE *fp, struct Context *ctx, struct Header *cur)
  * @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;
@@ -1518,8 +1518,8 @@ static bool search_attach_keyword(char *filename)
  * @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 */
@@ -1578,7 +1578,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
 
   if (!msg)
   {
-    msg = mutt_header_new();
+    msg = mutt_email_new();
 
     if (flags == SEND_POSTPONED)
     {
@@ -2446,7 +2446,7 @@ cleanup:
 
   mutt_file_fclose(&tempfp);
   if (!(flags & SEND_NO_FREE_HEADER))
-    mutt_header_free(&msg);
+    mutt_email_free(&msg);
 
   FREE(&finalpath);
   return rc;
diff --git a/send.h b/send.h
index a1d1231d3714fc5cb1ac9e51aa4752889b79a7de..0d2102c87d6b3b31f8666acc65f8be44375e8f53 100644 (file)
--- a/send.h
+++ b/send.h
@@ -30,7 +30,7 @@ struct Address;
 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 */
@@ -94,20 +94,20 @@ extern bool          UseFrom;
 #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 */
index 55e75e809e7a6b3db42658768f93b8c4a3b33bd8..c4a8bcdfeb9076425d7225fff3de4f97d08c6e19 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1450,7 +1450,7 @@ void mutt_update_encoding(struct Body *a)
  * @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;
@@ -1525,7 +1525,7 @@ struct Body *mutt_make_message_attach(struct Context *ctx, struct Header *hdr, b
   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);
@@ -2955,7 +2955,7 @@ void mutt_unprepare_envelope(struct Envelope *env)
  * @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;
@@ -3030,7 +3030,7 @@ static int bounce_message(FILE *fp, struct Header *h, struct Address *to,
  * @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];
@@ -3111,7 +3111,7 @@ static void set_noconv_flags(struct Body *b, bool flag)
  * @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];
@@ -3158,7 +3158,7 @@ int mutt_write_multiple_fcc(const char *path, struct Header *hdr, const char *ms
  * @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;
index 12c367d6e8599902fc611e8f590f222ec0eb7fd2..4c367868f71478620b8deaca299f2b45969cfd9e 100644 (file)
--- a/sendlib.h
+++ b/sendlib.h
@@ -30,7 +30,7 @@ struct Address;
 struct Body;
 struct Context;
 struct Envelope;
-struct Header;
+struct Email;
 struct ListHead;
 struct ParameterList;
 
@@ -54,14 +54,14 @@ extern bool  UserAgent;
 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);
@@ -72,10 +72,10 @@ void            mutt_stamp_attachment(struct Body *a);
 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);
 
diff --git a/sort.c b/sort.c
index e677aef8944d77f5534431f54f443005b0950e7a..16e51be243c43d8119d4beb63b0221936f2f03b3 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -68,7 +68,7 @@ int perform_auxsort(int retval, const void *a, const void *b)
   /* 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;
 }
 
@@ -77,8 +77,8 @@ int perform_auxsort(int retval, const void *a, const void *b)
  */
 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);
@@ -89,8 +89,8 @@ static int compare_score(const void *a, const void *b)
  */
 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);
@@ -101,8 +101,8 @@ static int compare_size(const void *a, const void *b)
  */
 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);
@@ -113,8 +113,8 @@ static int compare_date_sent(const void *a, const void *b)
  */
 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)
@@ -164,8 +164,8 @@ const char *mutt_get_name(struct Address *a)
  */
 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);
@@ -180,8 +180,8 @@ static int compare_to(const void *a, const void *b)
  */
 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);
@@ -196,8 +196,8 @@ static int compare_from(const void *a, const void *b)
  */
 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);
@@ -208,8 +208,8 @@ static int compare_date_received(const void *a, const void *b)
  */
 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);
@@ -220,8 +220,8 @@ static int compare_order(const void *a, const void *b)
  */
 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;
@@ -276,8 +276,8 @@ static int compare_spam(const void *a, const void *b)
  */
 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
@@ -351,7 +351,7 @@ sort_t *mutt_get_sort_func(int method)
  */
 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;
 
@@ -414,13 +414,13 @@ void mutt_sort_headers(struct Context *ctx, bool init)
   }
   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;