NeoMutt  2024-04-25-89-g194907
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 "core/lib.h"
31#include "conn/lib.h"
32#include "adata.h"
33
41void pop_adata_free(void **ptr)
42{
43 if (!ptr || !*ptr)
44 return;
45
46 struct PopAccountData *adata = *ptr;
47 FREE(&adata->auth_list.data);
48
49 if (adata->conn)
50 {
51 if (adata->conn->close)
52 adata->conn->close(adata->conn);
53 FREE(&adata->conn);
54 }
55
56 FREE(ptr);
57}
58
64{
65 return mutt_mem_calloc(1, sizeof(struct PopAccountData));
66}
67
74{
75 if (!m || (m->type != MUTT_POP))
76 return NULL;
77 struct Account *a = m->account;
78 if (!a)
79 return NULL;
80 return a->adata;
81}
Connection Library.
Convenience wrapper for the core headers.
@ MUTT_POP
'POP3' Mailbox type
Definition: mailbox.h:52
void pop_adata_free(void **ptr)
Free the private Account data - Implements Account::adata_free() -.
Definition: adata.c:41
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
struct PopAccountData * pop_adata_get(struct Mailbox *m)
Get the Account data for this mailbox.
Definition: adata.c:73
struct PopAccountData * pop_adata_new(void)
Create a new PopAccountData object.
Definition: adata.c:63
Pop-specific Account data.
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
POP-specific Account data -.
Definition: adata.h:37