NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
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. More...
 
void maildir_entry_free (struct MdEmail **ptr)
 Free a Maildir object. More...
 
void maildirarray_clear (struct MdEmailArray *mda)
 Free a Maildir array. More...
 

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, sizeof(struct MdEmail));
42 }
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
A Maildir Email helper.
Definition: mdemail.h:33
+ Here is the call graph for this function:
+ 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:44
char * canon_fname
Definition: mdemail.h:36
A Maildir Email helper.
Definition: mdemail.h:33
struct Email * email
Definition: mdemail.h:35
#define FREE(x)
Definition: memory.h:40
+ 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  {
72  maildir_entry_free(mdp);
73  }
74 
75  ARRAY_FREE(mda);
76 }
#define ARRAY_FREE(head)
Release all memory.
Definition: array.h:198
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:206
A Maildir Email helper.
Definition: mdemail.h:33
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: