mail-modifylog.c revision 025961fd171e7be79d7be7dee3d619de317f0b1e
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen/* Copyright (C) 2002 Timo Sirainen */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen/* Maximum size for modify log (isn't exact) */
3b94ff5951db4d4eddb7a80ed4e3f61207202635Timo Sirainen/* How large chunks to use to grow log file */
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen#define MODIFYLOG_GROW_SIZE (sizeof(ModifyLogRecord) * 128)
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen#define MODIFY_LOG_INITIAL_SIZE (sizeof(ModifyLogHeader) + MODIFYLOG_GROW_SIZE)
25757faf029c369a8318349dafe952e2358df1d8Timo Sirainen ((size_t) ((char *) (ptr) - (char *) (log)->mmap_base))
9f431ccfb6932746db56245c8a3d3415717ef545Timo Sirainen/* FIXME: not ANSI-C */
9f431ccfb6932746db56245c8a3d3415717ef545Timo Sirainen#define IS_PTR_IN_RANGE(ptr, area_ptr, area_size) \
66d2db642fe24d555d113ba463e446b038d476efTimo Sirainen (char *) (ptr) < (char *) (area_ptr) + (area_size))
unsigned int synced_id;
struct _MailModifyLog {
const char *function)
return FALSE;
t_push();
t_pop();
return FALSE;
int ret;
if (ret < 0) {
if (ret == 0) {
int ret;
if (ret <= 0) {
if (ret < 0)
if (keep_lock)
int ret;
if (ret == 0) {
return ret;
unsigned int extra;
return TRUE;
return FALSE;
sizeof(ModifyLogRecord);
if (extra != 0) {
return FALSE;
sizeof(ModifyLogRecord) != 0) {
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return log;
return FALSE;
return FALSE;
return TRUE;
MS_SYNC) < 0)
return FALSE;
return TRUE;
if (ret < 0)
if (ret > 0) {
return ret;
int fd;
if (ret < 0)
ret = 0;
if (ret > 0)
return ret;
return TRUE;
return TRUE;
return TRUE;
if (ret1 == 0) {
return FALSE;
int ret;
if (ret == 0) {
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return TRUE;
return TRUE;
return FALSE;
return TRUE;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
return FALSE;
return TRUE;
void *base;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
int external_change)
if (!external_change) {
return TRUE;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return TRUE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return TRUE;
return FALSE;
return TRUE;
unsigned int *count)
unsigned int *count1,
unsigned int *count2)
return FALSE;
return TRUE;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
return TRUE;
return TRUE;
return TRUE;
return FALSE;
return FALSE;
return TRUE;
rec++;
return rec;
sizeof(ModifyLogHeader));
unsigned int count = 0;
sizeof(ModifyLogRecord);
sizeof(ModifyLogRecord);
sizeof(ModifyLogHeader)) /
sizeof(ModifyLogRecord);
return count;
const ModifyLogExpunge *
unsigned int first_seq,
unsigned int last_seq,
unsigned int *expunges_before)
*expunges_before = 0;
return NULL;
return &no_expunges;
before = 0;
if (max_records-- == 0) {
return NULL;
arr++;
return expunges;
const ModifyLogExpunge *
unsigned int first_uid,
unsigned int last_uid,
unsigned int *expunges_before)
*expunges_before = 0;
return NULL;
return &no_expunges;
before = 0;
if (max_records-- == 0) {
return NULL;
arr++;
return expunges;
unsigned int expunges;
expunges = 0;
rec++;
return expunges;
unsigned int expunges;
return expunges;