]> granicus.if.org Git - neomutt/commitdiff
rename body functions
authorRichard Russon <rich@flatcap.org>
Sun, 1 Apr 2018 01:31:40 +0000 (02:31 +0100)
committerRichard Russon <rich@flatcap.org>
Sun, 1 Apr 2018 01:31:40 +0000 (02:31 +0100)
24 files changed:
attach.c
body.c
body.h
browser.c
commands.c
compose.c
copy.c
handler.c
hcache/hcache.c
header.c
main.c
mbox.c
mh.c
ncrypt/crypt.c
ncrypt/crypt_gpgme.c
ncrypt/pgp.c
ncrypt/pgpkey.c
ncrypt/smime.c
parse.c
postpone.c
recvattach.c
recvcmd.c
send.c
sendlib.c

index 791f6fd076361dce60e675d87fd88a30b04c31d8..7587c04666f253af250a42dd3eb873e257087096 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -175,7 +175,7 @@ int mutt_compose_attachment(struct Body *a)
             /* Remove headers by copying out data to another file, then
              * copying the file back */
             fseeko(fp, b->offset, SEEK_SET);
-            mutt_free_body(&b);
+            mutt_body_free(&b);
             mutt_mktemp(tempfile, sizeof(tempfile));
             FILE *tfp = mutt_file_fopen(tempfile, "w");
             if (!tfp)
@@ -1183,7 +1183,7 @@ void mutt_actx_free_entries(struct AttachCtx *actx)
   actx->fp_len = 0;
 
   for (i = 0; i < actx->body_len; i++)
-    mutt_free_body(&actx->body_idx[i]);
+    mutt_body_free(&actx->body_idx[i]);
   actx->body_len = 0;
 }
 
diff --git a/body.c b/body.c
index 341f4d98017b0af2758120c3b9323b81c41ef600..dec39886e5ead18be99f94071d37045855b92539 100644 (file)
--- a/body.c
+++ b/body.c
@@ -29,7 +29,7 @@
 #include "header.h"
 #include "protos.h"
 
-struct Body *mutt_new_body(void)
+struct Body *mutt_body_new(void)
 {
   struct Body *p = mutt_mem_calloc(1, sizeof(struct Body));
 
@@ -40,9 +40,9 @@ struct Body *mutt_new_body(void)
 }
 
 /**
- * mutt_copy_body - create a send-mode duplicate from a receive-mode body
+ * mutt_body_copy - create a send-mode duplicate from a receive-mode body
  */
-int mutt_copy_body(FILE *fp, struct Body **tgt, struct Body *src)
+int mutt_body_copy(FILE *fp, struct Body **tgt, struct Body *src)
 {
   if (!tgt || !src)
     return -1;
@@ -67,7 +67,7 @@ int mutt_copy_body(FILE *fp, struct Body **tgt, struct Body *src)
   if (mutt_save_attachment(fp, src, tmp, 0, NULL) == -1)
     return -1;
 
-  *tgt = mutt_new_body();
+  *tgt = mutt_body_new();
   b = *tgt;
 
   memcpy(b, src, sizeof(struct Body));
@@ -115,7 +115,7 @@ int mutt_copy_body(FILE *fp, struct Body **tgt, struct Body *src)
   return 0;
 }
 
-void mutt_free_body(struct Body **p)
+void mutt_body_free(struct Body **p)
 {
   struct Body *a = *p, *b = NULL;
 
@@ -149,7 +149,7 @@ void mutt_free_body(struct Body **p)
     }
 
     if (b->parts)
-      mutt_free_body(&b->parts);
+      mutt_body_free(&b->parts);
 
     FREE(&b);
   }
