X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mx.h;h=cf032d48aaee1f47c6fd7653552c4da9018232c8;hp=f2a4e59b1922785564be9cc9688b8fcac54876af;hb=a264c7bd834b6a72c90e9f672a2e0fdb06c18083;hpb=b2a6a9673e124c222f921650a6f0025b64ab2145 diff --git a/mx.h b/mx.h index f2a4e59..cf032d4 100644 --- a/mx.h +++ b/mx.h @@ -18,6 +18,7 @@ #define _MX_H #include +#include /* * supported mailbox formats @@ -64,6 +65,19 @@ enum { break; \ } +typedef struct { + FILE *fp; /* pointer to the message data */ + char *path; /* path to temp file */ + short magic; /* type of mailbox this message belongs to */ + short write; /* nonzero if message is open for writing */ + struct { + unsigned read:1; + unsigned flagged:1; + unsigned replied:1; + } flags; + time_t received; /* the time at which this message was received */ +} MESSAGE; + typedef struct { /* folder magic */ int type; @@ -77,9 +91,15 @@ typedef struct { int (*mx_access) (const char*, int); /* read mailbox into ctx structure */ int (*mx_open_mailbox) (CONTEXT*); + /* open new message */ + int (*mx_open_new_message) (MESSAGE*, CONTEXT*, HEADER*); /* check ACL flags; if not implemented, always assume granted * permissions */ int (*mx_acl_check) (CONTEXT*, int); + /* fast closing */ + void (*mx_fastclose_mailbox) (CONTEXT*); + /* write out changes */ + int (*mx_sync_mailbox) (CONTEXT*, int, int*); } mx_t; /* called from main: init all folder types */ @@ -91,8 +111,9 @@ void mx_init (void); #define M_READONLY (1<<2) /* open in read-only mode */ #define M_QUIET (1<<3) /* do not print any messages */ #define M_NEWFOLDER (1<<4) /* create a new folder - same as M_APPEND, but uses - * safe_fopen() for mbox-style folders. - */ + * safe_fopen() for mbox-style folders. */ +#define M_COUNT (1<<5) /* just do counting? needed to do speed optimizations + for sidebar */ /* mx_open_new_message() */ #define M_ADD_FROM 1 /* add a From_ line */ @@ -107,19 +128,6 @@ enum { M_FLAGS /* nondestructive flags change (IMAP) */ }; -typedef struct { - FILE *fp; /* pointer to the message data */ - char *path; /* path to temp file */ - short magic; /* type of mailbox this message belongs to */ - short write; /* nonzero if message is open for writing */ - struct { - unsigned read:1; - unsigned flagged:1; - unsigned replied:1; - } flags; - time_t received; /* the time at which this message was received */ -} MESSAGE; - WHERE short DefaultMagic INITVAL (M_MBOX); /*