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

124{
125 if (!m || (m->type != MUTT_IMAP) || !m->account)
126 return NULL;
127 return m->account->adata;
128}
@ MUTT_IMAP
'IMAP' Mailbox type
Definition: mailbox.h:50
void * adata
Private data (for Mailbox backends)
Definition: account.h:42
enum MailboxType type
Mailbox type.
Definition: mailbox.h:102
struct Account * account
Account that owns this Mailbox.
Definition: mailbox.h:127
+ 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 98 of file adata.c.

99{
101 adata->account = a;
102
103 static unsigned char new_seqid = 'a';
104
105 adata->seqid = new_seqid;
106 const short c_imap_pipeline_depth = cs_subset_number(NeoMutt->sub, "imap_pipeline_depth");
107 adata->cmdslots = c_imap_pipeline_depth + 2;
108 adata->cmds = MUTT_MEM_CALLOC(adata->cmdslots, struct ImapCommand);
109
110 if (++new_seqid > 'z')
111 new_seqid = 'a';
112
114
115 return adata;
116}
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_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:40
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
IMAP-specific Account data -.
Definition: adata.h:40
IMAP command structure.
Definition: private.h:160
Container for Accounts, Notifications.
Definition: neomutt.h:42
struct Notify * notify_timeout
Timeout notifications handler.
Definition: neomutt.h:45
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function: