fts-backend-squat.c revision eef4ba0cc3e78f8c26804c1c9251a76580a41f0c
/* Copyright (c) 2006-2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "mail-user.h"
#include "mail-namespace.h"
#include "mail-storage-private.h"
#include "mail-search-build.h"
#include "squat-trie.h"
#include "fts-squat-plugin.h"
#include <stdlib.h>
#define SQUAT_FILE_PREFIX "dovecot.index.search"
struct squat_fts_backend {
struct fts_backend backend;
struct squat_trie *trie;
};
struct squat_fts_backend_build_context {
struct fts_backend_build_context ctx;
struct squat_trie_build_context *build_ctx;
enum squat_index_type squat_type;
};
static void
{
const char *const *tmp;
unsigned int len;
i_fatal("fts_squat: Invalid partial len: %s",
*tmp + 8);
}
i_fatal("fts_squat: Invalid full len: %s",
*tmp + 5);
}
} else {
}
}
}
{
struct squat_fts_backend *backend;
struct mail_storage *storage;
struct mailbox_status status;
enum squat_index_flags flags = 0;
if (*path == '\0') {
/* in-memory indexes */
i_debug("fts squat: Disabled with in-memory indexes");
return NULL;
}
}
{
struct squat_fts_backend *backend =
(struct squat_fts_backend *)_backend;
}
{
struct squat_fts_backend *backend =
(struct squat_fts_backend *)_backend;
}
static int
struct fts_backend_build_context **ctx_r)
{
struct squat_fts_backend *backend =
(struct squat_fts_backend *)_backend;
struct squat_fts_backend_build_context *ctx;
struct squat_trie_build_context *build_ctx;
return -1;
return 0;
}
static void
{
struct squat_fts_backend_build_context *ctx =
(struct squat_fts_backend_build_context *)_ctx;
}
static bool
const char *content_disposition ATTR_UNUSED)
{
struct squat_fts_backend_build_context *ctx =
(struct squat_fts_backend_build_context *)_ctx;
return FALSE;
return TRUE;
}
static int
{
struct squat_fts_backend_build_context *ctx =
(struct squat_fts_backend_build_context *)_ctx;
}
{
struct mailbox_transaction_context *t;
struct mail_search_context *search_ctx;
struct mail_search_args *search_args;
int ret;
t = mailbox_transaction_begin(box, 0);
}
(void)mailbox_transaction_commit(&t);
return ret;
}
static int
{
struct squat_fts_backend_build_context *ctx =
(struct squat_fts_backend_build_context *)_ctx;
int ret;
else {
}
array_free(&uids);
return ret;
}
static void
{
}
static void
bool committed ATTR_UNUSED)
{
/* FIXME */
}
{
struct squat_fts_backend *backend =
(struct squat_fts_backend *)_backend;
return 1;
}
{
}
static int
enum fts_lookup_flags flags,
{
struct squat_fts_backend *backend =
(struct squat_fts_backend *)_backend;
enum squat_index_type squat_type = 0;
if ((flags & FTS_LOOKUP_FLAG_HEADER) != 0)
if ((flags & FTS_LOOKUP_FLAG_BODY) != 0)
i_assert(squat_type != 0);
}
struct fts_backend fts_backend_squat = {
.name = "squat",
{
NULL,
NULL,
NULL,
}
};