mail-cache.c revision 5bd1c1d4fe3265d5e6b6054044fd6d78e42c9d0a
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi/* Copyright (c) 2003-2016 Dovecot authors, see the included COPYING file */
842948e4162d89ffce0e8cd292702598d736489aKATOH Yasufumivoid mail_cache_set_syscall_error(struct mail_cache *cache,
da1f8f26b5bb2393c9dcd36b7761f3cfa1204e36Stéphane Graber mail_index_file_set_syscall_error(cache->index, cache->filepath,
94891ea3e44961f4369a7cc67d38c3a98a0e4c54Stéphane Graberstatic void mail_cache_unlink(struct mail_cache *cache)
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumivoid mail_cache_reset(struct mail_cache *cache)
755d8d03b148a0ada1ec93e4701edea0a92a4705KATOH Yasufumi /* mark the cache as unusable */
fb261f53fcad6a04473172c9c9b68ae1cc5afc7bKATOH Yasufumivoid mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...)
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi "Corrupted index cache file %s: %s",
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumivoid mail_cache_file_close(struct mail_cache *cache)
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi if (munmap(cache->mmap_base, cache->mmap_length) < 0)
57da8c32f85c0255efa61ee32e260068afdaa565KATOH Yasufumi mail_cache_set_syscall_error(cache, "munmap()");
const void *data;
return FALSE;
return FALSE;
return TRUE;
return TRUE;
return TRUE;
return TRUE;
return FALSE;
return FALSE;
unsigned int msg_count;
if (msg_count == 0)
if (want_compress) {
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
if (offset == 0) {
if (!copy_hdr)
const void **data_r)
const void *hdr_data;
void *data;
if (ret < 0) {
const void **data_r)
const void *data;
if (size == 0)
if (ret < 0) {
int ret;
if (ret > 0)
if (ret < 0) {
return ret;
return cache;
return cache;
unsigned int timeout_secs;
int ret;
if (ret < 0) {
if (ret <= 0)
return ret;
TRUE);
const void *data;
sizeof(struct mail_cache_header));
int ret = 0;
return ret;
if (*offset == 0) {
struct mail_cache_view *
return view;
bool update)
&message_count)) {
return first_new_seq;