NeoMutt  2022-04-29-215-gc12b98
Teaching an old dog new tricks
DOXYGEN
adata.c
Go to the documentation of this file.
1
29#include "config.h"
30#include "core/lib.h"
31#include "adata.h"
32
40void pop_adata_free(void **ptr)
41{
42 if (!ptr || !*ptr)
43 return;
44
45 struct PopAccountData *adata = *ptr;
46 FREE(&adata->auth_list.data);
47 FREE(ptr);
48}
49
55{
56 return mutt_mem_calloc(1, sizeof(struct PopAccountData));
57}
58
65{
66 if (!m || (m->type != MUTT_POP))
67 return NULL;
68 struct Account *a = m->account;
69 if (!a)
70 return NULL;
71 return a->adata;
72}
Convenience wrapper for the core headers.
@ MUTT_POP
'POP3' Mailbox type
Definition: mailbox.h:52
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
#define FREE(x)
Definition: memory.h:43
struct PopAccountData * pop_adata_get(struct Mailbox *m)
Get the Account data for this mailbox.
Definition: adata.c:64
struct PopAccountData * pop_adata_new(void)
Create a new PopAccountData object.
Definition: adata.c:54
void pop_adata_free(void **ptr)
Free the private Account data - Implements Account::adata_free()
Definition: adata.c:40
Pop-specific Account data.
A group of associated Mailboxes.
Definition: account.h:37
void * adata
Private data (for Mailbox backends)
Definition: account.h:43
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
POP-specific Account data -.
Definition: adata.h:37