NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
mxapi.h
Go to the documentation of this file.
1 
24 #ifndef MUTT_CORE_MXAPI_H
25 #define MUTT_CORE_MXAPI_H
26 
27 #include "config.h"
28 #include <stdbool.h>
29 #include <stdint.h>
30 #include <stdio.h>
31 #include <sys/types.h>
32 #include "mailbox.h"
33 
34 struct Account;
35 struct Email;
36 struct stat;
37 
41 struct Message
42 {
43  FILE *fp;
44  char *path;
46  bool write;
47  struct
48  {
49  bool read : 1;
50  bool flagged : 1;
51  bool replied : 1;
52  bool draft : 1;
53  } flags;
54  time_t received;
55 };
56 
57 
58 /* flags for mutt_open_mailbox() */
59 typedef uint8_t OpenMailboxFlags;
60 #define MUTT_OPEN_NO_FLAGS 0
61 #define MUTT_NOSORT (1 << 0)
62 #define MUTT_APPEND (1 << 1)
63 #define MUTT_READONLY (1 << 2)
64 #define MUTT_QUIET (1 << 3)
65 #define MUTT_NEWFOLDER (1 << 4)
66 #define MUTT_PEEK (1 << 5)
69 #define MUTT_APPENDNEW (1 << 6)
70 
75 enum MxStatus
76 {
83 };
84 
89 {
93 };
94 
103 struct MxOps
104 {
105  enum MailboxType type;
106  const char *name;
107  bool is_local;
108 
123  bool (*ac_owns_path)(struct Account *a, const char *path);
124 
139  bool (*ac_add)(struct Account *a, struct Mailbox *m);
140 
152  enum MxOpenReturns (*mbox_open)(struct Mailbox *m);
153 
167  bool (*mbox_open_append)(struct Mailbox *m, OpenMailboxFlags flags);
168 
180  enum MxStatus (*mbox_check)(struct Mailbox *m);
181 
194  enum MxStatus (*mbox_check_stats)(struct Mailbox *m, uint8_t flags);
195 
207  enum MxStatus (*mbox_sync)(struct Mailbox *m);
208 
220  enum MxStatus (*mbox_close)(struct Mailbox *m);
221 
238  bool (*msg_open)(struct Mailbox *m, struct Message *msg, int msgno);
239 
255  bool (*msg_open_new)(struct Mailbox *m, struct Message *msg, const struct Email *e);
256 
271  int (*msg_commit) (struct Mailbox *m, struct Message *msg);
272 
287  int (*msg_close) (struct Mailbox *m, struct Message *msg);
288 
300  int (*msg_padding_size)(struct Mailbox *m);
301 
316  int (*msg_save_hcache) (struct Mailbox *m, struct Email *e);
317 
335  int (*tags_edit) (struct Mailbox *m, const char *tags, char *buf, size_t buflen);
336 
353  int (*tags_commit) (struct Mailbox *m, struct Email *e, char *buf);
354 
367  enum MailboxType (*path_probe)(const char *path, const struct stat *st);
368 
382  int (*path_canon) (char *buf, size_t buflen);
383 
398  int (*path_pretty) (char *buf, size_t buflen, const char *folder);
399 
413  int (*path_parent) (char *buf, size_t buflen);
414 
428  int (*path_is_empty) (const char *path);
429 };
430 
431 #endif /* MUTT_CORE_MXAPI_H */
432 
bool is_local
True, if Mailbox type has local files/dirs.
Definition: mxapi.h:107
The envelope/body of an email.
Definition: email.h:37
bool replied
Definition: mxapi.h:51
A group of associated Mailboxes.
Definition: account.h:36
Nondestructive flags change (IMAP)
Definition: mxapi.h:82
New mail received in Mailbox.
Definition: mxapi.h:79
MxOpenReturns
Return values for mbox_open()
Definition: mxapi.h:88
Open succeeded.
Definition: mxapi.h:90
Mailbox was reopened.
Definition: mxapi.h:81
enum MxStatus mbox_check(struct Mailbox *m, struct stat *sb, bool check_stats)
bool flagged
Definition: mxapi.h:50
A local copy of an email.
Definition: mxapi.h:41
A mailbox.
Definition: mailbox.h:81
struct Message::@1 flags
No changes.
Definition: mxapi.h:78
Open was aborted.
Definition: mxapi.h:92
uint8_t OpenMailboxFlags
Flags for mutt_open_mailbox(), e.g. MUTT_NOSORT.
Definition: mxapi.h:59
Couldn&#39;t lock the Mailbox.
Definition: mxapi.h:80
bool draft
Definition: mxapi.h:52
bool write
nonzero if message is open for writing
Definition: mxapi.h:46
const char * name
Mailbox name, e.g. "imap".
Definition: mxapi.h:106
char * committed_path
the final path generated by mx_msg_commit()
Definition: mxapi.h:45
Representation of a mailbox.
MailboxType
Supported mailbox formats.
Definition: mailbox.h:43
FILE * fp
pointer to the message data
Definition: mxapi.h:43
time_t received
the time at which this message was received
Definition: mxapi.h:54
Open failed with an error.
Definition: mxapi.h:91
bool read
Definition: mxapi.h:49
MxStatus
Return values from mbox_check(), mbox_check_stats(), mbox_snc(), and mbox_close() ...
Definition: mxapi.h:75
char * path
path to temp file
Definition: mxapi.h:44
Definition: mxapi.h:103
An error occurred.
Definition: mxapi.h:77