mail-index.h revision 17da42c31202b1b3e7e308121ea17d922c24da1b
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Create index if it doesn't exist */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Don't try to mmap() index files */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Rely on O_EXCL when creating dotlocks */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Don't fsync() or fdatasync() */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Flush NFS attr/data/write cache when necessary */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Open the index read-only */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Index file is corrupted, reopen or recreate it. */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* For private use by backend. Replacing flags doesn't change this. */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Message flags haven't been written to backend */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody (MAIL_ANSWERED | MAIL_FLAGGED | MAIL_DELETED | MAIL_SEEN | MAIL_DRAFT)
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* major version is increased only when you can't have backwards
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody compatibility. minor version is increased when header size is
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody increased to contain new non-critical fields. */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody uint32_t header_size; /* base + extended header size */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody uint8_t compat_flags; /* enum mail_index_header_compat_flags */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* these UIDs may not exist and may not even be unseen/deleted */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* non-external records between tail..head haven't been committed to
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody mailbox yet. */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* daily first UIDs that have been added to index. */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody uint8_t flags; /* enum mail_flags | enum mail_index_mail_flags */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody unsigned int count;
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* variable sized list of keyword indexes */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* If transaction is marked as hidden, the changes are marked with
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody hidden=TRUE when the view is synchronized. */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* External transactions describe changes to mailbox that have already
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody happened. */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Don't add flag updates unless they actually change something.
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody This is reliable only when syncing, otherwise someone else might
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody have already committed a transaction that had changed the flags. */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody MAIL_INDEX_TRANSACTION_FLAG_AVOID_FLAG_UPDATES = 0x04
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Resync all dirty messages' flags. */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Drop recent flags from all messages */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Create the transaction with AVOID_FLAG_UPDATES flag */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody MAIL_INDEX_SYNC_FLAG_AVOID_FLAG_UPDATES = 0x04,
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* If there are no new transactions and nothing else to do,
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody return 0 in mail_index_sync_begin() */
42826d96c8d0bba9eddc85b01bf70d7db571ae7fPhil Carmody /* Don't sync expunges */
struct mail_index_sync_rec {
unsigned int keyword_idx;
struct mail_index_view_sync_rec {
struct mail_index;
struct mail_index_map;
struct mail_index_view;
struct mail_index_transaction;
struct mail_index_sync_ctx;
struct mail_index_view_sync_ctx;
struct mail_index_transaction *
struct mail_index_view *
struct mail_index_view *
bool *delayed_expunges_r);
const struct mail_index_header *
const struct mail_index_record *
const struct mail_index_record *
const char *keyword,
unsigned int *idx_r);
struct mail_keywords *
const char *const keywords[]);
struct mail_keywords *
bool prepend);
bool *expunged_r);