mail-index-private.h revision 8d131435ba4648c8821160ec38d508c97177c715
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen/* How large index files to mmap() instead of reading to memory. */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen/* How many seconds to wait a lock for index file. */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen/* How many times to retry opening index files if read/fstat returns ESTALE.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen This happens with NFS when the file has been deleted (ie. index file was
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen rewritten by another computer than us). */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen#define MAIL_INDEX_ESTALE_RETRY_COUNT NFS_ESTALE_RETRY_COUNT
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen PTR_OFFSET((map)->records, (idx) * (map)->hdr.record_size))
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainentypedef int mail_index_expunge_handler_t(struct mail_index_sync_map_ctx *ctx,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainentypedef int mail_index_sync_handler_t(struct mail_index_sync_map_ctx *ctx,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainentypedef void mail_index_sync_lost_handler_t(struct mail_index *index);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen uint32_t hdr_offset; /* points to mail_index_ext_header.data[] */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen uint32_t hdr_size; /* size of mail_index_ext_header.data[] */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen /* unsigned char name[name_size] */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen /* unsigned char data[hdr_size] (starting 64bit aligned) */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen /* struct mail_index_keyword_header_rec[] */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen /* char name[][] */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen uint32_t unused; /* for backwards compatibility */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen uint32_t name_offset; /* relative to beginning of name[] */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen uint32_t hdr_size; /* size of mail_index_ext_header.data[] */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen mail_index_expunge_handler_t *expunge_handler;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen void *records; /* struct mail_index_record[] */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ARRAY_DEFINE(extensions, struct mail_index_ext);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ARRAY_DEFINE(ext_id_map, uint32_t); /* index -> file */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ARRAY_DEFINE(keyword_idx_map, unsigned int); /* file -> index */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen /* If this mapping is written to disk and write_atomic=FALSE,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen write_seq_* specify the message sequence range that needs to be
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int write_atomic:1; /* write to a new file and rename() */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int id;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ARRAY_DEFINE(extensions, struct mail_index_registered_ext);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ARRAY_DEFINE(sync_lost_handlers, mail_index_sync_lost_handler_t *);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen /* last known log_file_tail_offset in main index file. used for
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen optimizing main index updates. */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen int lock_type, shared_lock_count, excl_lock_count;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int lock_id;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen struct hash_table *keywords_hash; /* name -> idx */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen /* Module-specific contexts. */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ARRAY_DEFINE(module_contexts, union mail_index_module_context *);
void *context);
unsigned int *lock_id_r);
unsigned int *lock_id_r);
const char *name);
const struct mail_index_ext *
const char *function);
const char *filepath,
const char *function);