NeoMutt  2022-04-29-215-gc12b98
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
41void pop_edata_free(void **ptr)
42{
43 struct PopEmailData *edata = *ptr;
44 FREE(&edata->uid);
45 FREE(ptr);
46}
47
53struct PopEmailData *pop_edata_new(const char *uid)
54{
55 struct PopEmailData *edata = mutt_mem_calloc(1, sizeof(struct PopEmailData));
56 edata->uid = mutt_str_dup(uid);
57 return edata;
58}
59
66{
67 if (!e)
68 return NULL;
69 return e->edata;
70}
Structs that make up an email.
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
struct PopEmailData * pop_edata_new(const char *uid)
Create a new PopEmailData for an email.
Definition: edata.c:53
void pop_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free()
Definition: edata.c:41
struct PopEmailData * pop_edata_get(struct Email *e)
Get the private data for this Email.
Definition: edata.c:65
Pop-specific Email data.
The envelope/body of an email.
Definition: email.h:37
void * edata
Driver-specific data.
Definition: email.h:72
POP-specific Email data -.
Definition: edata.h:32
const char * uid
UID of email.
Definition: edata.h:33