]> granicus.if.org Git - neomutt/commitdiff
move Body to library
authorRichard Russon <rich@flatcap.org>
Tue, 3 Jul 2018 16:09:43 +0000 (17:09 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 16 Jul 2018 21:24:00 +0000 (22:24 +0100)
48 files changed:
Makefile.autosetup
attach.c
browser.c
commands.c
compose.c
copy.c
curs_main.c
edit.c
enriched.c
handler.c
hcache/hcache.c
hdrline.c
header.c
imap/imap.c
imap/message.c
main.c
mbox.c
mh.c
mutt/body.c [new file with mode: 0644]
mutt/body.h [moved from body.h with 97% similarity]
mutt/header.c [new file with mode: 0644]
mutt/mutt.h
mutt_body.c [moved from body.c with 71% similarity]
mutt_body.h [new file with mode: 0644]
mutt_notmuch.c
muttlib.c
mx.c
ncrypt/crypt.c
ncrypt/crypt_gpgme.c
ncrypt/pgp.c
ncrypt/pgpkey.c
ncrypt/smime.c
nntp.c
pager.c
parse.c
pattern.c
po/POTFILES.in
pop.c
postpone.c
recvattach.c
recvcmd.c
rfc1524.c
rfc3676.c
safe_asprintf.c
send.c
sendlib.c
sort.c
thread.c

index bd80b14676fe6bd371d71e1aca06387bbf9e0f17..aa2ace9175686665da1a045be4bc2bda0bc51f9b 100644 (file)
@@ -61,12 +61,12 @@ ALL_FILES!= (cd $(SRCDIR) && git ls-files 2>/dev/null) || true
 ###############################################################################
 # neomutt
 NEOMUTT=       neomutt$(EXEEXT)
-NEOMUTTOBJS=   addrbook.o alias.o attach.o bcache.o body.o browser.o buffy.o \
+NEOMUTTOBJS=   addrbook.o alias.o attach.o bcache.o browser.o buffy.o \
                color.o commands.o complete.o compose.o compress.o \
                conststrings.o copy.o curs_lib.o curs_main.o edit.o editmsg.o \
                enriched.o enter.o filter.o flags.o from.o group.o handler.o \
                hdrline.o header.o help.o history.o hook.o init.o keymap.o \
-               main.o mbox.o menu.o mh.o muttlib.o mutt_account.o \
+               main.o mbox.o menu.o mh.o muttlib.o mutt_account.o mutt_body.o \
                mutt_logging.o mutt_signal.o mutt_socket.o mutt_window.o mx.o newsrc.o \
                nntp.o pager.o parse.o pattern.o pop.o pop_auth.o pop_lib.o \
                postpone.o progress.o query.o recvattach.o recvcmd.o resize.o rfc1524.o \
@@ -92,7 +92,7 @@ ALLOBJS+=     $(NEOMUTTOBJS)
 ###############################################################################
 # libmutt
 LIBMUTT=       libmutt.a
-LIBMUTTOBJS=   mutt/address.o mutt/base64.o mutt/buffer.o mutt/charset.o \
+LIBMUTTOBJS=   mutt/address.o mutt/base64.o mutt/body.o mutt/buffer.o mutt/charset.o \
                mutt/date.o mutt/envelope.o mutt/envlist.o mutt/exit.o mutt/file.o mutt/hash.o \
                mutt/idna.o mutt/list.o mutt/logging.o mutt/mapping.o \
                mutt/mbyte.o mutt/md5.o mutt/memory.o mutt/mime.o \
@@ -264,14 +264,13 @@ git_ver.h: $(ALL_FILES)
 
 hcache/hcversion.h:    $(SRCDIR)/mutt.h $(SRCDIR)/mutt/address.h \
                        $(SRCDIR)/mutt/list.h $(SRCDIR)/mutt/buffer.h \
-                       $(SRCDIR)/mutt/parameter.h $(SRCDIR)/body.h \
+                       $(SRCDIR)/mutt/parameter.h $(SRCDIR)/mutt/body.h \
                        $(SRCDIR)/mutt/envelope.h $(SRCDIR)/header.h \
                        $(SRCDIR)/hcache/hcachever.sh
        $(MKDIR_P) $(PWD)/hcache
        ( echo '#include "config.h"'; echo '#include "mutt.h"'; \
        echo '#include "mutt/address.h"'; echo '#include "mutt/list.h"'; \
        echo '#include "mutt/buffer.h"'; echo '#include "mutt/parameter.h"'; \
-       echo '#include "body.h"'; echo '#include "mutt/envelope.h"'; \
        echo '#include "header.h"';) | $(CPP) $(CFLAGS) - | \
        sh $(SRCDIR)/hcache/hcachever.sh hcache/hcversion.h
 
index f15fe413cb492febce7c18811db92df3763d55f2..1a88a8c17153082cbdc8ce4adfb39405f2947e55 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -31,7 +31,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "attach.h"
-#include "body.h"
 #include "context.h"
 #include "copy.h"
 #include "filter.h"
index f0faa7822f3b350afdd8439bbbb84fc7fe9f8a62..93c3198bd5e99222156b5aa0005e0a40343ed2ab 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -40,7 +40,6 @@
 #include "mutt.h"
 #include "browser.h"
 #include "attach.h"
-#include "body.h"
 #include "buffy.h"
 #include "context.h"
 #include "format_flags.h"
index 47241ebd747011aa2f41df73a635335a77cc8103..3bf6a3ec2e41e26169782e508b24b533cf6d69b1 100644 (file)
@@ -33,7 +33,6 @@
 #include "conn/conn.h"
 #include "mutt.h"
 #include "alias.h"
-#include "body.h"
 #include "buffy.h"
 #include "context.h"
 #include "copy.h"
index aee999ef322e478913aa896365f9d79aa749594e..b565108096e834e63aebedb922dddb00f6def991 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -34,7 +34,6 @@
 #include "mutt.h"
 #include "alias.h"
 #include "attach.h"
-#include "body.h"
 #include "context.h"
 #include "format_flags.h"
 #include "globals.h"
diff --git a/copy.c b/copy.c
index 12d02570d5097e9810cc496f11ddb8ecbab264e5..098716a485fa930c033e1a176eb13806422d2fdc 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -34,7 +34,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "copy.h"
-#include "body.h"
 #include "context.h"
 #include "globals.h"
 #include "handler.h"
index 00cc73b2dd70d3dced2dc7d1569db36e83658b82..01acb251c7f6adb5a05f109f56b86bbe324a27a6 100644 (file)
@@ -32,7 +32,6 @@
 #include "conn/conn.h"
 #include "mutt.h"
 #include "alias.h"
-#include "body.h"
 #include "buffy.h"
 #include "context.h"
 #include "format_flags.h"
diff --git a/edit.c b/edit.c
index cd480e30d6ab6d115ee602f428df99e888020688..1c7ba70afc4520035846206d6427d1a0e3271cbe 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -32,7 +32,6 @@
 #include <sys/stat.h>
 #include "mutt/mutt.h"
 #include "alias.h"
-#include "body.h"
 #include "context.h"
 #include "globals.h"
 #include "header.h"
index 585d145fd0a4e873d6cca23d803111c9c6e6c629..3c11d24dae8f4e6e331ee04e1efd1952253c8358 100644 (file)
@@ -32,7 +32,6 @@
 #include <wchar.h>
 #include <wctype.h>
 #include "mutt/mutt.h"
-#include "body.h"
 #include "mutt_window.h"
 #include "state.h"
 
index b2ee00e457b2ed1116167b9d0bba31b5238eebd9..cc8467a5c71f66ba1aaafae6a66d409c91f5b540 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -35,7 +35,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "handler.h"
-#include "body.h"
 #include "copy.h"
 #include "enriched.h"
 #include "filter.h"
index 073e166cfb2f7e4b6241aa0490ac41ed312d7ab9..d6107877631d636969cf3ca24a4dc34879770595 100644 (file)
@@ -49,7 +49,6 @@
 #include <unistd.h>
 #include "mutt/mutt.h"
 #include "backend.h"
-#include "body.h"
 #include "globals.h"
 #include "hcache.h"
 #include "hcache/hcversion.h"
index f5414cb8577af7f01e0f93038eb1e3ac727dc8ec..4298a5975502adf323980ae1aa070109333bcb36 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -31,7 +31,6 @@
 #include <time.h>
 #include "mutt/mutt.h"
 #include "mutt.h"
-#include "body.h"
 #include "context.h"
 #include "format_flags.h"
 #include "globals.h"
index f838bfe1c9d51f1a268edd7e39d2655c315143de..fe16ef61396e7e362febc7679b057853f144c1cc 100644 (file)
--- a/header.c
+++ b/header.c
@@ -31,7 +31,6 @@
 #include "mutt.h"
 #include "header.h"
 #include "alias.h"
-#include "body.h"
 #include "context.h"
 #include "globals.h"
 #include "ncrypt/ncrypt.h"
index e7fe8e66f84c906417c93f45b0a612e6e19dfd4c..2756a47be9d89f062b99b628b606eea431c49694 100644 (file)
@@ -44,7 +44,6 @@
 #include "imap.h"
 #include "auth.h"
 #include "bcache.h"
-#include "body.h"
 #include "buffy.h"
 #include "context.h"
 #include "globals.h"
index a08092227b53ab0076e4204f196c142ad97b5a58..aef50279d755e1765cfbcd569335c36aa8f01b77 100644 (file)
@@ -40,7 +40,6 @@
 #include "mutt.h"
 #include "message.h"
 #include "bcache.h"
-#include "body.h"
 #include "context.h"
 #include "globals.h"
 #include "header.h"
diff --git a/main.c b/main.c
index 081602b924376393782ee55317e90d5675220d2b..969d339b28a3c37d88b48047387bacc475d726dc 100644 (file)
--- a/main.c
+++ b/main.c
@@ -45,7 +45,6 @@
 #include "conn/conn.h"
 #include "mutt.h"
 #include "alias.h"
-#include "body.h"
 #include "buffy.h"
 #include "globals.h"
 #include "header.h"
diff --git a/mbox.c b/mbox.c
index df94b10dccb21113dc98f7b5f1e935654c31c4af..bfa9f1b28ff8d7a1579a3c4a43613a6612f878f2 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -34,7 +34,6 @@
 #include <utime.h>
 #include "mutt/mutt.h"
 #include "mutt.h"
-#include "body.h"
 #include "buffy.h"
 #include "context.h"
 #include "copy.h"
@@ -596,24 +595,6 @@ static int mbox_msg_open_new(struct Context *ctx, struct Message *msg, struct He
   return 0;
 }
 
-/**
- * strict_cmp_bodies - Strictly compare two email Body's
- * @param b1 First Body
- * @param b2 Second Body
- * @retval true Body's are strictly identical
- */
-static bool strict_cmp_bodies(const struct Body *b1, const struct Body *b2)
-{
-  if ((b1->type != b2->type) || (b1->encoding != b2->encoding) ||
-      (mutt_str_strcmp(b1->subtype, b2->subtype) != 0) ||
-      (mutt_str_strcmp(b1->description, b2->description) != 0) ||
-      !mutt_param_cmp_strict(&b1->parameter, &b2->parameter) || (b1->length != b2->length))
-  {
-    return false;
-  }
-  return true;
-}
-
 /**
  * mbox_strict_cmp_headers - Strictly compare message headers
  * @param h1 First Header
@@ -629,7 +610,7 @@ bool mbox_strict_cmp_headers(const struct Header *h1, const struct Header *h2)
         (h1->lines != h2->lines) || (h1->zhours != h2->zhours) ||
         (h1->zminutes != h2->zminutes) || (h1->zoccident != h2->zoccident) ||
         (h1->mime != h2->mime) || !mutt_env_cmp_strict(h1->env, h2->env) ||
-        !strict_cmp_bodies(h1->content, h2->content))
+        !mutt_body_cmp_strict(h1->content, h2->content))
     {
       return false;
     }
diff --git a/mh.c b/mh.c
index 68d2d5369c1644cc658523396df8f9a1e1b23208..7bd48e05b839bafa92b5e2e7022efd37cb48ae1e 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -40,7 +40,6 @@
 #include <utime.h>
 #include "mutt/mutt.h"
 #include "mutt.h"
-#include "body.h"
 #include "buffy.h"
 #include "context.h"
 #include "copy.h"
diff --git a/mutt/body.c b/mutt/body.c
new file mode 100644 (file)
index 0000000..083266b
--- /dev/null
@@ -0,0 +1,116 @@
+/**
+ * @file
+ * Representation of the body of an email
+ *
+ * @authors
+ * Copyright (C) 2017 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @page body Representation of the body of an email
+ *
+ * Representation of the body of an email
+ */
+
+#include "config.h"
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+#include "body.h"
+#include "header.h"
+#include "logging.h"
+#include "memory.h"
+#include "mime.h"
+#include "string2.h"
+
+/**
+ * mutt_body_new - Create a new Body
+ * @retval ptr Newly allocated Body
+ */
+struct Body *mutt_body_new(void)
+{
+  struct Body *p = mutt_mem_calloc(1, sizeof(struct Body));
+
+  p->disposition = DISPATTACH;
+  p->use_disp = true;
+  TAILQ_INIT(&p->parameter);
+  return p;
+}
+
+/**
+ * mutt_body_free - Free a Body
+ * @param p Body to free
+ */
+void mutt_body_free(struct Body **p)
+{
+  struct Body *a = *p, *b = NULL;
+
+  while (a)
+  {
+    b = a;
+    a = a->next;
+
+    mutt_param_free(&b->parameter);
+    if (b->filename)
+    {
+      if (b->unlink)
+        unlink(b->filename);
+      mutt_debug(1, "%sunlinking %s.\n", b->unlink ? "" : "not ", b->filename);
+    }
+
+    FREE(&b->filename);
+    FREE(&b->d_filename);
+    FREE(&b->charset);
+    FREE(&b->content);
+    FREE(&b->xtype);
+    FREE(&b->subtype);
+    FREE(&b->description);
+    FREE(&b->form_name);
+
+    if (b->hdr)
+    {
+      /* Don't free twice (b->hdr->content = b->parts) */
+      b->hdr->content = NULL;
+      mutt_header_free(&b->hdr);
+    }
+
+    if (b->parts)
+      mutt_body_free(&b->parts);
+
+    FREE(&b);
+  }
+
+  *p = 0;
+}
+
+/**
+ * mutt_body_cmp_strict - Strictly compare two email Body's
+ * @param b1 First Body
+ * @param b2 Second Body
+ * @retval true Body's are strictly identical
+ */
+bool mutt_body_cmp_strict(const struct Body *b1, const struct Body *b2)
+{
+  if ((b1->type != b2->type) || (b1->encoding != b2->encoding) ||
+      (mutt_str_strcmp(b1->subtype, b2->subtype) != 0) ||
+      (mutt_str_strcmp(b1->description, b2->description) != 0) ||
+      !mutt_param_cmp_strict(&b1->parameter, &b2->parameter) || (b1->length != b2->length))
+  {
+    return false;
+  }
+  return true;
+}
similarity index 97%
rename from body.h
rename to mutt/body.h
index 00f5b22ff1054f9e48687b65c2c189f3c01d6871..b46c1ca6c2981b33d47ebb1dadf9c4d869b10d94 100644 (file)
--- a/body.h
@@ -26,7 +26,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <time.h>
-#include "mutt/mutt.h"
+#include "parameter.h"
 
 /**
  * struct Body - The body of an email
@@ -99,7 +99,7 @@ struct Body
 
 };
 
-int          mutt_body_copy(FILE *fp, struct Body **tgt, struct Body *src);
+bool         mutt_body_cmp_strict(const struct Body *b1, const struct Body *b2);
 void         mutt_body_free(struct Body **p);
 struct Body *mutt_body_new(void);
 
diff --git a/mutt/header.c b/mutt/header.c
new file mode 100644 (file)
index 0000000..8cd0473
--- /dev/null
@@ -0,0 +1,113 @@
+/**
+ * @file
+ * Representation of the email's header
+ *
+ * @authors
+ * Copyright (C) 1996-2009,2012 Michael R. Elkins <me@mutt.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @page header Representation of the email's header
+ *
+ * Representation of the email's header
+ */
+
+#include "config.h"
+#include <limits.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <time.h>
+#include "header.h"
+#include "body.h"
+#include "envelope.h"
+#include "file.h"
+#include "hash.h"
+#include "logging.h"
+#include "memory.h"
+#include "string2.h"
+
+/**
+ * mutt_header_free - Free an email Header
+ * @param h Header to free
+ */
+void mutt_header_free(struct Header **h)
+{
+  if (!h || !*h)
+    return;
+  mutt_env_free(&(*h)->env);
+  mutt_body_free(&(*h)->content);
+  FREE(&(*h)->maildir_flags);
+  FREE(&(*h)->tree);
+  FREE(&(*h)->path);
+#ifdef MIXMASTER
+  mutt_list_free(&(*h)->chain);
+#endif
+  driver_tags_free(&(*h)->tags);
+#if defined(USE_POP) || defined(USE_IMAP) || defined(USE_NNTP) || defined(USE_NOTMUCH)
+  if ((*h)->free_cb)
+    (*h)->free_cb(*h);
+  FREE(&(*h)->data);
+#endif
+  FREE(h);
+}
+
+/**
+ * mutt_header_new - Create a new email Header
+ * @retval ptr Newly created Header
+ */
+struct Header *mutt_header_new(void)
+{
+  struct Header *h = mutt_mem_calloc(1, sizeof(struct Header));
+#ifdef MIXMASTER
+  STAILQ_INIT(&h->chain);
+#endif
+  STAILQ_INIT(&h->tags);
+  return h;
+}
+
+/**
+ * mutt_header_cmp_strict - Strictly compare message headers
+ * @param h1 First Header
+ * @param h2 Second Header
+ * @retval true Headers are strictly identical
+ */
+bool mutt_header_cmp_strict(const struct Header *h1, const struct Header *h2)
+{
+  if (h1 && h2)
+  {
+    if ((h1->received != h2->received) || (h1->date_sent != h2->date_sent) ||
+        (h1->content->length != h2->content->length) ||
+        (h1->lines != h2->lines) || (h1->zhours != h2->zhours) ||
+        (h1->zminutes != h2->zminutes) || (h1->zoccident != h2->zoccident) ||
+        (h1->mime != h2->mime) || !mutt_env_cmp_strict(h1->env, h2->env) ||
+        !mutt_body_cmp_strict(h1->content, h2->content))
+    {
+      return false;
+    }
+    else
+      return true;
+  }
+  else
+  {
+    if (!h1 && !h2)
+      return true;
+    else
+      return false;
+  }
+}
index 718683ebf3267de7e10d0ffb566b1f17278a5fb0..841abb4acad20b6ea505468b229e9c6b068c8cb7 100644 (file)
@@ -29,6 +29,7 @@
  * | :--------------- | :----------------- |
  * | mutt/address.c   | @subpage address   |
  * | mutt/base64.c    | @subpage base64    |
+ * | mutt/body.c      | @subpage base64    |
  * | mutt/buffer.c    | @subpage buffer    |
  * | mutt/charset.c   | @subpage charset   |
  * | mutt/date.c      | @subpage date      |
@@ -61,6 +62,7 @@
 
 #include "address.h"
 #include "base64.h"
+#include "body.h"
 #include "buffer.h"
 #include "charset.h"
 #include "content.h"
similarity index 71%
rename from body.c
rename to mutt_body.c
index 6d09e48278dafd0041a681888fc2c80c7a0f46fe..58d6a14cc350c4c502a08b969f17a070bd09a67c 100644 (file)
--- a/body.c
 #include <limits.h>
 #include <string.h>
 #include <unistd.h>
-#include "mutt/mutt.h"
-#include "body.h"
-#include "header.h"
 #include "protos.h"
 
-/**
- * mutt_body_new - Create a new Body
- * @retval ptr Newly allocated Body
- */
-struct Body *mutt_body_new(void)
-{
-  struct Body *p = mutt_mem_calloc(1, sizeof(struct Body));
-
-  p->disposition = DISPATTACH;
-  p->use_disp = true;
-  TAILQ_INIT(&p->parameter);
-  return p;
-}
-
 /**
  * mutt_body_copy - Create a send-mode duplicate from a receive-mode body
  * @param[in]  fp  FILE pointer to attachments
@@ -129,49 +112,3 @@ int mutt_body_copy(FILE *fp, struct Body **tgt, struct Body *src)
 
   return 0;
 }
-
-/**
- * mutt_body_free - Free a Body
- * @param p Body to free
- */
-void mutt_body_free(struct Body **p)
-{
-  struct Body *a = *p, *b = NULL;
-
-  while (a)
-  {
-    b = a;
-    a = a->next;
-
-    mutt_param_free(&b->parameter);
-    if (b->filename)
-    {
-      if (b->unlink)
-        unlink(b->filename);
-      mutt_debug(1, "%sunlinking %s.\n", b->unlink ? "" : "not ", b->filename);
-    }
-
-    FREE(&b->filename);
-    FREE(&b->d_filename);
-    FREE(&b->charset);
-    FREE(&b->content);
-    FREE(&b->xtype);
-    FREE(&b->subtype);
-    FREE(&b->description);
-    FREE(&b->form_name);
-
-    if (b->hdr)
-    {
-      /* Don't free twice (b->hdr->content = b->parts) */
-      b->hdr->content = NULL;
-      mutt_header_free(&b->hdr);
-    }
-
-    if (b->parts)
-      mutt_body_free(&b->parts);
-
-    FREE(&b);
-  }
-
-  *p = 0;
-}
diff --git a/mutt_body.h b/mutt_body.h
new file mode 100644 (file)
index 0000000..e4322b5
--- /dev/null
@@ -0,0 +1,32 @@
+/**
+ * @file
+ * Representation of the body of an email
+ *
+ * @authors
+ * Copyright (C) 2017 Richard Russon <rich@flatcap.org>
+ *
+ * @copyright
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _MUTT_BODY2_H
+#define _MUTT_BODY2_H
+
+#include <stdio.h>
+
+struct Body;
+
+int mutt_body_copy(FILE *fp, struct Body **tgt, struct Body *src);
+
+#endif /* _MUTT_BODY2_H */
index 3c1276e52fe11375ee074fd9bd5dde7e95894685..5b5b06d04ec28d95ad74d5c9482e68cc90e76533 100644 (file)
@@ -50,7 +50,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "mutt_notmuch.h"
-#include "body.h"
 #include "buffy.h"
 #include "context.h"
 #include "globals.h"
index 0970e23ccf7b02d1a13c76e32cc59ee042b72f7b..7dbb2dff2f9aa3e33bbf55f95d91faa5cfc84a54 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -43,7 +43,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "alias.h"
-#include "body.h"
 #include "filter.h"
 #include "format_flags.h"
 #include "globals.h"
diff --git a/mx.c b/mx.c
index a5b846a2ad5162f25d77711195103fc8367c4da1..80fd481cf0dc2212f2ce70edda4b8dc28820cca8 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -39,7 +39,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "mx.h"
-#include "body.h"
 #include "buffy.h"
 #include "context.h"
 #include "copy.h"
index d8ffdb3db975819519f5af9bf3de1e79c9b65ade..92bc91028a4b40a558d88b57f15257cc6e0cffd5 100644 (file)
@@ -41,7 +41,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "alias.h"
-#include "body.h"
 #include "context.h"
 #include "copy.h"
 #include "cryptglue.h"
index a1157f21ab679204f408d887cd7f91a50a72a286..ae0caa82decb9d00bc15dcd51b872ef1ac50452c 100644 (file)
@@ -51,7 +51,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "alias.h"
-#include "body.h"
 #include "crypt.h"
 #include "format_flags.h"
 #include "globals.h"
index 77c916cde43fe3bccf77b314c4c8a42dc325c635..b57fe47420a495fa4ece57319ef8eab3743117c2 100644 (file)
@@ -44,7 +44,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "pgp.h"
-#include "body.h"
 #include "crypt.h"
 #include "cryptglue.h"
 #include "filter.h"
index ebf4f7bea0ba67f6b967406faf11f0301fd1a5cf..4841417e19a488972a4e3ff5ff45885e69550d11 100644 (file)
@@ -41,7 +41,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "pgpkey.h"
-#include "body.h"
 #include "crypt.h"
 #include "filter.h"
 #include "format_flags.h"
index e4ffe26de45b49b6d05b6e05961b21d4fdcc919b..ff9428794787dfcab7f3c69b0da4aae79359e374 100644 (file)
@@ -39,7 +39,6 @@
 #include "mutt.h"
 #include "smime.h"
 #include "alias.h"
-#include "body.h"
 #include "copy.h"
 #include "crypt.h"
 #include "cryptglue.h"
diff --git a/nntp.c b/nntp.c
index 36732787a297be5ccd25496d8ee5e0a12dddf3b5..2f4bd1d5ada0b1f84d6ed5206fb9d2bff8fa2b4f 100644 (file)
--- a/nntp.c
+++ b/nntp.c
@@ -39,7 +39,6 @@
 #include "mutt.h"
 #include "nntp.h"
 #include "bcache.h"
-#include "body.h"
 #include "context.h"
 #include "globals.h"
 #include "header.h"
diff --git a/pager.c b/pager.c
index c21af6fe48c2180bd4024c151d35a3fb07a73080..ea7a640f8a94a13c8769f68c8052b76ab6643940 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -37,7 +37,6 @@
 #include "pager.h"
 #include "alias.h"
 #include "attach.h"
-#include "body.h"
 #include "context.h"
 #include "format_flags.h"
 #include "globals.h"
diff --git a/parse.c b/parse.c
index 6e6966a0c3ab05cc2617fef0c1d1cd1de37c76f6..53b3e90da1482ce93fc3796c0050efd5ecd96e52 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -30,7 +30,6 @@
 #include <time.h>
 #include "mutt/mutt.h"
 #include "mutt.h"
-#include "body.h"
 #include "globals.h"
 #include "header.h"
 #include "mailbox.h"
index ed7d2a756327223e5fee46bd5366eecead3f4797..1c2a3b32226c5adf4be518a5b4c343b704fbf3de 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -37,7 +37,6 @@
 #include "conn/conn.h"
 #include "mutt.h"
 #include "pattern.h"
-#include "body.h"
 #include "context.h"
 #include "copy.h"
 #include "globals.h"
index 55aba6b01e22e9b0cae863115ab837a1cb960aee..aadfcbd49c9e572f7f4eb4d5cd9deb0ea316bac0 100644 (file)
@@ -2,7 +2,6 @@ addrbook.c
 alias.c
 attach.c
 bcache.c
-body.c
 browser.c
 buffy.c
 color.c
@@ -64,6 +63,7 @@ menu.c
 mh.c
 mutt/address.c
 mutt/base64.c
+mutt/body.c
 mutt/buffer.c
 mutt/charset.c
 mutt/date.c
@@ -87,6 +87,7 @@ mutt/sha1.c
 mutt/signal.c
 mutt/string.c
 mutt_account.c
+mutt_body.c
 mutt_logging.c
 mutt_lua.c
 mutt_notmuch.c
diff --git a/pop.c b/pop.c
index aef7d651ec9e60059d6a8cef29956964f2494745..b2557b65a49bafd838a3d9d0bea4431d991f0c99 100644 (file)
--- a/pop.c
+++ b/pop.c
@@ -39,7 +39,6 @@
 #include "mutt.h"
 #include "pop.h"
 #include "bcache.h"
-#include "body.h"
 #include "context.h"
 #include "globals.h"
 #include "header.h"
index 3c62a932a411b2fdd548b4ac047586f60b698ab3..1f65d7458ec3a9565452f0f8f24ef907a765a95b 100644 (file)
@@ -38,7 +38,6 @@
 #include "mutt/mutt.h"
 #include "conn/conn.h"
 #include "mutt.h"
-#include "body.h"
 #include "context.h"
 #include "format_flags.h"
 #include "globals.h"
index aa60d79b2ad78dd08efd9ba45e61d59516cc20de..e095ac14824ebf0d38d7eeb8d56464b3367f42b8 100644 (file)
@@ -31,7 +31,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "attach.h"
-#include "body.h"
 #include "context.h"
 #include "filter.h"
 #include "format_flags.h"
index c9a16e540a331fceb0a12e489adbf72a8ee9e6b6..400c2daf6d73db09f367b92885cfdc6f26b53fa0 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
 #include "mutt.h"
 #include "alias.h"
 #include "attach.h"
-#include "body.h"
 #include "copy.h"
 #include "globals.h"
 #include "handler.h"
 #include "header.h"
+#include "mutt_body.h"
 #include "mutt_curses.h"
 #include "mutt_window.h"
 #include "options.h"
index 0f146eb722b7de66187b0dc5b8edbffacee55729..551d6e518cf282304a0bd46f94fad694484eeedb 100644 (file)
--- a/rfc1524.c
+++ b/rfc1524.c
@@ -39,7 +39,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "rfc1524.h"
-#include "body.h"
 #include "globals.h"
 #include "options.h"
 #include "protos.h"
index c5ed0cc5e2cb62c6f60bd073de634887bce4cc22..302d6203594c6a3f41526cf249f9b8e874f88a01 100644 (file)
--- a/rfc3676.c
+++ b/rfc3676.c
@@ -30,7 +30,6 @@
 #include <string.h>
 #include <unistd.h>
 #include "mutt/mutt.h"
-#include "body.h"
 #include "globals.h"
 #include "header.h"
 #include "mutt_curses.h"
index 23870494384e4f5722e4504ca02a9c4582af4017..608c1ffc23eaf016dbd2fe8768b7ed00b873ec2d 100644 (file)
@@ -33,6 +33,7 @@
 #include <stdarg.h>
 #include <stdbool.h>
 #include <stdio.h>
+#include "config.h"
 #include "mutt/mutt.h"
 
 #ifdef HAVE_VASPRINTF
diff --git a/send.c b/send.c
index fd80df9dec024ddfdb6ef839f5102e76a6ab4ba2..0c9bf07dd05c0852b0990a97e3b0ae5b0cae173e 100644 (file)
--- a/send.c
+++ b/send.c
@@ -34,7 +34,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "alias.h"
-#include "body.h"
 #include "context.h"
 #include "copy.h"
 #include "filter.h"
index 10bc6b7505dd26493218964255fd2f68c2f3cb08..c48063df71848efa3545114accef9e3e9e62d1b7 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -37,7 +37,6 @@
 #include <unistd.h>
 #include "mutt/mutt.h"
 #include "mutt.h"
-#include "body.h"
 #include "buffy.h"
 #include "context.h"
 #include "copy.h"
diff --git a/sort.c b/sort.c
index 3384cd06195f9fdc1639b19b759c95af793a42ce..8584914f1a8e34212fd77f9feb20bef5a3cd0738 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -26,7 +26,6 @@
 #include <string.h>
 #include "mutt/mutt.h"
 #include "sort.h"
-#include "body.h"
 #include "context.h"
 #include "globals.h"
 #include "header.h"
index 07b77ffd6d2f47bf50a4768b6b2f43e263eef4da..fa05913f0a582eea7b1e6efbf9c71fa0e517c55e 100644 (file)
--- a/thread.c
+++ b/thread.c
@@ -29,7 +29,6 @@
 #include "mutt/mutt.h"
 #include "mutt.h"
 #include "thread.h"
-#include "body.h"
 #include "context.h"
 #include "globals.h"
 #include "header.h"