NeoMutt  2024-03-23-142-g2b2e76
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 -.
 
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 98 of file adata.c.

99{
100 struct ImapAccountData *adata = mutt_mem_calloc(1, sizeof(struct ImapAccountData));
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, sizeof(*adata->cmds));
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:144
static int imap_timeout_observer(struct NotifyCallback *nc)
Notification that a timeout has occurred - Implements observer_t -.
Definition: adata.c:43
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
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
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:44
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:45
+ 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 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
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: