Representation of a mailbox. More...
#include <stdbool.h>#include <stdint.h>#include <sys/types.h>#include <time.h>#include "mutt/lib.h"Go to the source code of this file.
Data Structures | |
| struct | Mailbox |
| A mailbox. More... | |
| struct | EventMailbox |
| An Event that happened to a Mailbox. More... | |
Macros | |
| #define | MUTT_ACL_ALL ((1 << 11) - 1) |
| All permissions. | |
Typedefs | |
| typedef uint16_t | AclFlags |
Enumerations | |
| enum | MailboxType { MUTT_MAILBOX_ANY = -2 , MUTT_MAILBOX_ERROR , MUTT_UNKNOWN , MUTT_MBOX , MUTT_MMDF , MUTT_MH , MUTT_MAILDIR , MUTT_NNTP , MUTT_IMAP , MUTT_NOTMUCH , MUTT_POP , MUTT_COMPRESSED } |
| Supported mailbox formats. More... | |
| enum | AclFlag { MUTT_ACL_NONE = 0 , MUTT_ACL_ADMIN = 1U << 0 , MUTT_ACL_CREATE = 1U << 1 , MUTT_ACL_DELETE = 1U << 2 , MUTT_ACL_DELMX = 1U << 3 , MUTT_ACL_EXPUNGE = 1U << 4 , MUTT_ACL_INSERT = 1U << 5 , MUTT_ACL_LOOKUP = 1U << 6 , MUTT_ACL_POST = 1U << 7 , MUTT_ACL_READ = 1U << 8 , MUTT_ACL_SEEN = 1U << 9 , MUTT_ACL_WRITE = 1U << 10 } |
| Mailbox ACL rights. More... | |
| enum | ExpandoDataMailbox { ED_MBX_MAILBOX_NAME = 1 , ED_MBX_MESSAGE_COUNT , ED_MBX_PERCENTAGE } |
| Expando UIDs for Mailboxes. More... | |
| enum | NotifyMailbox { NT_MAILBOX_ADD = 1 , NT_MAILBOX_DELETE , NT_MAILBOX_DELETE_ALL , NT_MAILBOX_CHANGE , NT_MAILBOX_INVALID , NT_MAILBOX_RESORT , NT_MAILBOX_UPDATE , NT_MAILBOX_UNTAG } |
| Types of Mailbox Event. More... | |
Functions | |
| ARRAY_HEAD (MailboxArray, struct Mailbox *) | |
| void | mailbox_changed (struct Mailbox *m, enum NotifyMailbox action) |
| Notify observers of a change to a Mailbox. | |
| void | mailbox_clear_emails (struct Mailbox *m) |
| Free all the Emails in a Mailbox. | |
| struct Mailbox * | mailbox_find (const char *path) |
| Find the mailbox with a given path. | |
| struct Mailbox * | mailbox_find_name (const char *name) |
| Find the mailbox with a given name. | |
| void | mailbox_free (struct Mailbox **ptr) |
| Free a Mailbox. | |
| int | mailbox_gen (void) |
| Get the next generation number. | |
| struct Mailbox * | mailbox_new (void) |
| Create a new Mailbox. | |
| bool | mailbox_set_subset (struct Mailbox *m, struct ConfigSubset *sub) |
| Set a Mailbox's Config Subset. | |
| void | mailbox_size_add (struct Mailbox *m, const struct Email *e) |
| Add an email's size to the total size of a Mailbox. | |
| void | mailbox_size_sub (struct Mailbox *m, const struct Email *e) |
| Subtract an email's size from the total size of a Mailbox. | |
| void | mailbox_update (struct Mailbox *m) |
| Get the mailbox's current size. | |
| void | mailbox_gc_add (struct Email *e) |
| Add an Email to the garbage-collection set. | |
| void | mailbox_gc_run (void) |
| Run the garbage-collection. | |
| const char * | mailbox_get_type_name (enum MailboxType type) |
| Get the type of a Mailbox. | |
| static const char * | mailbox_path (const struct Mailbox *m) |
| Get the Mailbox's path string. | |
Representation of a mailbox.
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 mailbox.h.
| enum MailboxType |
Supported mailbox formats.
| Enumerator | |
|---|---|
| MUTT_MAILBOX_ANY | Match any Mailbox type. |
| MUTT_MAILBOX_ERROR | Error occurred examining Mailbox. |
| MUTT_UNKNOWN | Mailbox wasn't recognised. |
| MUTT_MBOX | 'mbox' Mailbox type |
| MUTT_MMDF | 'mmdf' Mailbox type |
| MUTT_MH | 'MH' Mailbox type |
| MUTT_MAILDIR | 'Maildir' Mailbox type |
| MUTT_NNTP | 'NNTP' (Usenet) Mailbox type |
| MUTT_IMAP | 'IMAP' Mailbox type |
| MUTT_NOTMUCH | 'Notmuch' (virtual) Mailbox type |
| MUTT_POP | 'POP3' Mailbox type |
| MUTT_COMPRESSED | Compressed file Mailbox type. |
Definition at line 39 of file mailbox.h.
| enum AclFlag |
Mailbox ACL rights.
| Enumerator | |
|---|---|
| MUTT_ACL_NONE | No flags are set. |
| MUTT_ACL_ADMIN | Administer the account (get/set permissions). |
| MUTT_ACL_CREATE | Create a mailbox. |
| MUTT_ACL_DELETE | Delete a message. |
| MUTT_ACL_DELMX | Delete a mailbox. |
| MUTT_ACL_EXPUNGE | Expunge messages. |
| MUTT_ACL_INSERT | Add/copy into the mailbox (used when editing a message). |
| MUTT_ACL_LOOKUP | Lookup mailbox (visible to 'list'). |
| MUTT_ACL_POST | Post (submit messages to the server). |
| MUTT_ACL_READ | Read the mailbox. |
| MUTT_ACL_SEEN | Change the 'seen' status of a message. |
| MUTT_ACL_WRITE | Write to a message (for flagging or linking threads). |
Definition at line 58 of file mailbox.h.
| enum ExpandoDataMailbox |
Expando UIDs for Mailboxes.
| Enumerator | |
|---|---|
| ED_MBX_MAILBOX_NAME | |
| ED_MBX_MESSAGE_COUNT | |
| ED_MBX_PERCENTAGE | |
| enum NotifyMailbox |
Types of Mailbox Event.
Observers of NT_MAILBOX will be passed an EventMailbox.
| Enumerator | |
|---|---|
| NT_MAILBOX_ADD | Mailbox has been added. |
| NT_MAILBOX_DELETE | Mailbox is about to be deleted. |
| NT_MAILBOX_DELETE_ALL | All Mailboxes are about to be deleted. |
| NT_MAILBOX_CHANGE | Mailbox has been changed. |
| NT_MAILBOX_INVALID | Email list was changed. |
| NT_MAILBOX_RESORT | Email list needs resorting. |
| NT_MAILBOX_UPDATE | Update internal tables. |
| NT_MAILBOX_UNTAG | Clear the 'last-tagged' pointer. |
Definition at line 173 of file mailbox.h.
| ARRAY_HEAD | ( | MailboxArray | , |
| struct Mailbox * | ) |
| void mailbox_changed | ( | struct Mailbox * | m, |
| enum NotifyMailbox | action ) |
Notify observers of a change to a Mailbox.
Definition at line 256 of file mailbox.c.
| void mailbox_clear_emails | ( | struct Mailbox * | m | ) |
Free all the Emails in a Mailbox.
| m | Mailbox |
Free every Email in the array, including any left beyond msg_count, and the Message-ID and Subject Hash Tables that point to them. The tables are rebuilt when they are next needed. The message counts and size are reset.
The emails array itself is kept for reuse.
Definition at line 149 of file mailbox.c.
| struct Mailbox * mailbox_find | ( | const char * | path | ) |
Find the mailbox with a given path.
| path | Path to match |
| ptr | Matching Mailbox |
Definition at line 175 of file mailbox.c.
| struct Mailbox * mailbox_find_name | ( | const char * | name | ) |
Find the mailbox with a given name.
| name | Name to match |
| ptr | Matching Mailbox |
| NULL | No matching mailbox found |
Definition at line 211 of file mailbox.c.
| void mailbox_free | ( | struct Mailbox ** | ptr | ) |
Free a Mailbox.
| [out] | ptr | Mailbox to free |
Definition at line 90 of file mailbox.c.
| int mailbox_gen | ( | void | ) |
| struct Mailbox * mailbox_new | ( | void | ) |
| bool mailbox_set_subset | ( | struct Mailbox * | m, |
| struct ConfigSubset * | sub ) |
Set a Mailbox's Config Subset.
| m | Mailbox |
| sub | Parent Config Subset |
| true | Success |
Definition at line 293 of file mailbox.c.
Add an email's size to the total size of a Mailbox.
Definition at line 272 of file mailbox.c.
| void mailbox_update | ( | struct Mailbox * | m | ) |
Get the mailbox's current size.
| m | Mailbox to check |
Definition at line 238 of file mailbox.c.
| void mailbox_gc_add | ( | struct Email * | e | ) |
| void mailbox_gc_run | ( | void | ) |
| const char * mailbox_get_type_name | ( | enum MailboxType | type | ) |
Get the type of a Mailbox.
| ptr | String describing Mailbox type |
Definition at line 349 of file mailbox.c.