NeoMutt  2024-11-14-34-g5aaf0d
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 69 of file adata.c.

70{
71 if (!ptr || !*ptr)
72 return;
73
74 struct ImapAccountData *adata = *ptr;
75
77
78 FREE(&adata->capstr);
79 buf_dealloc(&adata->cmdbuf);
80 FREE(&adata->buf);
81 FREE(&adata->cmds);
82
83 if (adata->conn)
84 {
85 if (adata->conn->close)
86 adata->conn->close(adata->conn);
87 FREE(&adata->conn);
88 }
89
90 FREE(ptr);
91}
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:377
static int imap_timeout_observer(struct NotifyCallback *nc)
Notification that a timeout has occurred - Implements observer_t -.
Definition: adata.c:43
#define FREE(x)
Definition: memory.h:55
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:42
struct Notify * notify_timeout
Timeout notifications handler.
Definition: neomutt.h:45
+ 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 80 of file mbox.c.

81{
82 if (!ptr || !*ptr)
83 return;
84
85 struct MboxAccountData *m = *ptr;
86
88 FREE(ptr);
89}
#define mutt_file_fclose(FP)
Definition: file.h:138
Mbox-specific Account data -.
Definition: lib.h:49
FILE * fp
Mailbox file.
Definition: lib.h:50
+ 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 43 of file adata.c.

44{
45 if (!ptr || !*ptr)
46 return;
47
48 struct NntpAccountData *adata = *ptr;
49
50 mutt_file_fclose(&adata->fp_newsrc);
51 FREE(&adata->newsrc_file);
52 FREE(&adata->authenticators);
53 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:457
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: