NeoMutt  2023-03-22-27-g3cb248
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 <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 FREE(ptr);
49}
50
56{
57 return mutt_mem_calloc(1, sizeof(struct ImapEmailData));
58}
59
66{
67 if (!e)
68 return NULL;
69 return e->edata;
70}
71
78{
79 struct ImapEmailData *dst = imap_edata_new();
80 memcpy(dst, src, sizeof(*src));
83 return dst;
84}
Structs that make up an email.
struct ImapEmailData * imap_edata_new(void)
Create a new ImapEmailData.
Definition: edata.c:55
struct ImapEmailData * imap_edata_clone(struct ImapEmailData *src)
Clone an ImapEmailData.
Definition: edata.c:77
struct ImapEmailData * imap_edata_get(struct Email *e)
Get the private data for this Email.
Definition: edata.c:65
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:43
Convenience wrapper for the library headers.
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:250
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