mail-index.h revision 181aa01111e2de2dae413b4c1ccfcfc4e801ac40
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen /* Create index if it doesn't exist */
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen /* Update \Recent flag counters */
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen /* Compressing and cache updates are not performed */
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen /* Invalidate memory maps before accessing them */
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen /* internal: we're creating the index */
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen /* Rebuild flag is set while index is being rebuilt or when
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen some error is noticed in the index file. If this flag is set,
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen the index shouldn't be used before rebuilding it. */
4ded3d18fa391ae5908f9834f1390cf55e8c99d5Timo Sirainen MAIL_INDEX_HDR_FLAG_DIRTY_CUSTOMFLAGS = 0x0020,
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen /* If binary flags are set, it's not checked whether mail is
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen missing CRs. So this flag may be set as an optimization for
ba153863e55d75a7c2f28c9c010a905b8887b62bTimo Sirainen regular non-binary mails as well if it's known that it contains
b3a069922c8150a1cb14ec7683444f60dee98b55Timo Sirainen valid CR+LF line breaks. */
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen /* Mail flags have been changed in index, but not written into
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen actual mailbox yet. */
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen /* Maildir: Mail file is in new/ dir instead of cur/ */
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen /* Mail header or body is known to contain NUL characters. */
7b9f0c6aba07358e5520dc60c058126a4cae4056Timo Sirainen /* Mail header or body is known to not contain NUL characters. */
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen /* Mailbox is locked, will abort in secs_left */
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen /* Mailbox lock looks stale, will override in secs_left */
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen /* Index is locked, will abort in secs_left */
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen /* No errors */
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen /* Internal error, see get_error_text() for more information. */
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen /* Index is now in inconsistent state with the previous known state,
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen meaning that the message IDs etc. may have changed - only way to
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen recover this would be to fully close the mailbox and reopen it.
128ab2c52a29068be87e12ab5aebbb8fdc933adfTimo Sirainen With IMAP this would mean a forced disconnection since we can't do
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen forced CLOSE. */
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen /* We ran out of available disk space. */
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen /* Mail index locking timeouted */
e156adefc1260d31a145df2f5e9b3c82050d4163Timo Sirainen /* Mailbox locking timeouted */
struct mail_index_header {
struct mail_index_record {
struct mail_index {
void *context);
unsigned int seq);
unsigned int first_uid,
unsigned int last_uid,
unsigned int *seq_r);
int external_change);
int external_change);
unsigned int indexid;
unsigned int excl_lock_counter;
unsigned int expunge_counter;
int mbox_fd;
unsigned int mbox_lock_counter;
unsigned int mbox_sync_counter;
int maildir_lock_fd;
void *mmap_base;
unsigned int first_recent_uid;
void *lock_notify_context;
unsigned int private_flags_mask;
unsigned int set_flags;
unsigned int cache_later_locks;
#ifdef DEV_T_STRUCT
# define MAIL_INDEX_PRIVATE_FILL 0
#define MAIL_INDEX_PRIVATE_FILL \
void *context);
unsigned int seq);
struct mail_index_record *
int external_change);
int external_change);
((struct mail_index_record *) \
((struct mail_index_record *) \
sizeof(struct mail_index_record))
STMT_START { \
} STMT_END
sizeof(struct mail_index_record))