NeoMutt  2022-04-29-215-gc12b98
Teaching an old dog new tricks
DOXYGEN
edata.c File Reference

Imap-specific Email data. More...

#include "config.h"
#include <stddef.h>
#include <string.h>
#include "mutt/lib.h"
#include "email/lib.h"
#include "edata.h"
+ Include dependency graph for edata.c:

Go to the source code of this file.

Functions

void imap_edata_free (void **ptr)
 Free the private Email data - Implements Email::edata_free() More...
 
struct ImapEmailDataimap_edata_new (void)
 Create a new ImapEmailData. More...
 
struct ImapEmailDataimap_edata_get (struct Email *e)
 Get the private data for this Email. More...
 
struct ImapEmailDataimap_edata_clone (struct ImapEmailData *src)
 Clone an ImapEmailData. More...
 

Detailed Description

Imap-specific Email data.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file edata.c.

Function Documentation

◆ imap_edata_free()

void imap_edata_free ( void **  ptr)

Free the private Email data - Implements Email::edata_free()

Definition at line 39 of file edata.c.

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 FREE(ptr);
49}
#define FREE(x)
Definition: memory.h:43
void * edata
Driver-specific data.
Definition: email.h:72
IMAP-specific Email data -.
Definition: edata.h:34
+ Here is the caller graph for this function:

◆ imap_edata_new()

struct ImapEmailData * imap_edata_new ( void  )

Create a new ImapEmailData.

Return values
ptrNew ImapEmailData

Definition at line 55 of file edata.c.

56{
57 return mutt_mem_calloc(1, sizeof(struct ImapEmailData));
58}
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ imap_edata_get()

struct ImapEmailData * imap_edata_get ( struct Email e)

Get the private data for this Email.

Parameters
eEmail
Return values
ptrPrivate Email data

Definition at line 65 of file edata.c.

66{
67 if (!e)
68 return NULL;
69 return e->edata;
70}
+ Here is the caller graph for this function:

◆ imap_edata_clone()

struct ImapEmailData * imap_edata_clone ( struct ImapEmailData src)

Clone an ImapEmailData.

Parameters
srcThe source ImapEmailData to clone
Return values
ptrNew ImapEmailData

Definition at line 77 of file edata.c.

78{
79 struct ImapEmailData *dst = imap_edata_new();
80 memcpy(dst, src, sizeof(*src));
83 return dst;
84}
struct ImapEmailData * imap_edata_new(void)
Create a new ImapEmailData.
Definition: edata.c:55
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:250
char * flags_remote
Definition: edata.h:48
char * flags_system
Definition: edata.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function: