virtual-search.c revision f4616f1875297fb2f583d913c0f01b075bdecd5b
/* Copyright (c) 2008 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "mail-search.h"
#include "index-storage.h"
#include "virtual-storage.h"
#include <stdlib.h>
enum virtual_search_state {
};
struct virtual_search_record {
};
struct virtual_search_context {
struct seq_range_iter result_iter;
unsigned int next_result_n;
unsigned int next_record_idx;
};
{
return -1;
return 1;
return -1;
return 1;
return 0;
}
{
const struct mail_search_arg *arg;
int ret = 1;
return -1;
ret = 0;
}
return ret;
}
struct virtual_search_context *vctx)
{
struct virtual_mailbox *mbox =
const struct virtual_mail_index_record *vrec;
unsigned int count;
const void *data;
bool expunged;
if (result > 0) {
/* full match, no need to check this any further */
} else {
/* possible match, save and check later */
}
}
return ret;
}
struct mail_search_context *
virtual_search_init(struct mailbox_transaction_context *t,
struct mail_search_args *args,
const enum mail_sort_type *sort_program)
{
struct mail_search_context *ctx;
struct virtual_search_context *vctx;
return ctx;
}
{
return index_storage_search_deinit(ctx);
}
{
int ret;
switch (vctx->search_state) {
return -1;
else
/* the messages won't be returned sorted, so we'll have to
do it ourself */
tryagain_r)) > 0)
if (ret < 0 || *tryagain_r)
return ret;
vctx->next_result_n = 0;
/* fall through */
*tryagain_r = FALSE;
return 0;
vctx->next_result_n++;
return 1;
}
i_unreached();
}
{
}
{
const struct virtual_search_record *recs;
unsigned int count;
/* go through potential results first */
i_unreached();
return TRUE;
}
/* this is known to match fully */
vctx->next_result_n++;
return TRUE;
}
return FALSE;
}