* rename MuStoreXapian => MuStore
This commit is contained in:
@ -83,8 +83,8 @@ libmu_la_SOURCES= \
|
|||||||
mu-query.cc \
|
mu-query.cc \
|
||||||
mu-query.h \
|
mu-query.h \
|
||||||
mu-result.h \
|
mu-result.h \
|
||||||
mu-store-xapian.cc \
|
mu-store.cc \
|
||||||
mu-store-xapian.h \
|
mu-store.h \
|
||||||
mu-util-db.cc \
|
mu-util-db.cc \
|
||||||
mu-util-db.h \
|
mu-util-db.h \
|
||||||
mu-util.c \
|
mu-util.c \
|
||||||
|
|||||||
@ -28,12 +28,12 @@
|
|||||||
|
|
||||||
#include "mu-maildir.h"
|
#include "mu-maildir.h"
|
||||||
#include "mu-index.h"
|
#include "mu-index.h"
|
||||||
#include "mu-store-xapian.h"
|
#include "mu-store.h"
|
||||||
#include "mu-util.h"
|
#include "mu-util.h"
|
||||||
#include "mu-util-db.h"
|
#include "mu-util-db.h"
|
||||||
|
|
||||||
struct _MuIndex {
|
struct _MuIndex {
|
||||||
MuStoreXapian *_xapian;
|
MuStore *_xapian;
|
||||||
gboolean _needs_reindex;
|
gboolean _needs_reindex;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ mu_index_new (const char *xpath)
|
|||||||
g_return_val_if_fail (xpath, NULL);
|
g_return_val_if_fail (xpath, NULL);
|
||||||
|
|
||||||
index = g_new0 (MuIndex, 1);
|
index = g_new0 (MuIndex, 1);
|
||||||
index->_xapian = mu_store_xapian_new (xpath);
|
index->_xapian = mu_store_new (xpath);
|
||||||
|
|
||||||
if (!index->_xapian) {
|
if (!index->_xapian) {
|
||||||
g_warning ("%s: failed to open xapian store (%s)",
|
g_warning ("%s: failed to open xapian store (%s)",
|
||||||
@ -74,7 +74,7 @@ mu_index_destroy (MuIndex *index)
|
|||||||
if (!index)
|
if (!index)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mu_store_xapian_destroy (index->_xapian);
|
mu_store_destroy (index->_xapian);
|
||||||
g_free (index);
|
g_free (index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ mu_index_destroy (MuIndex *index)
|
|||||||
struct _MuIndexCallbackData {
|
struct _MuIndexCallbackData {
|
||||||
MuIndexMsgCallback _idx_msg_cb;
|
MuIndexMsgCallback _idx_msg_cb;
|
||||||
MuIndexDirCallback _idx_dir_cb;
|
MuIndexDirCallback _idx_dir_cb;
|
||||||
MuStoreXapian* _xapian;
|
MuStore* _xapian;
|
||||||
void* _user_data;
|
void* _user_data;
|
||||||
MuIndexStats* _stats;
|
MuIndexStats* _stats;
|
||||||
gboolean _reindex;
|
gboolean _reindex;
|
||||||
@ -133,7 +133,7 @@ insert_or_update_maybe (const char* fullpath, const char* mdir,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* we got a valid id; scan the message contents as well */
|
/* we got a valid id; scan the message contents as well */
|
||||||
if (mu_store_xapian_store (data->_xapian, msg) != MU_OK) {
|
if (mu_store_store (data->_xapian, msg) != MU_OK) {
|
||||||
g_warning ("%s: storing content %s failed", __FUNCTION__,
|
g_warning ("%s: storing content %s failed", __FUNCTION__,
|
||||||
fullpath);
|
fullpath);
|
||||||
/* ignore...*/
|
/* ignore...*/
|
||||||
@ -200,13 +200,13 @@ on_run_maildir_dir (const char* fullpath, gboolean enter,
|
|||||||
*/
|
*/
|
||||||
if (enter) {
|
if (enter) {
|
||||||
data->_dirstamp =
|
data->_dirstamp =
|
||||||
mu_store_xapian_get_timestamp (data->_xapian,
|
mu_store_get_timestamp (data->_xapian,
|
||||||
fullpath);
|
fullpath);
|
||||||
g_debug ("entering %s (ts==%u)",
|
g_debug ("entering %s (ts==%u)",
|
||||||
fullpath, (unsigned)data->_dirstamp);
|
fullpath, (unsigned)data->_dirstamp);
|
||||||
} else {
|
} else {
|
||||||
time_t now = time (NULL);
|
time_t now = time (NULL);
|
||||||
mu_store_xapian_set_timestamp (data->_xapian, fullpath,
|
mu_store_set_timestamp (data->_xapian, fullpath,
|
||||||
now);
|
now);
|
||||||
g_debug ("leaving %s (ts=%u)",
|
g_debug ("leaving %s (ts=%u)",
|
||||||
fullpath, (unsigned)data->_dirstamp);
|
fullpath, (unsigned)data->_dirstamp);
|
||||||
@ -240,7 +240,7 @@ check_path (const char* path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_cb_data (MuIndexCallbackData *cb_data, MuStoreXapian *xapian,
|
init_cb_data (MuIndexCallbackData *cb_data, MuStore *xapian,
|
||||||
gboolean reindex, MuIndexStats *stats,
|
gboolean reindex, MuIndexStats *stats,
|
||||||
MuIndexMsgCallback msg_cb, MuIndexDirCallback dir_cb,
|
MuIndexMsgCallback msg_cb, MuIndexDirCallback dir_cb,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
@ -289,12 +289,12 @@ mu_index_run (MuIndex *index, const char* path,
|
|||||||
(MuMaildirWalkDirCallback)on_run_maildir_dir,
|
(MuMaildirWalkDirCallback)on_run_maildir_dir,
|
||||||
&cb_data);
|
&cb_data);
|
||||||
if (rv == MU_OK) {
|
if (rv == MU_OK) {
|
||||||
if (!mu_store_xapian_set_version (index->_xapian,
|
if (!mu_store_set_version (index->_xapian,
|
||||||
MU_XAPIAN_DB_VERSION))
|
MU_XAPIAN_DB_VERSION))
|
||||||
g_warning ("failed to set database version");
|
g_warning ("failed to set database version");
|
||||||
}
|
}
|
||||||
|
|
||||||
mu_store_xapian_flush (index->_xapian);
|
mu_store_flush (index->_xapian);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ mu_index_stats (MuIndex *index, const char* path,
|
|||||||
|
|
||||||
|
|
||||||
struct _CleanupData {
|
struct _CleanupData {
|
||||||
MuStoreXapian *_xapian;
|
MuStore *_xapian;
|
||||||
MuIndexStats *_stats;
|
MuIndexStats *_stats;
|
||||||
MuIndexCleanupDeleteCallback _cb;
|
MuIndexCleanupDeleteCallback _cb;
|
||||||
void *_user_data;
|
void *_user_data;
|
||||||
@ -369,7 +369,7 @@ foreach_doc_cb (const char* path, CleanupData *cudata)
|
|||||||
if (access (path, R_OK) != 0) {
|
if (access (path, R_OK) != 0) {
|
||||||
|
|
||||||
g_debug ("not readable: %s; removing", path);
|
g_debug ("not readable: %s; removing", path);
|
||||||
rv = mu_store_xapian_remove (cudata->_xapian, path);
|
rv = mu_store_remove (cudata->_xapian, path);
|
||||||
if (rv != MU_OK)
|
if (rv != MU_OK)
|
||||||
return rv; /* something went wrong... bail out */
|
return rv; /* something went wrong... bail out */
|
||||||
|
|
||||||
@ -403,10 +403,10 @@ mu_index_cleanup (MuIndex *index, MuIndexStats *stats,
|
|||||||
cudata._cb = cb;
|
cudata._cb = cb;
|
||||||
cudata._user_data = user_data;
|
cudata._user_data = user_data;
|
||||||
|
|
||||||
rv = mu_store_xapian_foreach (index->_xapian,
|
rv = mu_store_foreach (index->_xapian,
|
||||||
(MuStoreXapianForeachFunc)foreach_doc_cb,
|
(MuStoreForeachFunc)foreach_doc_cb,
|
||||||
&cudata);
|
&cudata);
|
||||||
mu_store_xapian_flush (index->_xapian);
|
mu_store_flush (index->_xapian);
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright (C) 2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2008-2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify it
|
** This program is free software; you can redistribute it and/or modify it
|
||||||
** under the terms of the GNU General Public License as published by the
|
** under the terms of the GNU General Public License as published by the
|
||||||
@ -25,16 +25,16 @@
|
|||||||
#include <xapian.h>
|
#include <xapian.h>
|
||||||
|
|
||||||
#include "mu-msg.h"
|
#include "mu-msg.h"
|
||||||
#include "mu-store-xapian.h"
|
#include "mu-store.h"
|
||||||
#include "mu-util.h"
|
#include "mu-util.h"
|
||||||
|
|
||||||
/* number of new messages after which we commit to the database */
|
/* number of new messages after which we commit to the database */
|
||||||
#define MU_STORE_XAPIAN_TRX_SIZE 2000
|
#define MU_STORE_TRX_SIZE 2000
|
||||||
|
|
||||||
/* http://article.gmane.org/gmane.comp.search.xapian.general/3656 */
|
/* http://article.gmane.org/gmane.comp.search.xapian.general/3656 */
|
||||||
#define MU_STORE_XAPIAN_MAX_TERM_LENGTH 240
|
#define MU_STORE_MAX_TERM_LENGTH 240
|
||||||
|
|
||||||
struct _MuStoreXapian {
|
struct _MuStore {
|
||||||
Xapian::WritableDatabase *_db;
|
Xapian::WritableDatabase *_db;
|
||||||
|
|
||||||
/* transaction handling */
|
/* transaction handling */
|
||||||
@ -43,20 +43,20 @@ struct _MuStoreXapian {
|
|||||||
size_t _trx_size;
|
size_t _trx_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
MuStoreXapian*
|
MuStore*
|
||||||
mu_store_xapian_new (const char* xpath)
|
mu_store_new (const char* xpath)
|
||||||
{
|
{
|
||||||
MuStoreXapian *store (0);
|
MuStore *store (0);
|
||||||
|
|
||||||
g_return_val_if_fail (xpath, NULL);
|
g_return_val_if_fail (xpath, NULL);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
store = g_new0(MuStoreXapian,1);
|
store = g_new0(MuStore,1);
|
||||||
store->_db = new Xapian::WritableDatabase
|
store->_db = new Xapian::WritableDatabase
|
||||||
(xpath, Xapian::DB_CREATE_OR_OPEN);
|
(xpath, Xapian::DB_CREATE_OR_OPEN);
|
||||||
|
|
||||||
/* keep count of processed docs */
|
/* keep count of processed docs */
|
||||||
store->_trx_size = MU_STORE_XAPIAN_TRX_SIZE;
|
store->_trx_size = MU_STORE_TRX_SIZE;
|
||||||
store->_in_transaction = false;
|
store->_in_transaction = false;
|
||||||
store->_processed = 0;
|
store->_processed = 0;
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ mu_store_xapian_new (const char* xpath)
|
|||||||
|
|
||||||
|
|
||||||
char*
|
char*
|
||||||
mu_store_xapian_version (MuStoreXapian *store)
|
mu_store_version (MuStore *store)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (store, NULL);
|
g_return_val_if_fail (store, NULL);
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ mu_store_xapian_version (MuStoreXapian *store)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mu_store_xapian_set_version (MuStoreXapian *store, const char* version)
|
mu_store_set_version (MuStore *store, const char* version)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (store, FALSE);
|
g_return_val_if_fail (store, FALSE);
|
||||||
g_return_val_if_fail (version, FALSE);
|
g_return_val_if_fail (version, FALSE);
|
||||||
@ -106,7 +106,7 @@ mu_store_xapian_set_version (MuStoreXapian *store, const char* version)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
begin_trx_if (MuStoreXapian *store, gboolean cond)
|
begin_trx_if (MuStore *store, gboolean cond)
|
||||||
{
|
{
|
||||||
if (cond) {
|
if (cond) {
|
||||||
g_debug ("beginning Xapian transaction");
|
g_debug ("beginning Xapian transaction");
|
||||||
@ -116,7 +116,7 @@ begin_trx_if (MuStoreXapian *store, gboolean cond)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
commit_trx_if (MuStoreXapian *store, gboolean cond)
|
commit_trx_if (MuStore *store, gboolean cond)
|
||||||
{
|
{
|
||||||
if (cond) {
|
if (cond) {
|
||||||
g_debug ("comitting Xapian transaction");
|
g_debug ("comitting Xapian transaction");
|
||||||
@ -126,7 +126,7 @@ commit_trx_if (MuStoreXapian *store, gboolean cond)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rollback_trx_if (MuStoreXapian *store, gboolean cond)
|
rollback_trx_if (MuStore *store, gboolean cond)
|
||||||
{
|
{
|
||||||
if (cond) {
|
if (cond) {
|
||||||
g_debug ("rolling back Xapian transaction");
|
g_debug ("rolling back Xapian transaction");
|
||||||
@ -137,13 +137,13 @@ rollback_trx_if (MuStoreXapian *store, gboolean cond)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
mu_store_xapian_destroy (MuStoreXapian *store)
|
mu_store_destroy (MuStore *store)
|
||||||
{
|
{
|
||||||
if (!store)
|
if (!store)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mu_store_xapian_flush (store);
|
mu_store_flush (store);
|
||||||
|
|
||||||
MU_WRITE_LOG ("closing xapian database with %d documents",
|
MU_WRITE_LOG ("closing xapian database with %d documents",
|
||||||
(int)store->_db->get_doccount());
|
(int)store->_db->get_doccount());
|
||||||
@ -155,7 +155,7 @@ mu_store_xapian_destroy (MuStoreXapian *store)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mu_store_xapian_flush (MuStoreXapian *store)
|
mu_store_flush (MuStore *store)
|
||||||
{
|
{
|
||||||
g_return_if_fail (store);
|
g_return_if_fail (store);
|
||||||
|
|
||||||
@ -200,11 +200,11 @@ add_terms_values_string (Xapian::Document& doc, MuMsg *msg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mu_msg_field_xapian_term(field))
|
if (mu_msg_field_xapian_term(field))
|
||||||
/* terms can be up to MU_STORE_XAPIAN_MAX_TERM_LENGTH
|
/* terms can be up to MU_STORE_MAX_TERM_LENGTH
|
||||||
* (240) long; this is a Xapian limit
|
* (240) long; this is a Xapian limit
|
||||||
* */
|
* */
|
||||||
doc.add_term (std::string (prefix + value, 0,
|
doc.add_term (std::string (prefix + value, 0,
|
||||||
MU_STORE_XAPIAN_MAX_TERM_LENGTH));
|
MU_STORE_MAX_TERM_LENGTH));
|
||||||
|
|
||||||
if (mu_msg_field_xapian_value(field))
|
if (mu_msg_field_xapian_value(field))
|
||||||
doc.add_value ((Xapian::valueno)mu_msg_field_id (field),
|
doc.add_value ((Xapian::valueno)mu_msg_field_id (field),
|
||||||
@ -291,7 +291,7 @@ get_message_uid (MuMsg *msg)
|
|||||||
|
|
||||||
|
|
||||||
MuResult
|
MuResult
|
||||||
mu_store_xapian_store (MuStoreXapian *store, MuMsg *msg)
|
mu_store_store (MuStore *store, MuMsg *msg)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (store, MU_ERROR);
|
g_return_val_if_fail (store, MU_ERROR);
|
||||||
g_return_val_if_fail (msg, MU_ERROR);
|
g_return_val_if_fail (msg, MU_ERROR);
|
||||||
@ -326,7 +326,7 @@ mu_store_xapian_store (MuStoreXapian *store, MuMsg *msg)
|
|||||||
|
|
||||||
|
|
||||||
MuResult
|
MuResult
|
||||||
mu_store_xapian_remove (MuStoreXapian *store, const char* msgpath)
|
mu_store_remove (MuStore *store, const char* msgpath)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (store, MU_ERROR);
|
g_return_val_if_fail (store, MU_ERROR);
|
||||||
g_return_val_if_fail (msgpath, MU_ERROR);
|
g_return_val_if_fail (msgpath, MU_ERROR);
|
||||||
@ -352,7 +352,7 @@ mu_store_xapian_remove (MuStoreXapian *store, const char* msgpath)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mu_store_contains_message (MuStoreXapian *store, const char* path)
|
mu_store_contains_message (MuStore *store, const char* path)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (store, NULL);
|
g_return_val_if_fail (store, NULL);
|
||||||
g_return_val_if_fail (path, NULL);
|
g_return_val_if_fail (path, NULL);
|
||||||
@ -367,7 +367,7 @@ mu_store_contains_message (MuStoreXapian *store, const char* path)
|
|||||||
|
|
||||||
|
|
||||||
time_t
|
time_t
|
||||||
mu_store_xapian_get_timestamp (MuStoreXapian *store, const char* msgpath)
|
mu_store_get_timestamp (MuStore *store, const char* msgpath)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (store, 0);
|
g_return_val_if_fail (store, 0);
|
||||||
g_return_val_if_fail (msgpath, 0);
|
g_return_val_if_fail (msgpath, 0);
|
||||||
@ -386,8 +386,8 @@ mu_store_xapian_get_timestamp (MuStoreXapian *store, const char* msgpath)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
mu_store_xapian_set_timestamp (MuStoreXapian *store, const char* msgpath,
|
mu_store_set_timestamp (MuStore *store, const char* msgpath,
|
||||||
time_t stamp)
|
time_t stamp)
|
||||||
{
|
{
|
||||||
g_return_if_fail (store);
|
g_return_if_fail (store);
|
||||||
g_return_if_fail (msgpath);
|
g_return_if_fail (msgpath);
|
||||||
@ -402,8 +402,8 @@ mu_store_xapian_set_timestamp (MuStoreXapian *store, const char* msgpath,
|
|||||||
|
|
||||||
|
|
||||||
MuResult
|
MuResult
|
||||||
mu_store_xapian_foreach (MuStoreXapian *self,
|
mu_store_foreach (MuStore *self,
|
||||||
MuStoreXapianForeachFunc func, void *user_data)
|
MuStoreForeachFunc func, void *user_data)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (self, MU_ERROR);
|
g_return_val_if_fail (self, MU_ERROR);
|
||||||
g_return_val_if_fail (func, MU_ERROR);
|
g_return_val_if_fail (func, MU_ERROR);
|
||||||
@ -17,8 +17,8 @@
|
|||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __MU_STORE_XAPIAN_H__
|
#ifndef __MU_STORE_H__
|
||||||
#define __MU_STORE_XAPIAN_H__
|
#define __MU_STORE_H__
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
@ -28,56 +28,56 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
struct _MuStoreXapian;
|
struct _MuStore;
|
||||||
typedef struct _MuStoreXapian MuStoreXapian;
|
typedef struct _MuStore MuStore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create a new Xapian store, a place to store documents
|
* create a new Xapian store, a place to store documents
|
||||||
*
|
*
|
||||||
* @param path the path to the database
|
* @param path the path to the database
|
||||||
*
|
*
|
||||||
* @return a new MuStoreXapian object, or NULL in case of error
|
* @return a new MuStore object, or NULL in case of error
|
||||||
*/
|
*/
|
||||||
MuStoreXapian* mu_store_xapian_new (const char* path);
|
MuStore* mu_store_new (const char* path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* destroy the MuStoreXapian object and free resources
|
* destroy the MuStore object and free resources
|
||||||
*
|
*
|
||||||
* @param store a valid store, or NULL
|
* @param store a valid store, or NULL
|
||||||
*/
|
*/
|
||||||
void mu_store_xapian_destroy (MuStoreXapian *store);
|
void mu_store_destroy (MuStore *store);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get a version string for the database
|
* get a version string for the database
|
||||||
*
|
*
|
||||||
* @param store a valid MuStoreXapian
|
* @param store a valid MuStore
|
||||||
*
|
*
|
||||||
* @return the version string (free with g_free), or NULL in case of error
|
* @return the version string (free with g_free), or NULL in case of error
|
||||||
*/
|
*/
|
||||||
char* mu_store_xapian_version (MuStoreXapian *store);
|
char* mu_store_version (MuStore *store);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the version string for the database
|
* set the version string for the database
|
||||||
*
|
*
|
||||||
* @param store a valid MuStoreXapian
|
* @param store a valid MuStore
|
||||||
* @param version the version string (non-NULL)
|
* @param version the version string (non-NULL)
|
||||||
*
|
*
|
||||||
* @return TRUE if setting the version succeeded, FALSE otherwise
|
* @return TRUE if setting the version succeeded, FALSE otherwise
|
||||||
*/
|
*/
|
||||||
gboolean mu_store_xapian_set_version (MuStoreXapian *store,
|
gboolean mu_store_set_version (MuStore *store,
|
||||||
const char* version);
|
const char* version);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* try to flush/commit all outstanding work
|
* try to flush/commit all outstanding work
|
||||||
*
|
*
|
||||||
* @param store a valid xapian store
|
* @param store a valid xapian store
|
||||||
*/
|
*/
|
||||||
void mu_store_xapian_flush (MuStoreXapian *store);
|
void mu_store_flush (MuStore *store);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* store an email message in the XapianStore
|
* store an email message in the XapianStore
|
||||||
*
|
*
|
||||||
* @param store a valid store
|
* @param store a valid store
|
||||||
@ -85,10 +85,10 @@ void mu_store_xapian_flush (MuStoreXapian *store);
|
|||||||
*
|
*
|
||||||
* @return TRUE if it succeeded, FALSE otherwise
|
* @return TRUE if it succeeded, FALSE otherwise
|
||||||
*/
|
*/
|
||||||
MuResult mu_store_xapian_store (MuStoreXapian *store, MuMsg *msg);
|
MuResult mu_store_store (MuStore *store, MuMsg *msg);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* remove a message from the database
|
* remove a message from the database
|
||||||
*
|
*
|
||||||
* @param store a valid store
|
* @param store a valid store
|
||||||
@ -99,11 +99,11 @@ MuResult mu_store_xapian_store (MuStoreXapian *store, MuMsg *msg);
|
|||||||
*
|
*
|
||||||
* @return TRUE if it succeeded, FALSE otherwise
|
* @return TRUE if it succeeded, FALSE otherwise
|
||||||
*/
|
*/
|
||||||
MuResult mu_store_xapian_remove (MuStoreXapian *store,
|
MuResult mu_store_remove (MuStore *store,
|
||||||
const char* msgpath);
|
const char* msgpath);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* does a certain message exist in the database already?
|
* does a certain message exist in the database already?
|
||||||
*
|
*
|
||||||
* @param store a store
|
* @param store a store
|
||||||
@ -111,21 +111,21 @@ MuResult mu_store_xapian_remove (MuStoreXapian *store,
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
gboolean mu_store_contains_message (MuStoreXapian *store,
|
gboolean mu_store_contains_message (MuStore *store,
|
||||||
const char* path);
|
const char* path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* store a timestamp for a directory
|
* store a timestamp for a directory
|
||||||
*
|
*
|
||||||
* @param store a valid store
|
* @param store a valid store
|
||||||
* @param msgpath path to a maildir
|
* @param msgpath path to a maildir
|
||||||
* @param stamp a timestamp
|
* @param stamp a timestamp
|
||||||
*/
|
*/
|
||||||
void mu_store_xapian_set_timestamp (MuStoreXapian *store,
|
void mu_store_set_timestamp (MuStore *store,
|
||||||
const char* msgpath,
|
const char* msgpath,
|
||||||
time_t stamp);
|
time_t stamp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the timestamp for a directory
|
* get the timestamp for a directory
|
||||||
*
|
*
|
||||||
* @param store a valid store
|
* @param store a valid store
|
||||||
@ -133,10 +133,10 @@ void mu_store_xapian_set_timestamp (MuStoreXapian *store,
|
|||||||
*
|
*
|
||||||
* @return the timestamp, or 0 in case of error
|
* @return the timestamp, or 0 in case of error
|
||||||
*/
|
*/
|
||||||
time_t mu_store_xapian_get_timestamp (MuStoreXapian *store,
|
time_t mu_store_get_timestamp (MuStore *store,
|
||||||
const char* msgpath);
|
const char* msgpath);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* call a function for each document in the database
|
* call a function for each document in the database
|
||||||
*
|
*
|
||||||
* @param self a valid store
|
* @param self a valid store
|
||||||
@ -146,12 +146,12 @@ time_t mu_store_xapian_get_timestamp (MuStoreXapian *store,
|
|||||||
* @return MU_OK if all went well, MU_STOP if the foreach was interrupted,
|
* @return MU_OK if all went well, MU_STOP if the foreach was interrupted,
|
||||||
* MU_ERROR in case of error
|
* MU_ERROR in case of error
|
||||||
*/
|
*/
|
||||||
typedef MuResult (*MuStoreXapianForeachFunc) (const char* path,
|
typedef MuResult (*MuStoreForeachFunc) (const char* path,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
MuResult mu_store_xapian_foreach (MuStoreXapian *self,
|
MuResult mu_store_foreach (MuStore *self,
|
||||||
MuStoreXapianForeachFunc func,
|
MuStoreForeachFunc func,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /*__MU_STORE_XAPIAN_H__*/
|
#endif /*__MU_STORE_H__*/
|
||||||
Reference in New Issue
Block a user