NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
edata.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 "edata.h"
34 
38 void imap_edata_free(void **ptr)
39 {
40  if (!ptr || !*ptr)
41  return;
42 
43  struct ImapEmailData *edata = *ptr;
44  /* this should be safe even if the list wasn't used */
45  FREE(&edata->flags_system);
46  FREE(&edata->flags_remote);
47  FREE(ptr);
48 }
49 
55 {
56  return mutt_mem_calloc(1, sizeof(struct ImapEmailData));
57 }
58 
65 {
66  if (!e)
67  return NULL;
68  return e->edata;
69 }
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
The envelope/body of an email.
Definition: email.h:37
Imap-specific Email data.
Structs that make up an email.
struct ImapEmailData * imap_edata_new(void)
Create a new ImapEmailData.
Definition: edata.c:54
struct ImapEmailData * imap_edata_get(struct Email *e)
Get the private data for this Email.
Definition: edata.c:64
void imap_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free()
Definition: edata.c:38
char * flags_remote
Definition: edata.h:48
char * flags_system
Definition: edata.h:47
void * edata
Driver-specific data.
Definition: email.h:111
#define FREE(x)
Definition: memory.h:40
IMAP-specific Email data -.
Definition: edata.h:33
Convenience wrapper for the library headers.