NeoMutt  2021-02-05-666-ge300cd
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 
41 void pop_edata_free(void **ptr)
42 {
43  struct PopEmailData *edata = *ptr;
44  FREE(&edata->uid);
45  FREE(ptr);
46 }
47 
53 struct 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 
65 struct PopEmailData *pop_edata_get(struct Email *e)
66 {
67  if (!e)
68  return NULL;
69  return e->edata;
70 }
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
The envelope/body of an email.
Definition: email.h:37
Structs that make up an email.
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:370
struct PopEmailData * pop_edata_new(const char *uid)
Create a new PopEmailData for an email.
Definition: edata.c:53
const char * uid
Definition: edata.h:33
Pop-specific Email data.
POP-specific Email data -.
Definition: edata.h:31
struct PopEmailData * pop_edata_get(struct Email *e)
Get the private data for this Email.
Definition: edata.c:65
void * edata
Driver-specific data.
Definition: email.h:111
#define FREE(x)
Definition: memory.h:40
Convenience wrapper for the library headers.