diff --git a/body.h b/body.h
index ae03a0491ddf2e7fe7fa6f2be89b80eff33c2d51..50224d20a8de63d0f799f0629f772d9299af0073 100644 (file)
--- a/body.h
+++ b/body.h
@@ -79,8 +79,7 @@ struct Body
   bool noconv : 1;              /**< don't do character set conversion */
   bool force_charset : 1;
                                 /**< send mode: don't adjust the character
-   * set when in send-mode.
-   */
+                                 * set when in send-mode.  */
   bool is_signed_data : 1;      /**< A lot of MUAs don't indicate S/MIME
                                  * signed-data correctly, e.g. they use foo.p7m
                                  * even for the name of signed data.  This flag
@@ -100,8 +99,8 @@ struct Body
 
 };
 
-struct Body *mutt_new_body(void);
-int mutt_copy_body(FILE *fp, struct Body **tgt, struct Body *src);
-void mutt_free_body(struct Body **p);
+int          mutt_body_copy(FILE *fp, struct Body **tgt, struct Body *src);
+void         mutt_body_free(struct Body **p);
+struct Body *mutt_body_new(void);
 
 #endif /* _MUTT_BODY_H */
index 17eb750f41e1b5c95da60d827a28caee570286db..fddb0c7a2e4617fbfeedf16634faee5f591cf05f 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -2021,7 +2021,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi
           if (b)
           {
             mutt_view_attachment(NULL, b, MUTT_REGULAR, NULL, NULL);
-            mutt_free_body(&b);
+            mutt_body_free(&b);
             menu->redraw = REDRAW_FULL;
           }
           else
index 52e8ee2e5a5d6ddaf7520bcc0c1960eb851e0c0e..0acef5b798f9e2db0d64c164bdaebfac32943fae 100644 (file)
@@ -1021,7 +1021,7 @@ int mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp)
   if (!is_multipart(b) && b->parts)
   {
     structure_changed = 1;
-    mutt_free_body(&b->parts);
+    mutt_body_free(&b->parts);
   }
   if (!mutt_is_message_type(b->type, b->subtype) && b->hdr)
   {
index 81cfe3c71c074345757fd86f28fac628bbe09b46..ef7d5a8baa9ed39b43ccc9da3be1a393b8ebaaef 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -507,7 +507,7 @@ static int delete_attachment(struct AttachCtx *actx, int x)
 
   idx[rindex]->content->next = NULL;
   idx[rindex]->content->parts = NULL;
-  mutt_free_body(&(idx[rindex]->content));
+  mutt_body_free(&(idx[rindex]->content));
   FREE(&idx[rindex]->tree);
   FREE(&idx[rindex]);
   for (; rindex < actx->idxlen - 1; rindex++)
@@ -1535,7 +1535,7 @@ int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen,
               /* avoid freeing other attachments */
               actx->idx[i]->content->next = NULL;
               actx->idx[i]->content->parts = NULL;
-              mutt_free_body(&actx->idx[i]->content);
+              mutt_body_free(&actx->idx[i]->content);
             }
           }
           r = -1;
diff --git a/copy.c b/copy.c
index 5602c09bb054d5a50dc2e3beae7eb53946e1e4bc..2d0b6c3f3c937b8bb3882fcbb5b341b5b13e7db3 100644 (file)
--- a/copy.c
+++ b/copy.c
@@ -629,7 +629,7 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Header *hdr, int flags,
           Context->vsize -= body->length - new_length;
 
         body->length = new_length;
-        mutt_free_body(&body->parts);
+        mutt_body_free(&body->parts);
       }
 
       return 0;
@@ -702,10 +702,10 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Header *hdr, int flags,
     if (mutt_file_copy_bytes(fp, fpout, cur->length) == -1)
     {
       mutt_file_fclose(&fp);
-      mutt_free_body(&cur);
+      mutt_body_free(&cur);
       return -1;
     }
-    mutt_free_body(&cur);
+    mutt_body_free(&cur);
     mutt_file_fclose(&fp);
   }
   else
@@ -735,7 +735,7 @@ int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Header *hdr, int flags,
   if ((flags & MUTT_CM_UPDATE) && (flags & MUTT_CM_NOHEADER) == 0 && new_offset != -1)
   {
     body->offset = new_offset;
-    mutt_free_body(&body->parts);
+    mutt_body_free(&body->parts);
   }
 
   return rc;
