NeoMutt
2025-12-11-1031-gfb8e54
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
mdemail.c
Go to the documentation of this file.
1
22
28
29
#include "config.h"
30
#include <stddef.h>
31
#include "
mutt/lib.h
"
32
#include "
email/lib.h
"
33
#include "
mdemail.h
"
34
39
struct
MdEmail
*
maildir_entry_new
(
void
)
40
{
41
return
MUTT_MEM_CALLOC
(1,
struct
MdEmail
);
42
}
43
48
void
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
64
void
maildirarray_clear
(
struct
MdEmailArray *mda)
65
{
66
if
(!mda)
67
return
;
68
69
struct
MdEmail
**mdp = NULL;
70
ARRAY_FOREACH
(mdp, mda)
71
{
72
maildir_entry_free
(mdp);
73
}
74
75
ARRAY_FREE
(mda);
76
}
ARRAY_FOREACH
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition
array.h:223
ARRAY_FREE
#define ARRAY_FREE(head)
Release all memory.
Definition
array.h:209
email_free
void email_free(struct Email **ptr)
Free an Email.
Definition
email.c:46
lib.h
Structs that make up an email.
maildir_entry_free
void maildir_entry_free(struct MdEmail **ptr)
Free a Maildir object.
Definition
mdemail.c:48
maildir_entry_new
struct MdEmail * maildir_entry_new(void)
Create a new Maildir entry.
Definition
mdemail.c:39
maildirarray_clear
void maildirarray_clear(struct MdEmailArray *mda)
Free a Maildir array.
Definition
mdemail.c:64
mdemail.h
Maildir Email helper.
FREE
#define FREE(x)
Free memory and set the pointer to NULL.
Definition
memory.h:68
MUTT_MEM_CALLOC
#define MUTT_MEM_CALLOC(n, type)
Definition
memory.h:52
lib.h
Convenience wrapper for the library headers.
MdEmail
A Maildir Email helper.
Definition
mdemail.h:34
MdEmail::canon_fname
char * canon_fname
Canonical filename for hashing.
Definition
mdemail.h:36
MdEmail::email
struct Email * email
Temporary Email.
Definition
mdemail.h:35