index-search.c revision 908bffbaff7230e31a887aab75572cc2549cb6fe
742N/A#include "utc-offset.h"
742N/A#include "message-address.h"
742N/A#include "message-date.h"
742N/A#include "message-search.h"
742N/A#include "message-parser.h"
742N/A#include "mail-index-modseq.h"
742N/A#include "index-storage.h"
742N/A#include "index-mail.h"
742N/A#include "index-sort.h"
742N/A#include "mail-search.h"
742N/A#include "mailbox-search-result-private.h"
742N/Astruct index_search_context {
742N/Astruct search_header_context {
3158N/Astruct search_body_context {
742N/A case SEARCH_SEQSET:
3158N/A case SEARCH_UIDSET:
742N/A case SEARCH_FLAGS:
742N/A case SEARCH_KEYWORDS:
742N/A case SEARCH_MODSEQ:
742N/A case SEARCH_ALL:
const unsigned int *keyword_indexes;
unsigned int i, j, count;
for (j = 0; j < count; j++) {
if (j == count)
int ret;
case SEARCH_UIDSET:
case SEARCH_FLAGS:
case SEARCH_KEYWORDS:
T_BEGIN {
} T_END;
return ret;
case SEARCH_MODSEQ: {
int timezone_offset;
case SEARCH_BEFORE:
case SEARCH_ON:
case SEARCH_SINCE:
MAIL_SEARCH_ARG_FLAG_USE_TZ) == 0) {
case SEARCH_BEFORE:
case SEARCH_ON:
case SEARCH_SINCE:
case SEARCH_SENTBEFORE:
case SEARCH_SENTON:
case SEARCH_SENTSINCE:
MAIL_SEARCH_ARG_FLAG_USE_TZ) == 0)
case SEARCH_SENTBEFORE:
case SEARCH_SENTON:
case SEARCH_SENTSINCE:
case SEARCH_SMALLER:
case SEARCH_LARGER:
int timezone_offset;
switch (type) {
case SEARCH_SENTBEFORE:
case SEARCH_SENTON:
case SEARCH_SENTSINCE:
i_unreached();
static struct message_search_context *
int ret;
return arg_ctx;
&arg_ctx);
if (ret > 0) {
return arg_ctx;
if (ret == 0)
return NULL;
unsigned int src_len)
for (i = 0; i < src_len; i++) {
if (!prev_lwsp) {
int ret;
case SEARCH_SENTBEFORE:
case SEARCH_SENTON:
case SEARCH_SENTSINCE:
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
T_BEGIN {
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
i_unreached();
} T_END;
case SEARCH_SENTBEFORE:
case SEARCH_SENTON:
case SEARCH_SENTSINCE:
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
int ret;
case SEARCH_BODY:
case SEARCH_BODY_FAST:
case SEARCH_TEXT:
case SEARCH_TEXT_FAST:
const char *const *headers;
return TRUE;
if (have_headers) {
if (have_body)
return FALSE;
headers);
&input) < 0) {
return FALSE;
return FALSE;
if (have_body) {
return TRUE;
unsigned int count;
if (count > 0) {
if (!not)
unsigned int count;
*seq2_r = 0;
if (!not) {
*seq2_r = 0;
case SEARCH_SUB:
case SEARCH_OR:
case SEARCH_SEQSET:
if (min_seq1 == 0) {
case SEARCH_SUB:
case SEARCH_OR:
case SEARCH_SEQSET:
if (uid_lowwater == 0)
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
struct mail_search_context *
struct index_transaction_context *t =
int ret;
return ret;
int ret;
if (ret >= 0)
return ret > 0;
return FALSE;
return FALSE;
return TRUE;
float percentage;
T_BEGIN {
const char *text;
} T_END;
case SEARCH_OR:
case SEARCH_SUB:
return FALSE;
return TRUE;
case SEARCH_SEQSET:
case SEARCH_FLAGS:
case SEARCH_KEYWORDS:
case SEARCH_MODSEQ:
case SEARCH_ALL:
case SEARCH_UIDSET:
case SEARCH_BEFORE:
case SEARCH_ON:
case SEARCH_SINCE:
case SEARCH_SENTBEFORE:
case SEARCH_SENTON:
case SEARCH_SENTSINCE:
case SEARCH_SMALLER:
case SEARCH_LARGER:
case SEARCH_HEADER:
case SEARCH_HEADER_ADDRESS:
case SEARCH_BODY:
case SEARCH_TEXT:
case SEARCH_BODY_FAST:
case SEARCH_TEXT_FAST:
return TRUE;
return FALSE;
return TRUE;
return FALSE;
unsigned int count = 0;
bool never;
int ret;
if (!never &&
if (never) {
ret = 0;
} else T_BEGIN {
if (ret == 0 &&
} T_END;
if (ret != 0) {
if (ret < 0)
return ret;
int ret;
ret = 0;
if (ret != 0) {
if (ret != 0)