NeoMutt
2025-12-11-1009-ga75d9e
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
adata.c
Go to the documentation of this file.
1
22
28
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
39
void
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
58
struct
NmAccountData
*
nm_adata_new
(
void
)
59
{
60
return
MUTT_MEM_CALLOC
(1,
struct
NmAccountData
);
61
}
62
69
struct
NmAccountData
*
nm_adata_get
(
struct
Mailbox
*m)
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
}
lib.h
Convenience wrapper for the core headers.
MUTT_NOTMUCH
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition
mailbox.h:50
nm_adata_free
void nm_adata_free(void **ptr)
Free the private Account data - Implements Account::adata_free() -.
Definition
adata.c:39
FREE
#define FREE(x)
Free memory and set the pointer to NULL.
Definition
memory.h:68
MUTT_MEM_CALLOC
#define MUTT_MEM_CALLOC(n, type)
Definition
memory.h:52
lib.h
Convenience wrapper for the library headers.
nm_adata_new
struct NmAccountData * nm_adata_new(void)
Allocate and initialise a new NmAccountData structure.
Definition
adata.c:58
nm_adata_get
struct NmAccountData * nm_adata_get(struct Mailbox *m)
Get the Notmuch Account data.
Definition
adata.c:69
adata.h
Notmuch-specific Account data.
nm_db_free
void nm_db_free(notmuch_database_t *db)
Decoupled way to close a Notmuch database.
Definition
db.c:262
private.h
Notmuch private types.
Account
A group of associated Mailboxes.
Definition
account.h:36
Account::adata
void * adata
Private data (for Mailbox backends).
Definition
account.h:42
Mailbox
A mailbox.
Definition
mailbox.h:81
Mailbox::type
enum MailboxType type
Mailbox type.
Definition
mailbox.h:104
Mailbox::account
struct Account * account
Account that owns this Mailbox.
Definition
mailbox.h:129
NmAccountData
Notmuch-specific Account data -.
Definition
adata.h:35