NeoMutt  2018-07-16 +2225-8687db
Teaching an old dog new tricks
DOXYGEN
MxOps Struct Reference

The Mailbox API. More...

#include "mx.h"

Data Fields

enum MailboxType magic
 Mailbox type, e.g. MUTT_IMAP. More...
 
const char * name
 Mailbox name, e.g. "imap". More...
 
struct Account *(* ac_find )(struct Account *a, const char *path)
 Find an Account that matches a Mailbox path. More...
 
int(* ac_add )(struct Account *a, struct Mailbox *m)
 Add a Mailbox to an Account. More...
 
int(* mbox_open )(struct Mailbox *m)
 Open a Mailbox. More...
 
int(* mbox_open_append )(struct Mailbox *m, OpenMailboxFlags flags)
 Open a Mailbox for appending. More...
 
int(* mbox_check )(struct Mailbox *m, int *index_hint)
 Check for new mail. More...
 
int(* mbox_check_stats )(struct Mailbox *m, int flags)
 Check the Mailbox statistics. More...
 
int(* mbox_sync )(struct Mailbox *m, int *index_hint)
 Save changes to the Mailbox. More...
 
int(* mbox_close )(struct Mailbox *m)
 Close a Mailbox. More...
 
int(* msg_open )(struct Mailbox *m, struct Message *msg, int msgno)
 Open an email message in a Mailbox. More...
 
int(* msg_open_new )(struct Mailbox *m, struct Message *msg, struct Email *e)
 Open a new message in a Mailbox. More...
 
int(* msg_commit )(struct Mailbox *m, struct Message *msg)
 Save changes to an email. More...
 
int(* msg_close )(struct Mailbox *m, struct Message *msg)
 Close an email. More...
 
int(* msg_padding_size )(struct Mailbox *m)
 Bytes of padding between messages. More...
 
int(* msg_save_hcache )(struct Mailbox *m, struct Email *e)
 Save message to the header cache. More...
 
int(* tags_edit )(struct Mailbox *m, const char *tags, char *buf, size_t buflen)
 Prompt and validate new messages tags. More...
 
int(* tags_commit )(struct Mailbox *m, struct Email *e, char *buf)
 Save the tags to a message. More...
 
enum MailboxType(* path_probe )(const char *path, const struct stat *st)
 Does this Mailbox type recognise this path? More...
 
int(* path_canon )(char *buf, size_t buflen)
 Canonicalise a Mailbox path. More...
 
int(* path_pretty )(char *buf, size_t buflen, const char *folder)
 Abbreviate a Mailbox path. More...
 
int(* path_parent )(char *buf, size_t buflen)
 Find the parent of a Mailbox path. More...
 

Detailed Description

The Mailbox API.

Each backend provides a set of functions through which the Mailbox, messages, tags and paths are manipulated.

Definition at line 104 of file mx.h.

Field Documentation

enum MailboxType MxOps::magic

Mailbox type, e.g. MUTT_IMAP.

Definition at line 106 of file mx.h.

const char* MxOps::name

Mailbox name, e.g. "imap".

Definition at line 107 of file mx.h.

struct Account*(* MxOps::ac_find) (struct Account *a, const char *path)

Find an Account that matches a Mailbox path.

Parameters
aAccount to search
pathPath to search for
Return values
0Success
-1Error

Definition at line 116 of file mx.h.

int(* MxOps::ac_add) (struct Account *a, struct Mailbox *m)

Add a Mailbox to an Account.

Parameters
aAccount to add to
mMailbox to add
Return values
0Success
-1Error

Definition at line 124 of file mx.h.

int(* MxOps::mbox_open) (struct Mailbox *m)

Open a Mailbox.

Parameters
mMailbox to open
Return values
0Success
-1Error
-2Aborted

Definition at line 132 of file mx.h.

int(* MxOps::mbox_open_append) (struct Mailbox *m, OpenMailboxFlags flags)

Open a Mailbox for appending.

Parameters
mMailbox to open
flagsFlags, see OpenMailboxFlags
Return values
0Success
-1Failure

Definition at line 140 of file mx.h.