index b7bf84f43c84ba08344013b225acf94beeafe2a7..3919ce623083c05593d7318c201aac12bb22c6fb 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -1011,7 +1011,7 @@ static int alternative_handler(struct Body *a, struct State *s)
     struct stat st;
     mustfree = true;
     fstat(fileno(s->fpin), &st);
-    b = mutt_new_body();
+    b = mutt_body_new();
     b->length = (long) st.st_size;
     b->parts = mutt_parse_multipart(
         s->fpin, mutt_param_get(&a->parameter, "boundary"), (long) st.st_size,
@@ -1172,7 +1172,7 @@ static int alternative_handler(struct Body *a, struct State *s)
   }
 
   if (mustfree)
-    mutt_free_body(&a);
+    mutt_body_free(&a);
 
   return rc;
 }
@@ -1194,7 +1194,7 @@ static int message_handler(struct Body *a, struct State *s)
   if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE || a->encoding == ENCUUENCODED)
   {
     fstat(fileno(s->fpin), &st);
-    b = mutt_new_body();
+    b = mutt_body_new();
     b->length = (LOFF_T) st.st_size;
     b->parts = mutt_parse_message_rfc822(s->fpin, b);
   }
@@ -1220,7 +1220,7 @@ static int message_handler(struct Body *a, struct State *s)
   }
 
   if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE || a->encoding == ENCUUENCODED)
-    mutt_free_body(&b);
+    mutt_body_free(&b);
 
   return rc;
 }
@@ -1275,7 +1275,7 @@ static int multipart_handler(struct Body *a, struct State *s)
   if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE || a->encoding == ENCUUENCODED)
   {
     fstat(fileno(s->fpin), &st);
-    b = mutt_new_body();
+    b = mutt_body_new();
     b->length = (long) st.st_size;
     b->parts = mutt_parse_multipart(
         s->fpin, mutt_param_get(&a->parameter, "boundary"), (long) st.st_size,
@@ -1323,7 +1323,7 @@ static int multipart_handler(struct Body *a, struct State *s)
   }
 
   if (a->encoding == ENCBASE64 || a->encoding == ENCQUOTEDPRINTABLE || a->encoding == ENCUUENCODED)
-    mutt_free_body(&b);
+    mutt_body_free(&b);
 
   /* make failure of a single part non-fatal */
   if (rc < 0)
index 6f876c0047515f2898949e99db362a4de6ec7bcb..cac43e0275c992491cfe3f8185b07dcd71577503 100644 (file)
@@ -701,7 +701,7 @@ struct Header *mutt_hcache_restore(const unsigned char *d)
   h->env = mutt_env_new();
   restore_envelope(h->env, d, &off, convert);
 
-  h->content = mutt_new_body();
+  h->content = mutt_body_new();
   restore_body(h->content, d, &off, convert);
 
   restore_char(&h->maildir_flags, d, &off, convert);
index 6cbcb3c72c63b1b960e6b6b5a854ed4035851732..b0d2fb112db6327d00b3368cb7a40bb691f92dac 100644 (file)
--- a/header.c
+++ b/header.c
@@ -359,7 +359,7 @@ void mutt_free_header(struct Header **h)
   if (!h || !*h)
     return;
   mutt_env_free(&(*h)->env);
-  mutt_free_body(&(*h)->content);
+  mutt_body_free(&(*h)->content);
   FREE(&(*h)->maildir_flags);
   FREE(&(*h)->tree);
   FREE(&(*h)->path);
diff --git a/main.c b/main.c
index db0840212d180f4f69e75065adddaf96e160ee38..edfeb84cd7e3d20bc69d93465fd26cc5fddb02d8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -804,7 +804,7 @@ int main(int argc, char *argv[], char *envp[])
          */
         context_hdr = mutt_new_header();
         context_hdr->offset = 0;
-        context_hdr->content = mutt_new_body();
+        context_hdr->content = mutt_body_new();
         if (fstat(fileno(fin), &st) != 0)
         {
           mutt_perror(draft_file);
diff --git a/mbox.c b/mbox.c
index 075bd9b2be12aa3fbac44e609ee10a81ecd35693..bd9c2470970d87a87a32249dd427a9e7c083c380 100644 (file)
--- a/mbox.c
+++ b/mbox.c
@@ -1104,7 +1104,7 @@ static int mbox_sync_mailbox(struct Context *ctx, int *index_hint)
        * if the user accesses it later.
        */
       new_offset[i - first].body = ftello(fp) - ctx->hdrs[i]->content->length + offset;
-      mutt_free_body(&ctx->hdrs[i]->content->parts);
+      mutt_body_free(&ctx->hdrs[i]->content->parts);
 
       switch (ctx->magic)
       {
diff --git a/mh.c b/mh.c
index 1b98bdab5cb5d4c8bcceee5a2567ec5116c5ab9f..1dbe92d7707da25ba7f969d1c3023d7ab72d6bfc 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -1818,7 +1818,7 @@ static int mh_rewrite_message(struct Context *ctx, int msgno)
     h->lines = old_hdr_lines;
   }
 
-  mutt_free_body(&h->content->parts);
+  mutt_body_free(&h->content->parts);
   return rc;
 }
 
index fafd8b6054433f692e2d0890933c8e9547b9a706..dfd6341ac510e4a383c01fc2941dad447b2d4b89 100644 (file)
@@ -268,7 +268,7 @@ int mutt_protect(struct Header *msg, char *keylist)
            which tmp_smime_pbody->parts after signing. */
         tmp_smime_pbody->parts = tmp_smime_pbody->parts->next;
         msg->content->next = NULL;
-        mutt_free_body(&tmp_smime_pbody);
+        mutt_body_free(&tmp_smime_pbody);
       }
       pbody = tmp_pbody;
     }
