NeoMutt  2024-12-12-19-ge4b57e
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
adata.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stddef.h>
31#include "private.h"
32#include "mutt/lib.h"
33#include "core/lib.h"
34#include "adata.h"
35
39void nm_adata_free(void **ptr)
40{
41 if (!ptr || !*ptr)
42 return;
43
44 struct NmAccountData *adata = *ptr;
45 if (adata->db)
46 {
47 nm_db_free(adata->db);
48 adata->db = NULL;
49 }
50
51 FREE(ptr);
52}
53
59{
60 return MUTT_MEM_CALLOC(1, struct NmAccountData);
61}
62
70{
71 if (!m || (m->type != MUTT_NOTMUCH))
72 return NULL;
73
74 struct Account *a = m->account;
75 if (!a)
76 return NULL;
77
78 return a->adata;
79}
Convenience wrapper for the core headers.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition: mailbox.h:51
void nm_adata_free(void **ptr)
Free the private Account data - Implements Account::adata_free() -.
Definition: adata.c:39
#define FREE(x)
Definition: memory.h:55
#define MUTT_MEM_CALLOC(n, type)
Definition: memory.h:40
Convenience wrapper for the library headers.
struct NmAccountData * nm_adata_new(void)
Allocate and initialise a new NmAccountData structure.
Definition: adata.c:58
struct NmAccountData * nm_adata_get(struct Mailbox *m)
Get the Notmuch Account data.
Definition: adata.c:69
void nm_db_free(notmuch_database_t *db)
Decoupled way to close a Notmuch database.
Definition: db.c:250
Pop-specific Account data.
GUI display the mailboxes in a side panel.
A group of associated Mailboxes.
Definition: account.h:36
void * adata
Private data (for Mailbox backends)
Definition: account.h:42
A mailbox.
Definition: mailbox.h:79
enum MailboxType type
Mailbox type.
Definition: mailbox.h:102
struct Account * account
Account that owns this Mailbox.
Definition: mailbox.h:127
Notmuch-specific Account data -.
Definition: adata.h:35