int(* MxOps::mbox_check) (struct Mailbox *m, int *index_hint)

Check for new mail.

Parameters
mMailbox
index_hintRemember our place in the index
Return values
>0Success, e.g. MUTT_REOPENED
-1Error

Definition at line 148 of file mx.h.

int(* MxOps::mbox_check_stats) (struct Mailbox *m, int flags)

Check the Mailbox statistics.

Parameters
mMailbox to check
flagsFunction flags
Return values
0Success
-1Failure

Definition at line 156 of file mx.h.

int(* MxOps::mbox_sync) (struct Mailbox *m, int *index_hint)

Save changes to the Mailbox.

Parameters
mMailbox to sync
index_hintRemember our place in the index
Return values
0Success
-1Failure

Definition at line 164 of file mx.h.

int(* MxOps::mbox_close) (struct Mailbox *m)

Close a Mailbox.

Parameters
mMailbox to close
Return values
0Success
-1Failure

Definition at line 171 of file mx.h.

int(* MxOps::msg_open) (struct Mailbox *m, struct Message *msg, int msgno)

Open an email message in a Mailbox.

Parameters
mMailbox
msgMessage to open
msgnoIndex of message to open
Return values
0Success
-1Error

Definition at line 180 of file mx.h.

int(* MxOps::msg_open_new) (struct Mailbox *m, struct Message *msg, struct Email *e)

Open a new message in a Mailbox.

Parameters
mMailbox
msgMessage to open
eEmail
Return values
0Success
-1Failure

Definition at line 189 of file mx.h.

int(* MxOps::msg_commit) (struct Mailbox *m, struct Message *msg)

Save changes to an email.

Parameters
mMailbox
msgMessage to commit
Return values
0Success
-1Failure

Definition at line 197 of file mx.h.

int(* MxOps::msg_close) (struct Mailbox *m, struct Message *msg)

Close an email.

Parameters
mMailbox
msgMessage to close
Return values
0Success
-1Failure

Definition at line 205 of file mx.h.

int(* MxOps::msg_padding_size) (struct Mailbox *m)

Bytes of padding between messages.

Parameters
mMailbox
Return values
numBytes of padding

Definition at line 211 of file mx.h.

int(* MxOps::msg_save_hcache) (struct Mailbox *m, struct Email *e)

Save message to the header cache.

Parameters
mMailbox
eEmail
Return values
0Success
-1Failure

Definition at line 219 of file mx.h.

int(* MxOps::tags_edit) (struct Mailbox *m, const char *tags, char *buf, size_t buflen)

Prompt and validate new messages tags.

Parameters
mMailbox
tagsExisting tags
bufBuffer to store the tags
buflenLength of buffer
Return values
-1Error
0No valid user input
1Buf set

Definition at line 230 of file mx.h.

int(* MxOps::tags_commit) (struct Mailbox *m, struct Email *e, char *buf)

Save the tags to a message.

Parameters
mMailbox
eEmail
bufBuffer containing tags
Return values
0Success
-1Failure

Definition at line 239 of file mx.h.

enum MailboxType(* MxOps::path_probe) (const char *path, const struct stat *st)

Does this Mailbox type recognise this path?

Parameters
pathPath to examine
ststat buffer (for local filesystems)
Return values
numType, e.g. MUTT_IMAP

Definition at line 246 of file mx.h.

int(* MxOps::path_canon) (char *buf, size_t buflen)

Canonicalise a Mailbox path.

Parameters
bufPath to modify
buflenLength of buffer
Return values
0Success
-1Failure

Definition at line 254 of file mx.h.

int(* MxOps::path_pretty) (char *buf, size_t buflen, const char *folder)

Abbreviate a Mailbox path.

Parameters
bufPath to modify
buflenLength of buffer
folderBase path for '=' substitution
Return values
0Success
-1Failure

Definition at line 263 of file mx.h.

int(* MxOps::path_parent) (char *buf, size_t buflen)

Find the parent of a Mailbox path.

Parameters
bufPath to modify
buflenLength of buffer
Return values
0Success
-1Failure

Definition at line 271 of file mx.h.


The documentation for this struct was generated from the following file: