NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
edata.c File Reference

Notmuch-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 nm_edata_free (void **ptr)
 Free data attached to an Email.
 
struct NmEmailDatanm_edata_new (void)
 Create a new NmEmailData for an email.
 
struct NmEmailDatanm_edata_get (struct Email *e)
 Get the Notmuch Email data.
 

Detailed Description

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

◆ nm_edata_free()

void nm_edata_free ( void **  ptr)

Free data attached to an Email.

Parameters
[out]ptrEmail data

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

Definition at line 42 of file edata.c.

43{
44 if (!ptr || !*ptr)
45 return;
46
47 struct NmEmailData *edata = *ptr;
48
49 mutt_debug(LL_DEBUG2, "nm: freeing email %p\n", (void *) edata);
50 FREE(&edata->folder);
51 FREE(&edata->oldpath);
52 FREE(&edata->virtual_id);
53
54 FREE(ptr);
55}
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
@ LL_DEBUG2
Log at debug level 2.
Definition: logging2.h:44
#define FREE(x)
Definition: memory.h:45
void * edata
Driver-specific data.
Definition: email.h:74
Notmuch-specific Email data -.
Definition: edata.h:34
+ Here is the caller graph for this function:

◆ nm_edata_new()

struct NmEmailData * nm_edata_new ( void  )

Create a new NmEmailData for an email.

Return values
ptrNew NmEmailData struct

Definition at line 61 of file edata.c.

62{
63 return mutt_mem_calloc(1, sizeof(struct NmEmailData));
64}
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nm_edata_get()

struct NmEmailData * nm_edata_get ( struct Email e)

Get the Notmuch Email data.

Parameters
eEmail
Return values
ptrSuccess
NULLError

Definition at line 72 of file edata.c.

73{
74 if (!e)
75 return NULL;
76
77 return e->nm_edata;
78}
void * nm_edata
Notmuch private data.
Definition: email.h:93
+ Here is the caller graph for this function: