NeoMutt  2020-06-26-89-g172cd3
Teaching an old dog new tricks
DOXYGEN
account.h
Go to the documentation of this file.
1 
24 #ifndef MUTT_CORE_ACCOUNT_H
25 #define MUTT_CORE_ACCOUNT_H
26 
27 #include <stdbool.h>
28 #include "mutt/lib.h"
29 #include "mailbox.h"
30 
31 struct ConfigSubset;
32 
36 struct Account
37 {
39  char *name;
40  struct ConfigSubset *sub;
41  struct MailboxList mailboxes;
42  struct Notify *notify;
43  void *adata;
44  void (*adata_free)(void **ptr);
45  TAILQ_ENTRY(Account) entries;
46 };
47 TAILQ_HEAD(AccountList, Account);
48 
55 {
58 };
59 
64 {
65  struct Account *account;
66 };
67 
68 void account_free (struct Account **ptr);
69 bool account_mailbox_add (struct Account *a, struct Mailbox *m);
70 bool account_mailbox_remove(struct Account *a, struct Mailbox *m);
71 struct Account *account_new (const char *name, struct ConfigSubset *sub);
72 
73 #endif /* MUTT_CORE_ACCOUNT_H */
bool account_mailbox_remove(struct Account *a, struct Mailbox *m)
Remove a Mailbox from an Account.
Definition: account.c:94
char * name
Name of Account.
Definition: account.h:39
struct Notify * notify
Notifications handler.
Definition: account.h:42
struct MailboxList mailboxes
List of Mailboxes.
Definition: account.h:41
A group of associated Mailboxes.
Definition: account.h:36
enum MailboxType type
Type of Mailboxes this Account contains.
Definition: account.h:38
An Event that happened to an Account.
Definition: account.h:63
void(* adata_free)(void **ptr)
Callback function to free private data.
Definition: account.h:44
A set of inherited config items.
Definition: subset.h:46
A mailbox.
Definition: mailbox.h:81
void * adata
Private data (for Mailbox backends)
Definition: account.h:43
bool account_mailbox_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account.
Definition: account.c:66
TAILQ_HEAD(AccountList, Account)
An Account is about to be destroyed.
Definition: account.h:57
Notification API.
Definition: notify.c:39
Representation of a mailbox.
MailboxType
Supported mailbox formats.
Definition: mailbox.h:43
struct ConfigSubset * sub
Inherited config items.
Definition: account.h:40
A new Account has been created.
Definition: account.h:56
NotifyAccount
Types of Account Event.
Definition: account.h:54
struct Account * account_new(const char *name, struct ConfigSubset *sub)
Create a new Account.
Definition: account.c:43
Convenience wrapper for the library headers.
void account_free(struct Account **ptr)
Free an Account.
Definition: account.c:126
struct Account * account
The Account this Event relates to.
Definition: account.h:65
TAILQ_ENTRY(Account) entries
Linked list of Accounts.