54 const char *label,
enum TriBool poll,
58 mailbox, label ? label :
"[NONE]",
59 (poll ==
TB_UNSET) ?
"[UNSPECIFIED]" :
77 bool new_account =
false;
207 struct Buffer *err,
struct ParseMailboxArray *args)
209 if (!cmd || !line || !err || !args)
226 bool label_set =
false;
239 buf_printf(err,
_(
"%s: too few arguments"),
"mailboxes -label");
320 struct ParseMailboxArray *args,
struct Buffer *err)
322 if (!cmd || !args || !err)
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
@ CMD_NAMED_MAILBOXES
:named-mailboxes
CommandResult
Error codes for command_t parse functions.
@ MUTT_CMD_SUCCESS
Success: Command worked.
@ MUTT_CMD_ERROR
Error: Can't help the user.
@ MUTT_CMD_WARNING
Warning: Help given to the user.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Convenience wrapper for the config headers.
void account_mailbox_remove(struct Account *a, struct Mailbox *m)
Remove a Mailbox from an Account.
struct Account * account_new(const char *name, struct ConfigSubset *sub)
Create a new Account.
Convenience wrapper for the core headers.
int mailbox_gen(void)
Get the next generation number.
struct Mailbox * mailbox_new(void)
Create a new Mailbox.
void mailbox_free(struct Mailbox **ptr)
Free a Mailbox.
@ NT_MAILBOX_CHANGE
Mailbox has been changed.
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
@ MUTT_UNKNOWN
Mailbox wasn't recognised.
enum CommandResult parse_unmailboxes(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'unmailboxes' command - Implements Command::parse() -.
enum CommandResult parse_mailboxes(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'mailboxes' command - Implements Command::parse() -.
#define mutt_debug(LEVEL,...)
@ LL_DEBUG1
Log at debug level 1.
@ LL_NOTIFY
Log of notifications.
static enum CommandResult mailbox_add(const char *folder, const char *mailbox, const char *label, enum TriBool poll, enum TriBool notify, struct Buffer *err)
Add a new Mailbox.
bool mailbox_remove_simple(const char *mailbox)
Remove a Mailbox.
void parse_mailbox_free(struct ParseMailbox *pm)
Free a ParseMailbox structure.
void parse_mailbox_array_free(struct ParseMailboxArray *pma)
Free a ParseMailboxArray.
bool parse_mailboxes_args(const struct Command *cmd, struct Buffer *line, struct Buffer *err, struct ParseMailboxArray *args)
Parse the 'mailboxes' and 'named-mailboxes' commands.
static void do_unmailboxes_star(void)
Remove all Mailboxes from the Sidebar/notifications.
enum CommandResult parse_mailboxes_exec(const struct Command *cmd, struct ParseMailboxArray *args, struct Buffer *err)
Execute the 'mailboxes' or 'named-mailboxes' command.
bool mailbox_add_simple(const char *mailbox, struct Buffer *err)
Add a new Mailbox.
static void do_unmailboxes(struct Mailbox *m)
Remove a Mailbox from the Sidebar/notifications.
Parse Mailboxes Commands.
TriBool
Tri-state boolean.
@ TB_FALSE
Value is false.
@ TB_UNSET
Value hasn't been set.
#define FREE(x)
Free memory and set the pointer to NULL.
int mutt_monitor_add(struct Mailbox *m)
Add a watch for a mailbox.
int mutt_monitor_remove(struct Mailbox *m)
Remove a watch for a mailbox.
Monitor files for changes.
Convenience wrapper for the library headers.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
void notify_free(struct Notify **ptr)
Free a notification handler.
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
void expand_path(struct Buffer *buf, bool regex)
Create the canonical path.
Some miscellaneous functions.
struct Mailbox * mx_mbox_find(struct Account *a, const char *path)
Find a Mailbox on an Account.
bool mx_ac_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account - Wrapper for MxOps::ac_add()
struct Account * mx_ac_find(struct Mailbox *m)
Find the Account owning a Mailbox.
int mx_path_canon2(struct Mailbox *m, const char *folder)
Canonicalise the path to realpath.
struct MailboxArray neomutt_mailboxes_get(struct NeoMutt *n, enum MailboxType type)
Get an Array of matching Mailboxes.
bool neomutt_account_add(struct NeoMutt *n, struct Account *a)
Add an Account to the global list.
@ NT_MAILBOX
Mailbox has changed, NotifyMailbox, EventMailbox.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
A group of associated Mailboxes.
enum MailboxType type
Type of Mailboxes this Account contains.
char * name
Name of Account.
struct Notify * notify
Notifications: NotifyAccount, EventAccount.
struct ConfigSubset * sub
Inherited config items.
String manipulation buffer.
const char * name
Name of the Command.
enum CommandId id
ID of the Command.
An Event that happened to a Mailbox.
struct Mailbox * mailbox
The Mailbox this Event relates to.
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
enum MailboxType type
Mailbox type.
bool poll_new_mail
Check for new mail.
char * name
A short name for the Mailbox.
struct Notify * notify
Notifications: NotifyMailbox, EventMailbox.
bool notify_user
Notify the user of new mail.
struct Buffer pathbuf
Path of the Mailbox.
struct Account * account
Account that owns this Mailbox.
bool visible
True if a result of "mailboxes".
int opened
Number of times mailbox is opened.
int gen
Generation number, for sorting.
Container for Accounts, Notifications.
struct AccountArray accounts
All Accounts.
struct Notify * notify
Notifications handler.
struct ConfigSubset * sub
Inherited config items.
Context for config parsing (history/backtrace)
Detailed error information from config parsing.
struct Buffer * message
Error message.
Parsed data for a single mailbox.
enum TriBool notify
Enable mailbox notification?
char * label
Descriptive label (strdup'd, may be NULL)
enum TriBool poll
Enable mailbox polling?
void cs_subset_free(struct ConfigSubset **ptr)
Free a Config Subset.