mbox-sync-private.h revision d0e5f8252516c4d4df2fbcdae4d37f9e5f931199
#ifndef __MBOX_SYNC_PRIVATE_H
#define __MBOX_SYNC_PRIVATE_H
#include "md5.h"
#include "mail-index.h"
enum mbox_sync_flags {
MBOX_SYNC_LAST_COMMIT = 0x01,
MBOX_SYNC_HEADER = 0x02,
MBOX_SYNC_LOCK_READING = 0x04,
MBOX_SYNC_UNDIRTY = 0x08
};
struct mbox_flag_type {
char chr;
enum mail_flags flag;
};
enum header_position {
};
#define MBOX_EXPUNGED 0x40
#define MBOX_DIRTY_SPACE 0x80
extern struct mbox_flag_type mbox_status_flags[];
extern struct mbox_flag_type mbox_xstatus_flags[];
struct mbox_sync_mail {
/* following variables have a bit overloaded functionality:
a) space <= 0 : offset points to beginning of headers. space is the
amount of space missing that is required to be able to rewrite
the headers
b) space > 0 : offset points to beginning of whitespace that can
be removed. space is the amount of data that can be removed from
there. note that the message may contain more whitespace
elsewhere. */
};
struct mbox_sync_mail_context {
struct mbox_sync_context *sync_ctx;
struct mbox_sync_mail mail;
struct md5_context hdr_md5_ctx;
unsigned char hdr_md5_sum[16];
unsigned int have_eoh:1;
unsigned int need_rewrite:1;
unsigned int seen_imapbase:1;
unsigned int pseudo:1;
unsigned int updated:1;
unsigned int recent:1;
unsigned int seen_received_hdr:1;
};
struct mbox_sync_context {
struct index_mailbox *ibox;
int fd;
struct mail_index_sync_ctx *index_sync_ctx;
struct mail_index_view *sync_view;
struct mail_index_transaction *t;
const struct mail_index_header *hdr;
/* header state: */
/* mail state: */
struct mail_index_sync_rec sync_rec;
unsigned int dest_first_mail:1;
unsigned int seen_first_mail:1;
};
struct mbox_sync_mail_context *ctx);
const struct mbox_sync_mail *mail);
int leave_space_hole);
#endif