@@ -284,7 +284,7 @@ int mutt_protect(struct Header *msg, char *keylist)
           /* remove the outer multipart layer */
           tmp_pgp_pbody = mutt_remove_multipart(tmp_pgp_pbody);
           /* get rid of the signature */
-          mutt_free_body(&tmp_pgp_pbody->next);
+          mutt_body_free(&tmp_pgp_pbody->next);
         }
 
         return -1;
@@ -297,7 +297,7 @@ int mutt_protect(struct Header *msg, char *keylist)
       if (flags != msg->security)
       {
         tmp_pgp_pbody = mutt_remove_multipart(tmp_pgp_pbody);
-        mutt_free_body(&tmp_pgp_pbody->next);
+        mutt_body_free(&tmp_pgp_pbody->next);
       }
     }
   }
index 824d5cc998dec1e91cf2b0375a6896763f71bd9f..a81b3b72b8338c64266d781ab008cffa100aafc1 100644 (file)
@@ -1044,7 +1044,7 @@ static struct Body *sign_message(struct Body *a, int use_smime)
     return NULL;
   }
 
-  t = mutt_new_body();
+  t = mutt_body_new();
   t->type = TYPEMULTIPART;
   t->subtype = mutt_str_strdup("signed");
   t->encoding = ENC7BIT;
@@ -1065,7 +1065,7 @@ static struct Body *sign_message(struct Body *a, int use_smime)
   t->parts = a;
   a = t;
 
-  t->parts->next = mutt_new_body();
+  t->parts->next = mutt_body_new();
   t = t->parts->next;
   t->type = TYPEAPPLICATION;
   if (use_smime)
@@ -1137,7 +1137,7 @@ struct Body *pgp_gpgme_encrypt_message(struct Body *a, char *keylist, int sign)
   if (!outfile)
     return NULL;
 
-  t = mutt_new_body();
+  t = mutt_body_new();
   t->type = TYPEMULTIPART;
   t->subtype = mutt_str_strdup("encrypted");
   t->encoding = ENC7BIT;
@@ -1147,12 +1147,12 @@ struct Body *pgp_gpgme_encrypt_message(struct Body *a, char *keylist, int sign)
   mutt_generate_boundary(&t->parameter);
   mutt_param_set(&t->parameter, "protocol", "application/pgp-encrypted");
 
