index-status.c revision 3c7a9aa32ddc1a930a75681a6c3cafb8d10fe810
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "index-storage.h"
{
/* all are recent */
return hdr->messages_count;
}
/* get the first recent message */
return 0;
return 0;
/* now we know the record, but we'd still need to know how many
messages there's after this. there's two way to do this -
get the sequence number thus far (fast, unless there's deleted
messages) or just start reading messages forward until we're at
the end (fast assuming there's only a few recent messages).
it's a bit easier to use the first method and often it should be
faster too.. */
}
{
unsigned int seq, lowwater_uid;
/* no unseen messages */
return 0;
}
if (lowwater_uid != 0) {
/* begin scanning from the low water mark */
i_warning("index header's seen_messages_count or "
"first_unseen_uid_lowwater is invalid.");
return 0;
} else {
}
} else {
/* begin scanning from the beginning */
seq = 1;
}
seq++;
}
/* update the low water mark if we can get exclusive
lock immediately. */
}
}
{
return mail_storage_set_index_error(ibox);
/* we can get most of the status items without any trouble */
if (items & STATUS_FIRST_UNSEEN_SEQ) {
}
if (items & STATUS_RECENT)
/* STATUS sends EXISTS, so we've synced it */
return mail_storage_set_index_error(ibox);
}