NeoMutt  2021-02-05-329-g9e03b7
Teaching an old dog new tricks
DOXYGEN
mxapi.h File Reference

API for mx backends. More...

#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/types.h>
#include "mailbox.h"
+ Include dependency graph for mxapi.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Message
 A local copy of an email. More...
 
struct  MxOps
 The Mailbox API. More...
 

Macros

#define MUTT_OPEN_NO_FLAGS   0
 No flags are set. More...
 
#define MUTT_NOSORT   (1 << 0)
 Do not sort the mailbox after opening it. More...
 
#define MUTT_APPEND   (1 << 1)
 Open mailbox for appending messages. More...
 
#define MUTT_READONLY   (1 << 2)
 Open in read-only mode. More...
 
#define MUTT_QUIET   (1 << 3)
 Do not print any messages. More...
 
#define MUTT_NEWFOLDER   (1 << 4)
 Create a new folder - same as MUTT_APPEND,. More...
 
#define MUTT_PEEK   (1 << 5)
 Revert atime back after taking a look (if applicable) More...
 
#define MUTT_APPENDNEW   (1 << 6)
 Set in mx_open_mailbox_append if the mailbox doesn't exist. More...
 

Typedefs

typedef uint8_t OpenMailboxFlags
 Flags for mutt_open_mailbox(), e.g. MUTT_NOSORT. More...
 

Enumerations

enum  MxStatus {
  MX_STATUS_ERROR = -1, MX_STATUS_OK, MX_STATUS_NEW_MAIL, MX_STATUS_LOCKED,
  MX_STATUS_REOPENED, MX_STATUS_FLAGS
}
 Return values from mbox_check(), mbox_check_stats(), mbox_snc(), and mbox_close() More...
 
enum  MxOpenReturns { MX_OPEN_OK, MX_OPEN_ERROR, MX_OPEN_ABORT }
 Return values for mbox_open() More...
 

Detailed Description

API for mx backends.

Authors
  • Michael R. Elkins
  • Richard Russon

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 mxapi.h.

Macro Definition Documentation

◆ MUTT_OPEN_NO_FLAGS

#define MUTT_OPEN_NO_FLAGS   0

No flags are set.

Definition at line 60 of file mxapi.h.

◆ MUTT_NOSORT

#define MUTT_NOSORT   (1 << 0)

Do not sort the mailbox after opening it.

Definition at line 61 of file mxapi.h.

◆ MUTT_APPEND

#define MUTT_APPEND   (1 << 1)

Open mailbox for appending messages.

Definition at line 62 of file mxapi.h.

◆ MUTT_READONLY

#define MUTT_READONLY   (1 << 2)

Open in read-only mode.

Definition at line 63 of file mxapi.h.

◆ MUTT_QUIET

#define MUTT_QUIET   (1 << 3)

Do not print any messages.

Definition at line 64 of file mxapi.h.

◆ MUTT_NEWFOLDER

#define MUTT_NEWFOLDER   (1 << 4)

Create a new folder - same as MUTT_APPEND,.

but uses mutt_file_fopen() with mode "w" for mbox-style folders. This will truncate an existing file.

Definition at line 65 of file mxapi.h.

◆ MUTT_PEEK

#define MUTT_PEEK   (1 << 5)

Revert atime back after taking a look (if applicable)

Definition at line 68 of file mxapi.h.

◆ MUTT_APPENDNEW

#define MUTT_APPENDNEW   (1 << 6)

Set in mx_open_mailbox_append if the mailbox doesn't exist.

Used by maildir/mh to create the mailbox.

Definition at line 69 of file mxapi.h.

Typedef Documentation

◆ OpenMailboxFlags

typedef uint8_t OpenMailboxFlags

Flags for mutt_open_mailbox(), e.g. MUTT_NOSORT.

Definition at line 59 of file mxapi.h.

Enumeration Type Documentation

◆ MxStatus

enum MxStatus

Return values from mbox_check(), mbox_check_stats(), mbox_snc(), and mbox_close()

Enumerator
MX_STATUS_ERROR 

An error occurred.

MX_STATUS_OK 

No changes.

MX_STATUS_NEW_MAIL 

New mail received in Mailbox.

MX_STATUS_LOCKED 

Couldn't lock the Mailbox.

MX_STATUS_REOPENED 

Mailbox was reopened.

MX_STATUS_FLAGS 

Nondestructive flags change (IMAP)

Definition at line 75 of file mxapi.h.

76 {
77  MX_STATUS_ERROR = -1,
78  MX_STATUS_OK,
83 };
Nondestructive flags change (IMAP)
Definition: mxapi.h:82
New mail received in Mailbox.
Definition: mxapi.h:79
Mailbox was reopened.
Definition: mxapi.h:81
No changes.
Definition: mxapi.h:78
Couldn&#39;t lock the Mailbox.
Definition: mxapi.h:80
An error occurred.
Definition: mxapi.h:77

◆ MxOpenReturns

Return values for mbox_open()

Enumerator
MX_OPEN_OK 

Open succeeded.

MX_OPEN_ERROR 

Open failed with an error.

MX_OPEN_ABORT 

Open was aborted.

Definition at line 88 of file mxapi.h.

89 {
90  MX_OPEN_OK,
93 };
Open succeeded.
Definition: mxapi.h:90
Open was aborted.
Definition: mxapi.h:92
Open failed with an error.
Definition: mxapi.h:91