-  t->parts = mutt_new_body();
+  t->parts = mutt_body_new();
   t->parts->type = TYPEAPPLICATION;
   t->parts->subtype = mutt_str_strdup("pgp-encrypted");
   t->parts->encoding = ENC7BIT;
 
-  t->parts->next = mutt_new_body();
+  t->parts->next = mutt_body_new();
   t->parts->next->type = TYPEAPPLICATION;
   t->parts->next->subtype = mutt_str_strdup("octet-stream");
   t->parts->next->encoding = ENC7BIT;
@@ -1204,7 +1204,7 @@ struct Body *smime_gpgme_build_smime_entity(struct Body *a, char *keylist)
   if (!outfile)
     return NULL;
 
-  t = mutt_new_body();
+  t = mutt_body_new();
   t->type = TYPEAPPLICATION;
   t->subtype = mutt_str_strdup("pkcs7-mime");
   mutt_param_set(&t->parameter, "name", "smime.p7m");
@@ -2135,7 +2135,7 @@ int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo
     bb->offset = saved_b_offset;
     mutt_file_fclose(&tmpfp);
     rewind(*fpout);
-    mutt_free_body(cur);
+    mutt_body_free(cur);
     *cur = tmp_b;
   }
   return *cur ? 0 : -1;
@@ -2778,7 +2778,7 @@ int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s)
           s);
     }
 
-    mutt_free_body(&tattach);
+    mutt_body_free(&tattach);
     mutt_message(_("PGP message successfully decrypted."));
   }
   else
@@ -2862,7 +2862,7 @@ int smime_gpgme_application_handler(struct Body *a, struct State *s)
                         s);
     }
 
-    mutt_free_body(&tattach);
+    mutt_body_free(&tattach);
   }
 
   mutt_file_fclose(&fpout);
@@ -4781,7 +4781,7 @@ struct Body *pgp_gpgme_make_key_attachment(char *tempf)
   if (!tempf)
     goto bail;
 
-  att = mutt_new_body();
+  att = mutt_body_new();
   /* tempf is a newly allocated string, so this is correct: */
   att->filename = tempf;
   att->unlink = true;
index 72e63ff350454b43aacdac75c87fe261e78ab431..b757c96f7be3e1332c6b3724d86cf2a3fa1d9002 100644 (file)
@@ -1074,7 +1074,7 @@ int pgp_encrypted_handler(struct Body *a, struct State *s)
       state_attach_puts(_("[-- End of PGP/MIME encrypted data --]\n"), s);
     }
 
-    mutt_free_body(&tattach);
+    mutt_body_free(&tattach);
     /* clear 'Invoking...' message, since there's no error */
     mutt_message(_("PGP message successfully decrypted."));
   }
@@ -1192,7 +1192,7 @@ struct Body *pgp_sign_message(struct Body *a)
     return NULL; /* fatal error while signing */
   }
 
-  t = mutt_new_body();
+  t = mutt_body_new();
   t->type = TYPEMULTIPART;
   t->subtype = mutt_str_strdup("signed");
   t->encoding = ENC7BIT;
@@ -1206,7 +1206,7 @@ struct Body *pgp_sign_message(struct Body *a)
   t->parts = a;
   a = t;
 
-  t->parts->next = mutt_new_body();
+  t->parts->next = mutt_body_new();
   t = t->parts->next;
   t->type = TYPEAPPLICATION;
   t->subtype = mutt_str_strdup("pgp-signature");
@@ -1448,7 +1448,7 @@ struct Body *pgp_encrypt_message(struct Body *a, char *keylist, int sign)
     return NULL;
   }
 
-  t = mutt_new_body();
+  t = mutt_body_new();
   t->type = TYPEMULTIPART;
   t->subtype = mutt_str_strdup("encrypted");
   t->encoding = ENC7BIT;
@@ -1458,12 +1458,12 @@ struct Body *pgp_encrypt_message(struct Body *a, char *keylist, int sign)
   mutt_generate_boundary(&t->parameter);
   mutt_param_set(&t->parameter, "protocol", "application/pgp-encrypted");
 
