NeoMutt  2024-04-16-36-g75b6fb
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
mdemail.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stddef.h>
31#include "mutt/lib.h"
32#include "email/lib.h"
33#include "mdemail.h"
34
40{
41 return mutt_mem_calloc(1, sizeof(struct MdEmail));
42}
43
48void maildir_entry_free(struct MdEmail **ptr)
49{
50 if (!ptr || !*ptr)
51 return;
52
53 struct MdEmail *md = *ptr;
54 FREE(&md->canon_fname);
55 email_free(&md->email);
56
57 FREE(ptr);
58}
59
64void maildirarray_clear(struct MdEmailArray *mda)
65{
66 if (!mda)
67 return;
68
69 struct MdEmail **mdp = NULL;
70 ARRAY_FOREACH(mdp, mda)
71 {
73 }
74
75 ARRAY_FREE(mda);
76}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:212
#define ARRAY_FREE(head)
Release all memory.
Definition: array.h:204
void email_free(struct Email **ptr)
Free an Email.
Definition: email.c:46
Structs that make up an email.
void maildir_entry_free(struct MdEmail **ptr)
Free a Maildir object.
Definition: mdemail.c:48
struct MdEmail * maildir_entry_new(void)
Create a new Maildir entry.
Definition: mdemail.c:39
void maildirarray_clear(struct MdEmailArray *mda)
Free a Maildir array.
Definition: mdemail.c:64
Maildir Email helper.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
#define FREE(x)
Definition: memory.h:45
Convenience wrapper for the library headers.
A Maildir Email helper.
Definition: mdemail.h:34
char * canon_fname
Canonical filename for hashing.
Definition: mdemail.h:36
struct Email * email
Temporary Email.
Definition: mdemail.h:35