NeoMutt
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
edata.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stddef.h>
31#include <string.h>
32#include "mutt/lib.h"
33#include "email/lib.h"
34#include "edata.h"
35
39void imap_edata_free(void **ptr)
40{
41 if (!ptr || !*ptr)
42 return;
43
44 struct ImapEmailData *edata = *ptr;
45 /* this should be safe even if the list wasn't used */
46 FREE(&edata->flags_system);
47 FREE(&edata->flags_remote);
48
49 FREE(ptr);
50}
51
57{
58 return mutt_mem_calloc(1, sizeof(struct ImapEmailData));
59}
60
67{
68 if (!e)
69 return NULL;
70 return e->edata;
71}
72
79{
80 struct ImapEmailData *dst = imap_edata_new();
81 memcpy(dst, src, sizeof(*src));
84 return dst;
85}
Structs that make up an email.
struct ImapEmailData * imap_edata_new(void)
Create a new ImapEmailData.
Definition: edata.c:56
struct ImapEmailData * imap_edata_clone(struct ImapEmailData *src)
Clone an ImapEmailData.
Definition: edata.c:78
struct ImapEmailData * imap_edata_get(struct Email *e)
Get the private data for this Email.
Definition: edata.c:66
void imap_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free()
Definition: edata.c:39
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
#define FREE(x)
Definition: memory.h:45
Convenience wrapper for the library headers.
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:251
Pop-specific Email data.
The envelope/body of an email.
Definition: email.h:37
void * edata
Driver-specific data.
Definition: email.h:72
IMAP-specific Email data -.
Definition: edata.h:34
char * flags_remote
Definition: edata.h:48
char * flags_system
Definition: edata.h:47