index-search-result.c revision ff635a8e19fa52bad48adf4e8fd2b6839b906a47
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "seq-range-array.h"
#include "mail-search.h"
#include "mailbox-search-result-private.h"
#include "index-storage.h"
#include "index-search-result.h"
static void
unsigned int *pos,
{
unsigned int i, count;
}
i++;
}
}
/* finished this range */
if (++i < count)
else {
/* this was the last searched message */
seq = 0;
}
}
*pos = i;
}
static int
{
struct mailbox_transaction_context *t;
struct mail_search_context *search_ctx;
const struct seq_range *search_seqs;
int ret;
seqpos = 0;
/* tell search that we're updating an existing search result,
so it can do some optimizations based on it */
/* some messages in search_seqs didn't match.
make sure they don't exist in the search result. */
}
next_seq++;
} else {
/* this was the last searched message */
next_seq = 0;
}
/* match - make sure it exists in search result */
}
/* last message(s) didn't match. make sure they don't exist
in the search result. */
&next_seq,
}
if (mailbox_transaction_commit(&t) < 0)
ret = -1;
return ret;
}
{
struct mail_search_arg search_arg;
int ret;
/* add a temporary search parameter to limit the search only to
the changed messages */
return ret;
}
unsigned int old_messages_count)
{
struct mailbox_transaction_context *t;
struct mail_search_context *search_ctx;
struct mail_search_arg search_arg;
int ret;
if (old_messages_count == message_count) {
/* no new messages */
return 0;
}
/* add a temporary search parameter to limit the search only to
the new messages */
/* add all messages matching the search to search result */
if (mailbox_transaction_commit(&t) < 0)
ret = -1;
return ret;
}
{
unsigned int i, count;
return;
for (i = 0; i < count; i++) {
}
}
}