NeoMutt  2024-10-02-37-gfa9146
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 "mutt/lib.h"
32#include "email/lib.h"
33#include "edata.h"
34
42void nm_edata_free(void **ptr)
43{
44 if (!ptr || !*ptr)
45 return;
46
47 struct NmEmailData *edata = *ptr;
48
49 mutt_debug(LL_DEBUG2, "nm: freeing email %p\n", (void *) edata);
50 FREE(&edata->folder);
51 FREE(&edata->oldpath);
52 FREE(&edata->virtual_id);
53
54 FREE(ptr);
55}
56
62{
63 return mutt_mem_calloc(1, sizeof(struct NmEmailData));
64}
65
72struct NmEmailData *nm_edata_get(struct Email *e)
73{
74 if (!e)
75 return NULL;
76
77 return e->nm_edata;
78}
Structs that make up an email.
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
@ LL_DEBUG2
Log at debug level 2.
Definition: logging2.h:44
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:51
#define FREE(x)
Definition: memory.h:45
Convenience wrapper for the library headers.
void nm_edata_free(void **ptr)
Free data attached to an Email.
Definition: edata.c:42
struct NmEmailData * nm_edata_get(struct Email *e)
Get the Notmuch Email data.
Definition: edata.c:72
struct NmEmailData * nm_edata_new(void)
Create a new NmEmailData for an email.
Definition: edata.c:61
Pop-specific Email data.
The envelope/body of an email.
Definition: email.h:39
void * edata
Driver-specific data.
Definition: email.h:74
void * nm_edata
Notmuch private data.
Definition: email.h:93
Notmuch-specific Email data -.
Definition: edata.h:34