cmd-search.c revision d85347c2dae4bf38d14fc0ec1ed26c051bcffaa1
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "ostream.h"
#include "str.h"
#include "commands.h"
#include "imap-search.h"
#define OUTBUF_SIZE 65536
struct imap_search_context {
struct mailbox_transaction_context *trans;
struct mail_search_context *search_ctx;
unsigned int output_sent:1;
};
static struct imap_search_context *
struct mail_search_arg *sargs)
{
struct imap_search_context *ctx;
return ctx;
}
struct imap_search_context *ctx)
{
int ret;
ret = -1;
}
return ret;
}
{
bool tryagain;
int ret;
return TRUE;
}
&tryagain)) > 0) {
/* flush. this also causes us to lock the output. */
}
}
if (tryagain)
return FALSE;
ret = -1;
if (ret < 0) {
return TRUE;
} else {
0, "OK Search completed.");
}
}
{
bool finished;
if (finished) {
} else {
if (cmd->output_pending)
}
}
{
struct imap_search_context *ctx;
struct mail_search_arg *sargs;
int args_count;
if (args_count < 1) {
if (args_count == -2)
return FALSE;
"Missing SEARCH arguments.");
return TRUE;
}
if (!client_verify_open_mailbox(cmd))
return TRUE;
/* CHARSET specified */
args++;
"Invalid charset argument.");
return TRUE;
}
args++;
} else {
charset = "UTF-8";
}
/* error in search arguments */
return TRUE;
}
if (cmd_search_more(cmd))
return TRUE;
/* we could have moved onto syncing by now */
return FALSE;
}