/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "imap-match.h"
#include "mail-index.h"
#include "mail-storage.h"
#include "mail-namespace.h"
#include "mail-search-build.h"
#include "mail-search.h"
#include "mail-search-mime.h"
static void
{
unsigned int i, count;
/* SEARCHRES: Replace with saved uidset */
if (search_saved_uidset == NULL ||
return;
return;
}
/* make a copy of the UIDs */
if (count == 0) {
/* empty set, keep it */
return;
}
/* put them back to the range as sequences */
for (i = 0; i < count; i++) {
if (seq1 != 0) {
}
/* make sure the last message is in the range */
}
}
}
struct mail_search_arg *arg,
bool change_uidsets,
{
case SEARCH_UIDSET:
if (change_uidsets) T_BEGIN {
} T_END;
break;
case SEARCH_MODSEQ:
break;
/* fall through - modseq with keyword */
case SEARCH_KEYWORDS:
keywords);
break;
case SEARCH_MAILBOX_GLOB: {
break;
}
case SEARCH_INTHREAD:
if (thread_args == NULL) {
struct mail_search_args, 1);
/* simplification should have unnested all
inthreads, so we'll assume that
have_inthreads=FALSE */
}
thread_args->refcount++;
/* fall through */
case SEARCH_SUB:
case SEARCH_OR:
break;
default:
break;
}
}
}
{
if (args->init_refcount++ > 0) {
return;
}
if (!args->simplified)
}
{
}
{
case SEARCH_MODSEQ:
case SEARCH_KEYWORDS:
break;
break;
case SEARCH_MAILBOX_GLOB:
break;
break;
case SEARCH_INTHREAD:
/* fall through */
case SEARCH_SUB:
case SEARCH_OR:
break;
default:
break;
}
}
{
if (--args->init_refcount > 0)
return;
}
struct mail_search_arg *arg,
{
case SEARCH_SEQSET:
/* replace sequences with UIDs in the existing array.
this way it's possible to switch between uidsets and
seqsets constantly without leaking memory */
break;
case SEARCH_SUB:
case SEARCH_OR:
case SEARCH_INTHREAD:
uids);
break;
default:
break;
}
}
}
{
T_BEGIN {
} T_END;
}
{
}
{
return;
}
}
static struct mail_search_arg *
{
case SEARCH_INTHREAD:
/* fall through */
case SEARCH_OR:
case SEARCH_SUB:
break;
case SEARCH_ALL:
break;
case SEARCH_SEQSET:
case SEARCH_UIDSET:
case SEARCH_REAL_UID:
break;
case SEARCH_FLAGS:
break;
case SEARCH_BEFORE:
case SEARCH_ON:
case SEARCH_SINCE:
break;
case SEARCH_SMALLER:
case SEARCH_LARGER:
break;
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
/* fall through */
case SEARCH_KEYWORDS:
case SEARCH_BODY:
case SEARCH_TEXT:
case SEARCH_GUID:
case SEARCH_MAILBOX:
case SEARCH_MAILBOX_GUID:
case SEARCH_MAILBOX_GLOB:
break;
case SEARCH_MODSEQ:
break;
case SEARCH_MIMEPART:
break;
}
return new_arg;
}
struct mail_search_arg *
{
}
return new_arg;
}
struct mail_search_args *
{
return new_args;
}
{
if (args->match_always) {
if (!full_reset)
else {
}
} else if (args->nonmatch_always) {
if (!full_reset)
else {
}
} else {
}
}
}
void *context)
{
return;
/* sublist of conditions */
/* didn't match */
break;
}
}
/* OR-list of conditions */
/* matched */
break;
}
}
} else {
/* just a single condition */
}
}
void *context)
{
int result;
result = 1;
/* didn't match */
return 0;
}
result = -1;
}
return result;
}
static void
{
return;
case SEARCH_OR:
case SEARCH_SUB:
}
}
break;
case SEARCH_BEFORE:
case SEARCH_ON:
case SEARCH_SINCE:
break;
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
sizeof(const char *));
break;
case SEARCH_BODY:
break;
case SEARCH_TEXT:
break;
default:
break;
}
}
const char *const *
bool *have_headers, bool *have_body)
{
bool have_text;
return NULL;
}
static bool
{
bool ret;
case SEARCH_OR:
return TRUE;
}
return FALSE;
case SEARCH_SUB:
case SEARCH_INTHREAD:
return FALSE;
}
return TRUE;
case SEARCH_MAILBOX:
case SEARCH_MAILBOX_GLOB: {
T_BEGIN {
} T_END;
}
default:
break;
}
return TRUE;
}
{
if (!args->simplified)
return FALSE;
}
return TRUE;
}
const struct mail_search_arg *arg2)
{
return FALSE;
case SEARCH_OR:
case SEARCH_SUB:
case SEARCH_ALL:
return TRUE;
case SEARCH_SEQSET:
/* sequences may point to different messages at different times,
never assume they match */
return FALSE;
case SEARCH_UIDSET:
case SEARCH_REAL_UID:
case SEARCH_FLAGS:
case SEARCH_KEYWORDS:
case SEARCH_BEFORE:
case SEARCH_ON:
case SEARCH_SINCE:
case SEARCH_SMALLER:
case SEARCH_LARGER:
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
return FALSE;
/* fall through */
case SEARCH_BODY:
case SEARCH_TEXT:
case SEARCH_GUID:
case SEARCH_MAILBOX:
case SEARCH_MAILBOX_GUID:
case SEARCH_MAILBOX_GLOB:
/* don't bother doing case-insensitive comparison. it must not
full i18n case-insensitivity (or the active comparator
in future). */
case SEARCH_MODSEQ: {
}
case SEARCH_INTHREAD:
return FALSE;
case SEARCH_MIMEPART:
}
i_unreached();
}
const struct mail_search_arg *arg2)
{
return FALSE;
}
}
const struct mail_search_args *args2)
{
}
static void
{
case SEARCH_OR:
case SEARCH_SUB:
case SEARCH_INTHREAD:
default:
break;
}
}
{
}
static void
const unsigned char **data,
{
case SEARCH_OR:
case SEARCH_SUB:
case SEARCH_INTHREAD:
}
default:
break;
}
}
{
}