mail-hash.h revision e89b9e95f9f6fef47e48d03007591ca832d00f91
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen unsigned int indexid;
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen unsigned int sync_id;
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen unsigned int uid;
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen/* Open or create a hash file for index. If the hash needs to be created,
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen it's also immediately built from the given index. */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainenint mail_hash_open_or_create(MailIndex *index);
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen/* Synchronize the hash file with memory map */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen/* Rebuild hash from index and reset the FLAG_REBUILD_HASH in header.
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen The index must have an exclusive lock before this function is called. */
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen/* Returns position in index file to given UID, or 0 if not found. */
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainenuoff_t mail_hash_lookup_uid(MailHash *hash, unsigned int uid);
dee43975a70bcdb9dc83d34d6a2b177d37bb7194Timo Sirainen/* Update hash file. If pos is 0, the record is deleted. This call may
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen rebuild the hash if it's too full. */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainenvoid mail_hash_update(MailHash *hash, unsigned int uid, uoff_t pos);