index-sync.c revision 020a39a395d2adb768e0179631b37bc78ecd9471
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "array.h"
#include "buffer.h"
#include "index-storage.h"
struct index_mailbox_sync_context {
struct mailbox_sync_context ctx;
struct index_mailbox *ibox;
struct mail_index_view_sync_ctx *sync_ctx;
unsigned int expunges_count;
int failed;
};
{
unsigned char *p;
if (ibox->recent_flags_start_seq == 0) {
0, dest_idx);
}
if (*p == 0) {
*p = 1;
}
}
{
const unsigned char *data;
ibox->recent_flags_start_seq == 0)
return FALSE;
}
{
const unsigned char *data;
if (ibox->recent_flags_start_seq == 0) {
/* no recent flags */
return;
}
/* expunging messages before recent flags, just modify
the recent start position */
return;
}
} else {
move = 0;
}
for (i = 0; i < count; i++) {
}
}
}
{
const struct mail_index_record *rec;
return -1;
}
}
return 0;
}
struct mailbox_sync_context *
int failed)
{
struct index_mailbox_sync_context *ctx;
if (failed) {
}
if ((flags & MAILBOX_SYNC_FLAG_NO_EXPUNGES) != 0)
if ((flags & MAILBOX_SYNC_FLAG_NO_NEWMAIL) != 0)
}
if (!ibox->recent_flags_synced) {
}
if ((flags & MAILBOX_SYNC_FLAG_NO_EXPUNGES) == 0) {
&ctx->expunges_count);
}
}
struct mailbox_sync_rec *sync_rec_r)
{
struct index_mailbox_sync_context *ctx =
(struct index_mailbox_sync_context *)_ctx;
struct mail_index_view_sync_rec sync;
int ret;
return -1;
/* not interested */
break;
/* later */
break;
/* FIXME: hide the flag updates for expunged messages */
&sync_rec_r->seq1,
&sync_rec_r->seq2) < 0) {
return -1;
}
if (sync_rec_r->seq1 == 0)
break;
sync_rec_r->type =
return 1;
}
}
/* expunges[] is a sorted array of sequences. it's easiest for
us to print them from end to beginning. */
sync_rec_r->seq2);
ctx->expunges_count--;
return 1;
}
if (ret < 0)
return ret;
}
#define SYNC_STATUS_FLAGS \
struct mailbox_status *status_r)
{
struct index_mailbox_sync_context *ctx =
(struct index_mailbox_sync_context *)_ctx;
if (ret == 0) {
}
status_r);
}
return ret;
}
{
ARRAY_SET_TYPE(k1, unsigned int);
ARRAY_SET_TYPE(k2, unsigned int);
/* The arrays may not be sorted, but they usually are. Optimize for
the assumption that they are */
return FALSE;
for (i = 0; i < count1; i++) {
/* not found / unsorted array. check. */
for (j = 0; j < count1; j++) {
break;
}
if (j == count1)
return FALSE;
}
}
return TRUE;
}