mbox-sync-private.h revision 3343a61404603b21c246783a7963b77833095f31
e248fe370c4047cee921a91b48edc37944ab0526Timo Sirainen#define MBOX_NONRECENT MAIL_RECENT /* kludgy */
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainen#define STATUS_FLAGS_MASK (MAIL_SEEN|MBOX_NONRECENT)
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainen#define XSTATUS_FLAGS_MASK (MAIL_ANSWERED|MAIL_FLAGGED|MAIL_DRAFT|MAIL_DELETED)
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainenextern struct mbox_flag_type mbox_status_flags[];
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainenextern struct mbox_flag_type mbox_xstatus_flags[];
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainen /* following variables have a bit overloaded functionality:
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainen a) space <= 0 : offset points to beginning of headers. space is the
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainen amount of space missing that is required to be able to rewrite
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainen b) space > 0 : offset points to beginning of whitespace that can
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainen be removed. space is the amount of data that can be removed from
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainen there. note that the message may contain more whitespace
7a94f950fd1dcc81537acfc8adb030b5e703d722Timo Sirainen elsewhere. */
e248fe370c4047cee921a91b48edc37944ab0526Timo Sirainen size_t header_first_change, header_last_change;
12c6ef6f1268ed4d5b63709bb4215c481b4f078cTimo Sirainen /* header state: */
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen /* mail state: */
f059a046515f4b2b15a6c2a10a6f12f6166e39a5Timo Sirainen uint32_t seq, idx_seq, need_space_seq, need_space_idx_seq;
5a250816ffc4cc5db203f9410ea99b6601c7b91aTimo Sirainenint mbox_sync(struct index_mailbox *ibox, enum mbox_sync_flags flags);
46ec792dd4ccf6c34706c4774228301fafde6aa9Timo Sirainenint mbox_sync_has_changed(struct index_mailbox *ibox, int leave_dirty);
46ec792dd4ccf6c34706c4774228301fafde6aa9Timo Sirainenvoid mbox_sync_parse_next_mail(struct istream *input,
4c6ddf2491104f917d00e6900e833e80ea02c7b6Timo Sirainenint mbox_sync_parse_match_mail(struct index_mailbox *ibox,
e248fe370c4047cee921a91b48edc37944ab0526Timo Sirainenvoid mbox_sync_update_header(struct mbox_sync_mail_context *ctx,
e248fe370c4047cee921a91b48edc37944ab0526Timo Sirainenvoid mbox_sync_update_header_from(struct mbox_sync_mail_context *ctx,
e248fe370c4047cee921a91b48edc37944ab0526Timo Sirainenint mbox_sync_try_rewrite(struct mbox_sync_mail_context *ctx, off_t move_diff,
e248fe370c4047cee921a91b48edc37944ab0526Timo Sirainenint mbox_sync_rewrite(struct mbox_sync_context *sync_ctx, uoff_t extra_space,
e248fe370c4047cee921a91b48edc37944ab0526Timo Sirainenint mbox_sync_seek(struct mbox_sync_context *sync_ctx, uoff_t from_offset);
e248fe370c4047cee921a91b48edc37944ab0526Timo Sirainenint mbox_move(struct mbox_sync_context *sync_ctx,