From: Richard Russon Date: Sun, 1 Apr 2018 01:31:40 +0000 (+0100) Subject: rename body functions X-Git-Tag: neomutt-20180512~69^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f8979ace711fc564ea260b12fee2e185ee424db;p=neomutt rename body functions --- diff --git a/attach.c b/attach.c index 791f6fd07..7587c0466 100644 --- 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 341f4d980..dec39886e 100644 --- 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 ae03a0491..50224d20a 100644 --- 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 */ diff --git a/browser.c b/browser.c index 17eb750f4..fddb0c7a2 100644 --- 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 diff --git a/commands.c b/commands.c index 52e8ee2e5..0acef5b79 100644 --- a/commands.c +++ b/commands.c @@ -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) { diff --git a/compose.c b/compose.c index 81cfe3c71..ef7d5a8ba 100644 --- 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 5602c09bb..2d0b6c3f3 100644 --- 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; diff --git a/handler.c b/handler.c index b7bf84f43..3919ce623 100644 --- 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) diff --git a/hcache/hcache.c b/hcache/hcache.c index 6f876c004..cac43e027 100644 --- a/hcache/hcache.c +++ b/hcache/hcache.c @@ -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); diff --git a/header.c b/header.c index 6cbcb3c72..b0d2fb112 100644 --- 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 db0840212..edfeb84cd 100644 --- 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 075bd9b2b..bd9c24709 100644 --- 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 1b98bdab5..1dbe92d77 100644 --- 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; } diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index fafd8b605..dfd6341ac 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -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); } } } diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 824d5cc99..a81b3b72b 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -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; diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index 72e63ff35..b757c96f7 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -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; diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index e6ff36e29..8a03f80ee 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -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; diff --git a/ncrypt/smime.c b/ncrypt/smime.c index b3df88783..d55570351 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -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 f9e295740..c00caab44 100644 --- 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; } diff --git a/postpone.c b/postpone.c index 132196c09..72b12799b 100644 --- a/postpone.c +++ b/postpone.c @@ -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; diff --git a/recvattach.c b/recvattach.c index 404033375..77f95638c 100644 --- a/recvattach.c +++ b/recvattach.c @@ -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); } diff --git a/recvcmd.c b/recvcmd.c index ae6f78e4a..01453cf55 100644 --- 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 b57068346..a2a34cea7 100644 --- 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 */ diff --git a/sendlib.c b/sendlib.c index cc781c33f..5dc933fa1 100644 --- 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; }