2
** Copyright (C) 2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
4
** This program is free software; you can redistribute it and/or modify
5
** it under the terms of the GNU General Public License as published by
6
** the Free Software Foundation; either version 3 of the License, or
7
** (at your option) any later version.
9
** This program is distributed in the hope that it will be useful,
10
** but WITHOUT ANY WARRANTY; without even the implied warranty of
11
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
** GNU General Public License for more details.
14
** You should have received a copy of the GNU General Public License
15
** along with this program; if not, write to the Free Software Foundation,
16
** Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
#ifndef __MU_UTIL_XAPIAN_H__
22
#define __MU_UTIL_XAPIAN_H__
29
* get the version of the xapian database (ie., the version of the
30
* 'schema' we are using). If this version != MU_XAPIAN_DB_VERSION,
31
* it's means we need to a full reindex.
33
* @param xpath path to the xapian database
35
* @return the version of the database as a newly allocated string
36
* (free with g_free); if there is no version yet, it will return NULL
38
gchar* mu_util_xapian_db_version (const gchar *xpath) G_GNUC_WARN_UNUSED_RESULT;
42
* check whether the database is empty (contains 0 documents); in
43
* addition, a non-existing database is considered 'empty' too
45
* @param xpath path to the xapian database
47
* @return TRUE if the database is empty, FALSE otherwise
49
gboolean mu_util_xapian_db_is_empty (const gchar *xpath);
52
* check if the 'schema' of the current database is up-to-date
54
* @param xpath path to the xapian database
56
* @return TRUE if it's up-to-date, FALSE otherwise
58
gboolean mu_util_xapian_db_version_up_to_date (const gchar *xpath);
61
* clear the database, ie., remove all of the contents. This is a
62
* destructive operation, but the database can be restored be doing a
63
* full scan of the maildirs.
65
* @param xpath path to the database
67
* @return TRUE if the clearing succeeded, FALSE otherwise.
69
gboolean mu_util_xapian_clear_database (const gchar *xpath);
74
#endif /*__MU_UTIL_XAPIAN_H__*/