-  t->parts = mutt_new_body();
+  t->parts = mutt_body_new();
   t->parts->type = TYPEAPPLICATION;
   t->parts->subtype = mutt_str_strdup("pgp-encrypted");
   t->parts->encoding = ENC7BIT;
 
-  t->parts->next = mutt_new_body();
+  t->parts->next = mutt_body_new();
   t->parts->next->type = TYPEAPPLICATION;
   t->parts->next->subtype = mutt_str_strdup("octet-stream");
   t->parts->next->encoding = ENC7BIT;
@@ -1627,7 +1627,7 @@ struct Body *pgp_traditional_encryptsign(struct Body *a, int flags, char *keylis
     return NULL;
   }
 
-  b = mutt_new_body();
+  b = mutt_body_new();
 
   b->encoding = ENC7BIT;
 
index e6ff36e29b279f7e40af231ea351748ef94e63be..8a03f80ee309ae6f487934b352522831e6d961db 100644 (file)
@@ -790,7 +790,7 @@ struct Body *pgp_make_key_attachment(char *tempf)
   mutt_file_fclose(&tempfp);
   mutt_file_fclose(&devnull);
 
-  att = mutt_new_body();
+  att = mutt_body_new();
   att->filename = mutt_str_strdup(tempf);
   att->unlink = true;
   att->use_disp = false;
index b3df88783e637031cb304d01705bb9812a94408e..d5557035137888438857e28288eec52a229e9c3a 100644 (file)
@@ -1433,7 +1433,7 @@ struct Body *smime_build_smime_entity(struct Body *a, char *certlist)
     return NULL;
   }
 
-  t = mutt_new_body();
+  t = mutt_body_new();
   t->type = TYPEAPPLICATION;
   t->subtype = mutt_str_strdup("x-pkcs7-mime");
   mutt_param_set(&t->parameter, "name", "smime.p7m");
@@ -1583,7 +1583,7 @@ struct Body *smime_sign_message(struct Body *a)
     return NULL; /* fatal error while signing */
   }
 
-  t = mutt_new_body();
+  t = mutt_body_new();
   t->type = TYPEMULTIPART;
   t->subtype = mutt_str_strdup("signed");
   t->encoding = ENC7BIT;
@@ -1601,7 +1601,7 @@ struct Body *smime_sign_message(struct Body *a)
   t->parts = a;
   a = t;
 
-  t->parts->next = mutt_new_body();
+  t->parts->next = mutt_body_new();
   t = t->parts->next;
   t->type = TYPEAPPLICATION;
   t->subtype = mutt_str_strdup("x-pkcs7-signature");
diff --git a/parse.c b/parse.c
index f9e295740bd954abf8d4608689dc39575ba96f50..c00caab448f768fc456e7615c17fa5d174ca36d6 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -416,7 +416,7 @@ static void parse_content_disposition(const char *s, struct Body *ct)
  */
 struct Body *mutt_read_mime_header(FILE *fp, int digest)
 {
-  struct Body *p = mutt_new_body();
+  struct Body *p = mutt_body_new();
   char *c = NULL;
   char *line = mutt_mem_malloc(LONG_STRING);
   size_t linelen = LONG_STRING;
@@ -638,7 +638,7 @@ struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off
 
         if (new->offset > end_off)
         {
-          mutt_free_body(&new);
+          mutt_body_free(&new);
           break;
         }
         if (head)
@@ -1161,7 +1161,7 @@ struct Envelope *mutt_read_rfc822_header(FILE *f, struct Header *hdr,
   {
     if (!hdr->content)
     {
-      hdr->content = mutt_new_body();
+      hdr->content = mutt_body_new();
 
       /* set the defaults from RFC1521 */
       hdr->content->type = TYPETEXT;
@@ -1448,7 +1448,7 @@ int mutt_count_body_parts(struct Context *ctx, struct Header *hdr)
   hdr->attach_valid = true;
 
   if (!keep_parts)
-    mutt_free_body(&hdr->content->parts);
+    mutt_body_free(&hdr->content->parts);
 
   return hdr->attach_total;
 }
index 132196c09d51904e37ebf586309499c8348c7064..72b12799b3fc462336f54551aa0b238315b940d4 100644 (file)
@@ -586,7 +586,7 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr,
       goto bail;
     }
 
-    mutt_free_body(&newhdr->content);
+    mutt_body_free(&newhdr->content);
     newhdr->content = b;
 
     mutt_clear_error();
@@ -609,7 +609,7 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr,
       newhdr->security |= APPLICATION_SMIME;
 
     /* destroy the signature */
-    mutt_free_body(&newhdr->content->parts->next);
+    mutt_body_free(&newhdr->content->parts->next);
     newhdr->content = mutt_remove_multipart(newhdr->content);
   }
 
@@ -724,7 +724,7 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr,
 
     mutt_stamp_attachment(b);
 
-    mutt_free_body(&b->parts);
+    mutt_body_free(&b->parts);
     if (b->hdr)
       b->hdr->content = NULL; /* avoid dangling pointer */
   }
