NeoMutt  2021-10-29-43-g6b8931
Teaching an old dog new tricks
DOXYGEN
mdemail.h File Reference

Maildir Email helper. More...

#include <stdbool.h>
#include <sys/types.h>
#include "mutt/lib.h"
+ Include dependency graph for mdemail.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  MdEmail
 A Maildir Email helper. More...
 

Functions

 ARRAY_HEAD (MdEmailArray, struct MdEmail *)
 
void maildir_entry_free (struct MdEmail **ptr)
 Free a Maildir object. More...
 
struct MdEmailmaildir_entry_new (void)
 Create a new Maildir entry. 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.h.

Function Documentation

◆ ARRAY_HEAD()

ARRAY_HEAD ( MdEmailArray  ,
struct MdEmail  
)

◆ 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
#define FREE(x)
Definition: memory.h:40
A Maildir Email helper.
Definition: mdemail.h:34
char * canon_fname
Definition: mdemail.h:36
struct Email * email
Definition: mdemail.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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
+ 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_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:208
#define ARRAY_FREE(head)
Release all memory.
Definition: array.h:200
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: