Representation of a mailbox. More...
#include "config.h"#include <sys/stat.h>#include "config/lib.h"#include "email/lib.h"#include "mailbox.h"#include "neomutt.h"Go to the source code of this file.
Data Structures | |
| struct | EmailGarbageCollector |
| Email garbage collection. More... | |
Functions | |
| 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. | |
| 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_update (struct Mailbox *m) |
| Get the mailbox's current size. | |
| void | mailbox_changed (struct Mailbox *m, enum NotifyMailbox action) |
| Notify observers of a change to a Mailbox. | |
| 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. | |
| bool | mailbox_set_subset (struct Mailbox *m, struct ConfigSubset *sub) |
| Set a Mailbox's Config Subset. | |
| 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. | |
Variables | |
| static const struct Mapping | MailboxTypes [] |
| Lookups for Mailbox types. | |
| static struct EmailGarbageCollector | GC = { 0 } |
| Set of Emails to be deleted. | |
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.c.
| int mailbox_gen | ( | void | ) |
| struct Mailbox * mailbox_new | ( | void | ) |
Create a new Mailbox.
| ptr | New Mailbox |
Definition at line 69 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.
| 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_update | ( | struct Mailbox * | m | ) |
Get the mailbox's current size.
| m | Mailbox to check |
Definition at line 238 of file mailbox.c.
| void mailbox_changed | ( | struct Mailbox * | m, |
| enum NotifyMailbox | action ) |
Add an email's size to the total size of a Mailbox.
Definition at line 272 of file mailbox.c.
| 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.
| 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.
|
static |
Lookups for Mailbox types.
Definition at line 40 of file mailbox.c.
|
static |