NeoMutt  2025-12-11-596-g7cc1dd
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
adata.h File Reference

Imap-specific Account data. More...

#include <stdbool.h>
#include <time.h>
#include "private.h"
#include "mutt/lib.h"
+ Include dependency graph for adata.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ImapAccountData
 IMAP-specific Account data -. More...
 

Functions

void imap_adata_free (void **ptr)
 Free the private Account data - Implements Account::adata_free() -.
 
struct ImapAccountDataimap_adata_get (struct Mailbox *m)
 Get the Account data for this mailbox.
 
struct ImapAccountDataimap_adata_new (struct Account *a)
 Allocate and initialise a new ImapAccountData structure.
 

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.h.

Function Documentation

◆ 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 158 of file adata.c.

159{
160 if (!m || (m->type != MUTT_IMAP) || !m->account)
161 return NULL;
162 return m->account->adata;
163}
@ MUTT_IMAP
'IMAP' Mailbox type
Definition mailbox.h:49
void * adata
Private data (for Mailbox backends)
Definition account.h:42
enum MailboxType type
Mailbox type.
Definition mailbox.h:101
struct Account * account
Account that owns this Mailbox.
Definition mailbox.h:126
+ Here is the caller graph for this function:

◆ 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 132 of file adata.c.

133{
135 adata->account = a;
136
137 static unsigned char new_seqid = 'a';
138
139 adata->seqid = new_seqid;
140 const short c_imap_pipeline_depth = cs_subset_number(NeoMutt->sub, "imap_pipeline_depth");
141 adata->cmdslots = c_imap_pipeline_depth + 2;
142 adata->cmds = MUTT_MEM_CALLOC(adata->cmdslots, struct ImapCommand);
143
144 if (++new_seqid > 'z')
145 new_seqid = 'a';
146
149
150 return adata;
151}
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:72
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:56
@ NT_MAILBOX
Mailbox has changed, NotifyMailbox, EventMailbox.
Definition notify_type.h:49
struct Notify * notify
Notifications: NotifyAccount, EventAccount.
Definition account.h:41
IMAP-specific Account data -.
Definition adata.h:40
IMAP command structure.
Definition private.h:160
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: