NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
edata.c
Go to the documentation of this file.
1
23
29
30
#include "config.h"
31
#include <string.h>
32
#include "
mutt/lib.h
"
33
#include "
email/lib.h
"
34
#include "
edata.h
"
35
39
void
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
49
FREE
(ptr);
50
}
51
56
struct
ImapEmailData
*
imap_edata_new
(
void
)
57
{
58
return
MUTT_MEM_CALLOC
(1,
struct
ImapEmailData
);
59
}
60
66
struct
ImapEmailData
*
imap_edata_get
(
struct
Email
*e)
67
{
68
if
(!e)
69
return
NULL;
70
return
e->
edata
;
71
}
72
78
struct
ImapEmailData
*
imap_edata_clone
(
struct
ImapEmailData
*src)
79
{
80
struct
ImapEmailData
*dst =
imap_edata_new
();
81
memcpy(dst, src,
sizeof
(*src));
82
dst->
flags_system
=
mutt_str_dup
(src->
flags_system
);
83
dst->
flags_remote
=
mutt_str_dup
(src->
flags_remote
);
84
return
dst;
85
}
lib.h
Structs that make up an email.
imap_edata_free
void imap_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free() -.
Definition
edata.c:39
imap_edata_new
struct ImapEmailData * imap_edata_new(void)
Create a new ImapEmailData.
Definition
edata.c:56
imap_edata_clone
struct ImapEmailData * imap_edata_clone(struct ImapEmailData *src)
Clone an ImapEmailData.
Definition
edata.c:78
imap_edata_get
struct ImapEmailData * imap_edata_get(struct Email *e)
Get the private data for this Email.
Definition
edata.c:66
edata.h
Imap-specific Email data.
FREE
#define FREE(x)
Free memory and set the pointer to NULL.
Definition
memory.h:68
MUTT_MEM_CALLOC
#define MUTT_MEM_CALLOC(n, type)
Definition
memory.h:52
lib.h
Convenience wrapper for the library headers.
mutt_str_dup
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition
string.c:257
Email
The envelope/body of an email.
Definition
email.h:39
Email::edata
void * edata
Driver-specific data.
Definition
email.h:74
ImapEmailData
IMAP-specific Email data -.
Definition
edata.h:35
ImapEmailData::flags_remote
char * flags_remote
Remote flags.
Definition
edata.h:49
ImapEmailData::flags_system
char * flags_system
System flags.
Definition
edata.h:48