NeoMutt  2025-12-11-596-g7cc1dd
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Account Private Data API

Free the private data attached to the Account. More...

Functions

void imap_adata_free (void **ptr)
 Free the private Account data - Implements Account::adata_free() -.
 
static void mbox_adata_free (void **ptr)
 Free the private Account data - Implements Account::adata_free() -.
 
void nntp_adata_free (void **ptr)
 Free the private Account data - Implements Account::adata_free() -.
 
void nm_adata_free (void **ptr)
 Free the private Account data - Implements Account::adata_free() -.
 
void pop_adata_free (void **ptr)
 Free the private Account data - Implements Account::adata_free() -.
 

Detailed Description

Free the private data attached to the Account.

Parameters
ptrPrivate data to be freed
Precondition
ptr is not NULL
*ptr is not NULL

Function Documentation

◆ imap_adata_free()

void imap_adata_free ( void ** ptr)

Free the private Account data - Implements Account::adata_free() -.

Definition at line 101 of file adata.c.

102{
103 if (!ptr || !*ptr)
104 return;
105
106 struct ImapAccountData *adata = *ptr;
107
109 if (adata->account)
111
112 FREE(&adata->capstr);
113 buf_dealloc(&adata->cmdbuf);
114 FREE(&adata->buf);
115 FREE(&adata->cmds);
116
117 if (adata->conn)
118 {
119 if (adata->conn->close)
120 adata->conn->close(adata->conn);
121 FREE(&adata->conn);
122 }
123
124 FREE(ptr);
125}
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition buffer.c:377
static int imap_mailbox_delete_observer(struct NotifyCallback *nc)
Notification that a Mailbox is about to be deleted - Implements observer_t -.
Definition adata.c:72
static int imap_timeout_observer(struct NotifyCallback *nc)
Notification that a timeout has occurred - Implements observer_t -.
Definition adata.c:43
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition notify.c:230
void * adata
Private data (for Mailbox backends)
Definition account.h:42
IMAP-specific Account data -.
Definition adata.h:40
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify_timeout
Timeout notifications handler.
Definition neomutt.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mbox_adata_free()

static void mbox_adata_free ( void ** ptr)
static

Free the private Account data - Implements Account::adata_free() -.

Definition at line 76 of file mbox.c.

77{
78 if (!ptr || !*ptr)
79 return;
80
81 struct MboxAccountData *m = *ptr;
82
84 FREE(ptr);
85}
#define mutt_file_fclose(FP)
Definition file.h:139
Mbox-specific Account data -.
Definition lib.h:50
FILE * fp
Mailbox file.
Definition lib.h:51
+ Here is the caller graph for this function:

◆ nntp_adata_free()

void nntp_adata_free ( void ** ptr)

Free the private Account data - Implements Account::adata_free() -.

The NntpAccountData struct stores global NNTP data, such as the connection to the database. This function will close the database, free the resources and the struct itself.

Definition at line 42 of file adata.c.

43{
44 if (!ptr || !*ptr)
45 return;
46
47 struct NntpAccountData *adata = *ptr;
48
49 mutt_file_fclose(&adata->fp_newsrc);
50 FREE(&adata->newsrc_file);
51 FREE(&adata->authenticators);
52 FREE(&adata->overview_fmt);
54 FREE(&adata->conn);
55 FREE(&adata->groups_list);
56 mutt_hash_free(&adata->groups_hash);
57 FREE(ptr);
58}
void mutt_hash_free(struct HashTable **ptr)
Free a hash table.
Definition hash.c:459
int mutt_socket_close(struct Connection *conn)
Close a socket.
Definition socket.c:100
NNTP-specific Account data -.
Definition adata.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ nm_adata_free()

void nm_adata_free ( void ** ptr)

Free the private Account data - Implements Account::adata_free() -.

Definition at line 39 of file adata.c.

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}
void nm_db_free(notmuch_database_t *db)
Decoupled way to close a Notmuch database.
Definition db.c:250
Notmuch-specific Account data -.
Definition adata.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pop_adata_free()

void pop_adata_free ( void ** ptr)

Free the private Account data - Implements Account::adata_free() -.

The PopAccountData struct stores global POP data, such as the connection to the database. This function will close the database, free the resources and the struct itself.

Definition at line 41 of file adata.c.

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}
POP-specific Account data -.
Definition adata.h:37
+ Here is the caller graph for this function: