* add mu_util_xapian_is_locked and use it

This commit is contained in:
Dirk-Jan C. Binnema
2011-01-14 07:47:19 +02:00
parent 2e4a94d0d6
commit 91cbdd6b71
3 changed files with 34 additions and 1 deletions

View File

@ -184,6 +184,16 @@ gboolean mu_util_xapian_is_empty (const gchar *xpath);
gboolean mu_util_xapian_clear (const gchar *xpath);
/**
* check if the database is locked for writing
*
* @param xpath path to a xapian database
*
* @return TRUE if it is locked, FALSE otherwise (or in case of error)
*/
gboolean mu_util_xapian_is_locked (const gchar *xpath);
/**
* convert a string array in to a string, with the elements separated
* by ' '
@ -252,10 +262,14 @@ unsigned char mu_util_get_dtype_with_lstat (const char *path);
g_set_error ((GE),0,MU_ERROR_XAPIAN_CANNOT_GET_WRITELOCK, \
"%s: xapian error '%s'", \
__FUNCTION__, xerr.get_msg().c_str()); \
} catch (const Xapian::DatabaseCorruptError &xerr ) { \
} catch (const Xapian::DatabaseCorruptError &xerr) { \
g_set_error ((GE),0,MU_ERROR_XAPIAN_CORRUPTION, \
"%s: xapian error '%s'", \
__FUNCTION__, xerr.get_msg().c_str()); \
} catch (const Xapian::DatabaseError &xerr) { \
g_set_error ((GE),0,MU_ERROR_XAPIAN, \
"%s: xapian error '%s'", \
__FUNCTION__, xerr.get_msg().c_str()); \
} catch (const Xapian::Error &xerr) { \
g_set_error ((GE),0,(E), "%s: xapian error '%s'", \
__FUNCTION__, xerr.get_msg().c_str()); \