if (!(hdr->read || hdr->old))
result = 1;
- mutt_free_envelope(&tmp_envelope);
+ mutt_env_free(&tmp_envelope);
mutt_free_header(&hdr);
return result;
*
* Representation of an email header (envelope)
*
- * | Function | Description
- * | :--------------------------- | :---------------------------------------------------------
- * | mutt_free_envelope | Free an Envelope
- * | mutt_merge_envelopes | Merge the headers of two Envelopes
- * | mutt_new_envelope | Create a new Envelope
+ * | Function | Description
+ * | :--------------- | :---------------------------------
+ * | mutt_env_free() | Free an Envelope
+ * | mutt_env_merge() | Merge the headers of two Envelopes
+ * | mutt_env_new() | Create a new Envelope
*/
#include "config.h"
#include "address.h"
/**
- * mutt_new_envelope - Create a new Envelope
+ * mutt_env_new - Create a new Envelope
* @retval ptr New Envelope
*/
-struct Envelope *mutt_new_envelope(void)
+struct Envelope *mutt_env_new(void)
{
struct Envelope *e = mutt_mem_calloc(1, sizeof(struct Envelope));
STAILQ_INIT(&e->references);
}
/**
- * mutt_free_envelope - Free an Envelope
+ * mutt_env_free - Free an Envelope
* @param p Envelope to free
*/
-void mutt_free_envelope(struct Envelope **p)
+void mutt_env_free(struct Envelope **p)
{
if (!*p)
return;
}
/**
- * mutt_merge_envelopes - Merge the headers of two Envelopes
+ * mutt_env_merge - Merge the headers of two Envelopes
* @param base Envelope destination for all the headers
* @param extra Envelope to copy from
*
* Any fields that are missing from base will be copied from extra.
* extra will be freed afterwards.
*/
-void mutt_merge_envelopes(struct Envelope *base, struct Envelope **extra)
+void mutt_env_merge(struct Envelope *base, struct Envelope **extra)
{
/* copies each existing element if necessary, and sets the element
- * to NULL in the source so that mutt_free_envelope doesn't leave us
+ * to NULL in the source so that mutt_env_free doesn't leave us
* with dangling pointers. */
#define MOVE_ELEM(h) \
if (!base->h) \
MOVE_STAILQ(userhdrs);
#undef MOVE_ELEM
- mutt_free_envelope(extra);
+ mutt_env_free(extra);
}
bool refs_changed : 1; /**< References changed to break thread */
};
-struct Envelope *mutt_new_envelope(void);
-void mutt_free_envelope(struct Envelope **p);
-void mutt_merge_envelopes(struct Envelope *base, struct Envelope **extra);
+struct Envelope *mutt_env_new(void);
+void mutt_env_free(struct Envelope **p);
+void mutt_env_merge(struct Envelope *base, struct Envelope **extra);
#endif /* _MUTT_ENVELOPE_H */
memcpy(h, d + off, sizeof(struct Header));
off += sizeof(struct Header);
- h->env = mutt_new_envelope();
+ h->env = mutt_env_new();
restore_envelope(h->env, d, &off, convert);
h->content = mutt_new_body();
* * mutt_convert_string()
* * mutt_encode_path()
* * mutt_new_body()
- * * mutt_new_envelope()
+ * * mutt_env_new()
* * mutt_sleep()
* * mx_lock_file()
* * mx_unlock_file()
mutt_list_free(&n->references);
STAILQ_SWAP(&n->references, &msg->env->references, ListNode);
- mutt_free_envelope(&msg->env);
+ mutt_env_free(&msg->env);
msg->env = n;
n = NULL;
{
if (!h || !*h)
return;
- mutt_free_envelope(&(*h)->env);
+ mutt_env_free(&(*h)->env);
mutt_free_body(&(*h)->content);
FREE(&(*h)->maildir_flags);
FREE(&(*h)->tree);
* changed). Another possibility: ignore Status on IMAP? */
read = h->read;
newenv = mutt_read_rfc822_header(msg->fp, h, 0, 0);
- mutt_merge_envelopes(h->env, &newenv);
+ mutt_env_merge(h->env, &newenv);
/* see above. We want the new status in h->read, so we unset it manually
* and let mutt_set_flag set it correctly, updating context. */
if (!msg)
msg = mutt_new_header();
if (!msg->env)
- msg->env = mutt_new_envelope();
+ msg->env = mutt_env_new();
if (i == 'b')
msg->env->bcc = mutt_addr_parse_list(msg->env->bcc, optarg);
else
if (!msg)
msg = mutt_new_header();
if (!msg->env)
- msg->env = mutt_new_envelope();
+ msg->env = mutt_env_new();
for (i = optind; i < argc; i++)
{
if (opts_env->subject)
mutt_str_replace(&msg->env->subject, opts_env->subject);
- mutt_free_envelope(&opts_env);
+ mutt_env_free(&opts_env);
mutt_free_header(&context_hdr);
}
/* Editing the includeFile: pass it directly in.
if ((alias = mutt_lookup_alias(s + 1)))
{
h = mutt_new_header();
- h->env = mutt_new_envelope();
+ h->env = mutt_env_new();
h->env->from = h->env->to = alias;
mutt_default_save(p, sizeof(p), h);
h->env->from = h->env->to = NULL;
if (ctx->subj_hash && hdr->env->real_subj)
mutt_hash_delete(ctx->subj_hash, hdr->env->real_subj, hdr, NULL);
- mutt_free_envelope(&hdr->env);
+ mutt_env_free(&hdr->env);
hdr->env = mutt_read_rfc822_header(msg->fp, hdr, 0, 0);
if (ctx->id_hash && hdr->env->message_id)
* Used for recall-message
* @retval ptr Newly allocated envelope structure
*
- * Caller should free the Envelope using mutt_free_envelope().
+ * Caller should free the Envelope using mutt_env_free().
*/
struct Envelope *mutt_read_rfc822_header(FILE *f, struct Header *hdr,
short user_hdrs, short weed)
{
- struct Envelope *e = mutt_new_envelope();
+ struct Envelope *e = mutt_env_new();
char *line = mutt_mem_malloc(LONG_STRING);
char *p = NULL;
LOFF_T loc;
if (ctx->subj_hash && h->env->real_subj)
mutt_hash_delete(ctx->subj_hash, h->env->real_subj, h, NULL);
mutt_label_hash_remove(ctx, h);
- mutt_free_envelope(&h->env);
+ mutt_env_free(&h->env);
h->env = mutt_read_rfc822_header(msg->fp, h, 0, 0);
if (ctx->subj_hash && h->env->real_subj)
mutt_hash_insert(ctx->subj_hash, h->env->real_subj, h);
{
err:
mx_close_message(ctx, &msg);
- mutt_free_envelope(&newhdr->env);
+ mutt_env_free(&newhdr->env);
mutt_free_body(&newhdr->content);
mutt_error(_("Decryption failed."));
return -1;
if (rc == -1)
{
- mutt_free_envelope(&newhdr->env);
+ mutt_env_free(&newhdr->env);
mutt_free_body(&newhdr->content);
}
/* fallthrough */
case OP_MAIL:
msg = mutt_new_header();
- msg->env = mutt_new_envelope();
+ msg->env = mutt_env_new();
if (!menu->tagprefix)
{
msg->env->to = result_to_addr(QueryTable[menu->current].data);
}
tmphdr = mutt_new_header();
- tmphdr->env = mutt_new_envelope();
+ tmphdr->env = mutt_env_new();
mutt_make_forward_subject(tmphdr->env, Context, parent_hdr);
mutt_mktemp(tmpbody, sizeof(tmpbody));
}
tmphdr = mutt_new_header();
- tmphdr->env = mutt_new_envelope();
+ tmphdr->env = mutt_env_new();
mutt_make_forward_subject(tmphdr->env, Context, curhdr);
tmpbody[0] = '\0';
mime_reply_any = true;
tmphdr = mutt_new_header();
- tmphdr->env = mutt_new_envelope();
+ tmphdr->env = mutt_env_new();
if (attach_reply_envelope_defaults(
tmphdr->env, actx, parent_hdr ? parent_hdr : (cur ? cur->hdr : NULL), flags) == -1)
{
struct Header *msg = mutt_new_header();
- msg->env = mutt_new_envelope();
+ msg->env = mutt_env_new();
if (!hdr)
{
for (int i = 0; i < Context->msgcount; i++)
}
if (!msg->env)
- msg->env = mutt_new_envelope();
+ msg->env = mutt_env_new();
}
/* Parse and use an eventual list-post header */