~ubuntu-branches/ubuntu/quantal/maildir-utils/quantal

« back to all changes in this revision

Viewing changes to src/mu-util-xapian.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2010-02-28 19:30:03 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100228193003-95az0jwl5e2r31vf
Tags: 0.7-1
* Imported Upstream version 0.7
* disable upstream included make-index-silent patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
** Copyright (C) 2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
 
3
**
 
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.
 
8
**
 
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.
 
13
**
 
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.
 
17
**
 
18
*/
 
19
 
 
20
 
 
21
#ifndef __MU_UTIL_XAPIAN_H__
 
22
#define __MU_UTIL_XAPIAN_H__
 
23
 
 
24
#include <glib.h>
 
25
 
 
26
G_BEGIN_DECLS
 
27
 
 
28
/** 
 
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.
 
32
 * 
 
33
 * @param xpath path to the xapian database
 
34
 * 
 
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
 
37
 */
 
38
gchar* mu_util_xapian_db_version (const gchar *xpath) G_GNUC_WARN_UNUSED_RESULT;
 
39
 
 
40
 
 
41
/** 
 
42
 * check whether the database is empty (contains 0 documents); in
 
43
 * addition, a non-existing database is considered 'empty' too
 
44
 * 
 
45
 * @param xpath path to the xapian database
 
46
 * 
 
47
 * @return TRUE if the database is empty, FALSE otherwise
 
48
 */
 
49
gboolean mu_util_xapian_db_is_empty (const gchar *xpath);
 
50
 
 
51
/** 
 
52
 * check if the 'schema' of the current database is up-to-date
 
53
 * 
 
54
 * @param xpath path to the xapian database
 
55
 * 
 
56
 * @return TRUE if it's up-to-date, FALSE otherwise
 
57
 */
 
58
gboolean mu_util_xapian_db_version_up_to_date (const gchar *xpath);
 
59
 
 
60
/** 
 
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.
 
64
 * 
 
65
 * @param xpath path to the database
 
66
 * 
 
67
 * @return TRUE if the clearing succeeded, FALSE otherwise.
 
68
 */
 
69
gboolean mu_util_xapian_clear_database (const gchar *xpath);
 
70
 
 
71
 
 
72
G_END_DECLS
 
73
 
 
74
#endif /*__MU_UTIL_XAPIAN_H__*/