NeoMutt  2024-04-16-36-g75b6fb
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
41void pop_edata_free(void **ptr)
42{
43 if (!ptr || !*ptr)
44 return;
45
46 struct PopEmailData *edata = *ptr;
47 FREE(&edata->uid);
48 FREE(ptr);
49}
50
56struct PopEmailData *pop_edata_new(const char *uid)
57{
58 struct PopEmailData *edata = mutt_mem_calloc(1, sizeof(struct PopEmailData));
59 edata->uid = mutt_str_dup(uid);
60 return edata;
61}
62
69{
70 if (!e)
71 return NULL;
72 return e->edata;
73}
Structs that make up an email.
void pop_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free() -.
Definition: edata.c:41
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:253
struct PopEmailData * pop_edata_new(const char *uid)
Create a new PopEmailData for an email.
Definition: edata.c:56
struct PopEmailData * pop_edata_get(struct Email *e)
Get the private data for this Email.
Definition: edata.c:68
Pop-specific Email data.
The envelope/body of an email.
Definition: email.h:39
void * edata
Driver-specific data.
Definition: email.h:74
POP-specific Email data -.
Definition: edata.h:32
const char * uid
UID of email.
Definition: edata.h:33