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