@@ -760,7 +760,7 @@ bail:
   if (rc == -1)
   {
     mutt_env_free(&newhdr->env);
-    mutt_free_body(&newhdr->content);
+    mutt_body_free(&newhdr->content);
   }
 
   return rc;
index 404033375d4e543c405523c4c9f19c583cef11c8..77f95638ca9981c8de29167015c31865f8caa70a 100644 (file)
@@ -1007,7 +1007,7 @@ static void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Header
 
         secured = !crypt_smime_decrypt_mime(outer_fp, &new_fp, outer_new_body, &new_body);
 
-        mutt_free_body(&outer_new_body);
+        mutt_body_free(&outer_new_body);
         mutt_file_fclose(&outer_fp);
       }
 
index ae6f78e4afa26b69a0998d3196119cf308fb0d49..01453cf5552a3c653c3e10eaa9c24eff218eb441 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -359,7 +359,7 @@ static struct Body **copy_problematic_attachments(struct Body **last,
   {
     if (actx->idx[i]->content->tagged && (force || !mutt_can_decode(actx->idx[i]->content)))
     {
-      if (mutt_copy_body(actx->idx[i]->fp, last, actx->idx[i]->content) == -1)
+      if (mutt_body_copy(actx->idx[i]->fp, last, actx->idx[i]->content) == -1)
         return NULL; /* XXXXX - may lead to crashes */
       last = &((*last)->next);
     }
@@ -497,7 +497,7 @@ static void attach_forward_bodies(FILE *fp, struct Header *hdr, struct AttachCtx
     }
     else
     {
-      if (mutt_copy_body(fp, last, cur) == -1)
+      if (mutt_body_copy(fp, last, cur) == -1)
         goto bail;
     }
   }
@@ -640,14 +640,14 @@ static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx, struct Body *c
   {
     last = &tmphdr->content;
     if (cur)
-      mutt_copy_body(fp, last, cur);
+      mutt_body_copy(fp, last, cur);
     else
     {
       for (short i = 0; i < actx->idxlen; i++)
       {
         if (actx->idx[i]->content->tagged)
         {
-          mutt_copy_body(actx->idx[i]->fp, last, actx->idx[i]->content);
+          mutt_body_copy(actx->idx[i]->fp, last, actx->idx[i]->content);
           last = &((*last)->next);
         }
       }
@@ -910,7 +910,7 @@ void mutt_attach_reply(FILE *fp, struct Header *hdr, struct AttachCtx *actx,
         state_putc('\n', &st);
       }
       else
-        mutt_copy_body(fp, &tmphdr->content, cur);
+        mutt_body_copy(fp, &tmphdr->content, cur);
     }
     else
     {
diff --git a/send.c b/send.c
index b57068346a3b1671ff9b512e4b706160f606c320..a2a34cea75ca4731f29edcc84a3778711761a2bd 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1381,7 +1381,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
      */
     if (!(flags & SENDDRAFTFILE))
     {
-      pbody = mutt_new_body();
+      pbody = mutt_body_new();
       pbody->next = msg->content; /* don't kill command-line attachments */
       msg->content = pbody;
 
@@ -2097,10 +2097,10 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
       /* cleanup the second signature structures */
       if (save_content->parts)
       {
-        mutt_free_body(&save_content->parts->next);
+        mutt_body_free(&save_content->parts->next);
         save_content->parts = NULL;
       }
-      mutt_free_body(&save_content);
+      mutt_body_free(&save_content);
 
       /* restore old signature and attachments */
       msg->content->parts->next = save_sig;
@@ -2109,7 +2109,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
     else if ((WithCrypto != 0) && save_content)
     {
       /* destroy the new encrypted body. */
-      mutt_free_body(&save_content);
+      mutt_body_free(&save_content);
     }
   }
 
@@ -2127,12 +2127,12 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
       else if ((msg->security & ENCRYPT) ||
                ((msg->security & SIGN) && msg->content->type == TYPEAPPLICATION))
       {
-        mutt_free_body(&msg->content); /* destroy PGP data */
+        mutt_body_free(&msg->content); /* destroy PGP data */
         msg->content = clear_content;  /* restore clear text. */
       }
       else if ((msg->security & SIGN) && msg->content->type == TYPEMULTIPART)
       {
-        mutt_free_body(&msg->content->parts->next); /* destroy sig */
+        mutt_body_free(&msg->content->parts->next); /* destroy sig */
         msg->content = mutt_remove_multipart(msg->content);
       }
 
@@ -2163,7 +2163,7 @@ int ci_send_message(int flags, struct Header *msg, char *tempfile,
     FREE(&pgpkeylist);
 
   if ((WithCrypto != 0) && free_clear_content)
-    mutt_free_body(&clear_content);
+    mutt_body_free(&clear_content);
 
   /* set 'replied' flag only if the user didn't change/remove
      In-Reply-To: and References: headers during edit */
index cc781c33fb993cfdc22ea3208f94278a8e147b57..5dc933fa1bbc254027c5cc11c5ff9dde8eb01b1d 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1227,7 +1227,7 @@ cleanup:
     return;
   }
   a->length = sb.st_size;
-  mutt_free_body(&a->parts);
+  mutt_body_free(&a->parts);
   a->hdr->content = NULL;
 }
 
@@ -1362,7 +1362,7 @@ struct Body *mutt_make_message_attach(struct Context *ctx, struct Header *hdr, i
   if (!fp)
     return NULL;
 
-  body = mutt_new_body();
+  body = mutt_body_new();
   body->type = TYPEMESSAGE;
   body->subtype = mutt_str_strdup("rfc822");
   body->filename = mutt_str_strdup(buffer);
@@ -1465,7 +1465,7 @@ struct Body *mutt_make_file_attach(const char *path)
   struct Body *att = NULL;
   struct Content *info = NULL;
 
-  att = mutt_new_body();
+  att = mutt_body_new();
   att->filename = mutt_str_strdup(path);
 
   if (MimeTypeQueryCommand && *MimeTypeQueryCommand && MimeTypeQueryFirst)
@@ -1485,7 +1485,7 @@ struct Body *mutt_make_file_attach(const char *path)
   info = mutt_get_content_info(path, att);
   if (!info)
   {
-    mutt_free_body(&att);
+    mutt_body_free(&att);
     return NULL;
   }
 
@@ -1554,7 +1554,7 @@ struct Body *mutt_make_multipart(struct Body *b)
 {
   struct Body *new = NULL;
 
-  new = mutt_new_body();
+  new = mutt_body_new();
   new->type = TYPEMULTIPART;
   new->subtype = mutt_str_strdup("mixed");
   new->encoding = get_toplevel_encoding(b);
@@ -1583,7 +1583,7 @@ struct Body *mutt_remove_multipart(struct Body *b)
     t = b;
     b = b->parts;
     t->parts = NULL;
-    mutt_free_body(&t);
+    mutt_body_free(&t);
   }
   return b;
 }