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

Pop-specific Email data. More...

#include "config.h"
#include <stddef.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 pop_edata_free (void **ptr)
 Free the private Email data - Implements Email::edata_free() More...
 
struct PopEmailDatapop_edata_new (const char *uid)
 Create a new PopEmailData for an email. More...
 
struct PopEmailDatapop_edata_get (struct Email *e)
 Get the private data for this Email. More...
 

Detailed Description

Pop-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

◆ pop_edata_free()

void pop_edata_free ( void **  ptr)

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

Each email has an attached PopEmailData, which contains things like the tags (labels).

Definition at line 41 of file edata.c.

42{
43 struct PopEmailData *edata = *ptr;
44 FREE(&edata->uid);
45 FREE(ptr);
46}
#define FREE(x)
Definition: memory.h:43
void * edata
Driver-specific data.
Definition: email.h:72
POP-specific Email data -.
Definition: edata.h:32
+ Here is the caller graph for this function:

◆ pop_edata_new()

struct PopEmailData * pop_edata_new ( const char *  uid)

Create a new PopEmailData for an email.

Parameters
uidEmail UID
Return values
ptrNew PopEmailData struct

Definition at line 53 of file edata.c.

54{
55 struct PopEmailData *edata = mutt_mem_calloc(1, sizeof(struct PopEmailData));
56 edata->uid = mutt_str_dup(uid);
57 return edata;
58}
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:250
const char * uid
UID of email.
Definition: edata.h:33
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pop_edata_get()

struct PopEmailData * pop_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: