mail-index-file.c revision 951f521e9275489a1a4f9272e84b6b8f3fb66d89
/* Copyright (C) 2003 Timo Sirainen */
#include "lib.h"
#include "file-set-size.h"
#include "mail-index.h"
#include "mail-index-util.h"
#include <unistd.h>
struct mail_index_record *rec)
{
}
unsigned int remove_last_idx)
{
/* not really needed since append() will initialize it as well,
but may help preventing problems if change is only partially
written to disk */
return mail_index_truncate(index);
}
struct mail_index_record *first_rec,
struct mail_index_record *last_rec)
{
struct mail_index_record *rec;
}
unsigned int seq)
{
return NULL;
}
struct mail_index_record *
{
struct mail_index_record *rec_p;
idx = 0;
left_idx = 0;
else
break;
}
/* could still be the next one */
idx++;
return NULL;
}
}
}
{
return TRUE;
return FALSE;
/* make sure the file is large enough */
/* mmap_update ftruncates the file to multiples of
mail_index_record, make sure we grow it enough here. */
(sizeof(struct mail_index_record) -
(diff % sizeof(struct mail_index_record)));
return FALSE;
}
if (!mail_index_mmap_update(index))
return FALSE;
}
/* if we break, we'll have to rebuild it completely */
return FALSE;
return FALSE;
return mail_index_mmap_update(index);
}
{
return TRUE;
/* really truncate the file only when it's almost empty */
if (empty_space > truncate_threshold) {
/* keep the size record-aligned */
index->header_size) %
sizeof(struct mail_index_record);
}
return TRUE;
}