NeoMutt  2024-04-25-85-g27bab4
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
mdata.c
Go to the documentation of this file.
1
29#include "config.h"
30#include "mutt/lib.h"
31#include "core/lib.h"
32#include "mdata.h"
33
37void maildir_mdata_free(void **ptr)
38{
39 if (!ptr || !*ptr)
40 return;
41
42 FREE(ptr);
43}
44
50{
51 struct MaildirMboxData *mdata = mutt_mem_calloc(1, sizeof(struct MaildirMboxData));
52 return mdata;
53}
54
61{
62 if (m && (m->type == MUTT_MAILDIR))
63 return m->mdata;
64
65 return NULL;
66}
Convenience wrapper for the core headers.
@ MUTT_MAILDIR
'Maildir' Mailbox type
Definition: mailbox.h:48
void maildir_mdata_free(void **ptr)
Free the private Mailbox data - Implements Mailbox::mdata_free() -.
Definition: mdata.c:37
struct MaildirMboxData * maildir_mdata_get(struct Mailbox *m)
Get the private data for this Mailbox.
Definition: mdata.c:60
struct MaildirMboxData * maildir_mdata_new(void)
Create a new MaildirMboxData object.
Definition: mdata.c:49
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:51
#define FREE(x)
Definition: memory.h:45
Convenience wrapper for the library headers.
Notmuch-specific Mailbox data.
A mailbox.
Definition: mailbox.h:79
enum MailboxType type
Mailbox type.
Definition: mailbox.h:102
void * mdata
Driver specific data.
Definition: mailbox.h:132
Maildir-specific Mailbox data -.
Definition: mdata.h:35