NeoMutt  2023-03-22
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
 

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, but uses mutt_file_fopen() with mode "w" for mbox-style folders. 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...
 
#define MUTT_MAILBOX_CHECK_NO_FLAGS   0
 No flags are set. More...
 
#define MUTT_MAILBOX_CHECK_FORCE   (1 << 0)
 Ignore MailboxTime and check for new mail. More...
 
#define MUTT_MAILBOX_CHECK_FORCE_STATS   (1 << 1)
 Ignore MailboxType and calculate statistics. More...
 
#define MUTT_MAILBOX_CHECK_IMMEDIATE   (1 << 2)
 Don't postpone the actual checking. More...
 

Typedefs

typedef uint8_t OpenMailboxFlags
 Flags for mutt_open_mailbox(), e.g. MUTT_NOSORT. More...
 
typedef uint8_t CheckStatsFlags
 Flags for mutt_mailbox_check. 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 61 of file mxapi.h.

◆ MUTT_NOSORT

#define MUTT_NOSORT   (1 << 0)

Do not sort the mailbox after opening it.

Definition at line 62 of file mxapi.h.

◆ MUTT_APPEND

#define MUTT_APPEND   (1 << 1)

Open mailbox for appending messages.

Definition at line 63 of file mxapi.h.

◆ MUTT_READONLY

#define MUTT_READONLY   (1 << 2)

Open in read-only mode.

Definition at line 64 of file mxapi.h.

◆ MUTT_QUIET

#define MUTT_QUIET   (1 << 3)

Do not print any messages.

Definition at line 65 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 68 of file mxapi.h.

◆ MUTT_PEEK

#define MUTT_PEEK   (1 << 5)

Revert atime back after taking a look (if applicable)

Definition at line 69 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 71 of file mxapi.h.

◆ MUTT_MAILBOX_CHECK_NO_FLAGS

#define MUTT_MAILBOX_CHECK_NO_FLAGS   0

No flags are set.

Definition at line 74 of file mxapi.h.

◆ MUTT_MAILBOX_CHECK_FORCE

#define MUTT_MAILBOX_CHECK_FORCE   (1 << 0)

Ignore MailboxTime and check for new mail.

Definition at line 75 of file mxapi.h.

◆ MUTT_MAILBOX_CHECK_FORCE_STATS

#define MUTT_MAILBOX_CHECK_FORCE_STATS   (1 << 1)

Ignore MailboxType and calculate statistics.

Definition at line 76 of file mxapi.h.

◆ MUTT_MAILBOX_CHECK_IMMEDIATE

#define MUTT_MAILBOX_CHECK_IMMEDIATE   (1 << 2)

Don't postpone the actual checking.

Definition at line 77 of file mxapi.h.

Typedef Documentation

◆ OpenMailboxFlags

typedef uint8_t OpenMailboxFlags

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

Definition at line 60 of file mxapi.h.

◆ CheckStatsFlags

typedef uint8_t CheckStatsFlags

Flags for mutt_mailbox_check.

Definition at line 73 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 83 of file mxapi.h.

84{
85 MX_STATUS_ERROR = -1,
91};
@ MX_STATUS_LOCKED
Couldn't lock the Mailbox.
Definition: mxapi.h:88
@ MX_STATUS_ERROR
An error occurred.
Definition: mxapi.h:85
@ MX_STATUS_OK
No changes.
Definition: mxapi.h:86
@ MX_STATUS_FLAGS
Nondestructive flags change (IMAP)
Definition: mxapi.h:90
@ MX_STATUS_REOPENED
Mailbox was reopened.
Definition: mxapi.h:89
@ MX_STATUS_NEW_MAIL
New mail received in Mailbox.
Definition: mxapi.h:87

◆ 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 96 of file mxapi.h.

97{
101};
@ MX_OPEN_ERROR
Open failed with an error.
Definition: mxapi.h:99
@ MX_OPEN_ABORT
Open was aborted.
Definition: mxapi.h:100
@ MX_OPEN_OK
Open succeeded.
Definition: mxapi.h:98