NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
mdemail.c File Reference

Maildir Email helper. More...

#include "config.h"
#include <stddef.h>
#include "mutt/lib.h"
#include "email/lib.h"
#include "mdemail.h"
+ Include dependency graph for mdemail.c:

Go to the source code of this file.

Functions

struct MdEmailmaildir_entry_new (void)
 Create a new Maildir entry.
 
void maildir_entry_free (struct MdEmail **ptr)
 Free a Maildir object.
 
void maildirarray_clear (struct MdEmailArray *mda)
 Free a Maildir array.
 

Detailed Description

Maildir Email helper.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file mdemail.c.

Function Documentation

◆ maildir_entry_new()

struct MdEmail * maildir_entry_new ( void  )

Create a new Maildir entry.

Return values
ptrNew Maildir entry

Definition at line 39 of file mdemail.c.

40{
41 return MUTT_MEM_CALLOC(1, struct MdEmail);
42}
#define MUTT_MEM_CALLOC(n, type)
Definition: memory.h:40
A Maildir Email helper.
Definition: mdemail.h:34
+ Here is the caller graph for this function:

◆ maildir_entry_free()

void maildir_entry_free ( struct MdEmail **  ptr)

Free a Maildir object.

Parameters
[out]ptrMaildir to free

Definition at line 48 of file mdemail.c.

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}
void email_free(struct Email **ptr)
Free an Email.
Definition: email.c:46
#define FREE(x)
Definition: memory.h:55
char * canon_fname
Canonical filename for hashing.
Definition: mdemail.h:36
struct Email * email
Temporary Email.
Definition: mdemail.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maildirarray_clear()

void maildirarray_clear ( struct MdEmailArray *  mda)

Free a Maildir array.

Parameters
[out]mdaMaildir array to free

Definition at line 64 of file mdemail.c.

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 maildir_entry_free(struct MdEmail **ptr)
Free a Maildir object.
Definition: mdemail.c:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function: