NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
adata.c File Reference

Imap-specific Account data. More...

#include "config.h"
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "conn/lib.h"
#include "adata.h"
#include "lib.h"
+ Include dependency graph for adata.c:

Go to the source code of this file.

Functions

static int imap_timeout_observer (struct NotifyCallback *nc)
 Notification that a timeout has occurred - Implements observer_t -.
 
static int imap_mailbox_delete_observer (struct NotifyCallback *nc)
 Notification that a Mailbox is about to be deleted - Implements observer_t -.
 
void imap_adata_free (void **ptr)
 Free the private Account data - Implements Account::adata_free() -.
 
struct ImapAccountDataimap_adata_new (struct Account *a)
 Allocate and initialise a new ImapAccountData structure.
 
struct ImapAccountDataimap_adata_get (struct Mailbox *m)
 Get the Account data for this mailbox.
 

Detailed Description

Imap-specific Account data.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file adata.c.

Function Documentation

◆ imap_adata_new()

struct ImapAccountData * imap_adata_new ( struct Account * a)

Allocate and initialise a new ImapAccountData structure.

Parameters
aAccount
Return values
ptrNew ImapAccountData

Definition at line 136 of file adata.c.

137{
139 adata->account = a;
140
141 static unsigned char new_seqid = 'a';
142
143 adata->seqid = new_seqid;
144 const short c_imap_pipeline_depth = cs_subset_number(NeoMutt->sub, "imap_pipeline_depth");
145 adata->cmdslots = c_imap_pipeline_depth + 2;
146 adata->cmds = MUTT_MEM_CALLOC(adata->cmdslots, struct ImapCommand);
147
148 if (++new_seqid > 'z')
149 new_seqid = 'a';
150
153
154 return adata;
155}
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
Definition helpers.c:143
static int imap_mailbox_delete_observer(struct NotifyCallback *nc)
Notification that a Mailbox is about to be deleted - Implements observer_t -.
Definition adata.c:76
static int imap_timeout_observer(struct NotifyCallback *nc)
Notification that a timeout has occurred - Implements observer_t -.
Definition adata.c:43
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition notify.c:191
@ NT_TIMEOUT
Timeout has occurred.
Definition notify_type.h:57
@ NT_MAILBOX
Mailbox has changed, NotifyMailbox, EventMailbox.
Definition notify_type.h:50
struct Notify * notify
Notifications: NotifyAccount, EventAccount.
Definition account.h:41
void * adata
Private data (for Mailbox backends)
Definition account.h:42
IMAP-specific Account data -.
Definition adata.h:40
IMAP command structure.
Definition private.h:176
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify_timeout
Timeout notifications handler.
Definition neomutt.h:47
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ imap_adata_get()

struct ImapAccountData * imap_adata_get ( struct Mailbox * m)

Get the Account data for this mailbox.

Parameters
mMailbox
Return values
ptrPrivate data

Definition at line 162 of file adata.c.

163{
164 if (!m || (m->type != MUTT_IMAP) || !m->account)
165 return NULL;
166 return m->account->adata;
167}
@ MUTT_IMAP
'IMAP' Mailbox type
Definition mailbox.h:49
enum MailboxType type
Mailbox type.
Definition mailbox.h:104
struct Account * account
Account that owns this Mailbox.
Definition mailbox.h:129
+ Here is the caller graph for this function: