* this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * @page envelope Representation of an email header (envelope)
+ *
+ * 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
+ */
+
#include "config.h"
#include <stddef.h>
#include "lib/buffer.h"
#include "envelope.h"
#include "rfc822.h"
+/**
+ * mutt_new_envelope - Create a new Envelope
+ * @retval ptr New Envelope
+ */
struct Envelope *mutt_new_envelope(void)
{
struct Envelope *e = safe_calloc(1, sizeof(struct Envelope));
return e;
}
+/**
+ * mutt_free_envelope - Free an Envelope
+ * @param p Envelope to free
+ */
void mutt_free_envelope(struct Envelope **p)
{
if (!*p)
}
/**
- * mutt_merge_envelopes - Merge the headers of two emails
+ * mutt_merge_envelopes - Merge the headers of two Envelopes
+ * @param base Envelope destination for all the headers
+ * @param extra Envelope to copy from
*
- * Move all the headers from extra not present in base into base
+ * 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)
{
/* copies each existing element if necessary, and sets the element
- * to NULL in the source so that mutt_free_envelope doesn't leave us
- * with dangling pointers. */
+ * to NULL in the source so that mutt_free_envelope doesn't leave us
+ * with dangling pointers. */
#define MOVE_ELEM(h) \
if (!base->h) \
{ \
return 1;
}
+/**
+ * strict_cmp_envelopes - Strictly compare two Envelopes
+ * @param e1 First Envelope
+ * @param e2 Second Envelope
+ * @retval true Envelopes are strictly identical
+ */
static int strict_cmp_envelopes(const struct Envelope *e1, const struct Envelope *e2)
{
if (e1 && e2)