X-Git-Url: https://git.cworth.org/git?p=notmuch;a=blobdiff_plain;f=database.cc;fp=database.cc;h=6d62109e73c11e758987c5203839e2ef91aa8291;hp=77b2eff22973073aa511c2d0c0baa31d20190e31;hb=84480738a5e225c145eeaac5c39bb858f6592e95;hpb=c58ee818b5e116d00172c8406149106c97c2e377 diff --git a/database.cc b/database.cc index 77b2eff2..6d62109e 100644 --- a/database.cc +++ b/database.cc @@ -28,6 +28,26 @@ using namespace std; +const char * +notmuch_status_to_string (notmuch_status_t status) +{ + switch (status) { + case NOTMUCH_STATUS_SUCCESS: + return "No error occurred"; + case NOTMUCH_STATUS_XAPIAN_EXCEPTION: + return "A Xapian exception occurred"; + case NOTMUCH_STATUS_FILE_NOT_EMAIL: + return "File is not an email"; + case NOTMUCH_STATUS_NULL_POINTER: + return "Erroneous NULL pointer"; + case NOTMUCH_STATUS_TAG_TOO_LONG: + return "Tag value is too long"; + default: + case NOTMUCH_STATUS_LAST_STATUS: + return "Unknown error status value"; + } +} + /* "128 bits of thread-id ought to be enough for anybody" */ #define NOTMUCH_THREAD_ID_BITS 128 #define NOTMUCH_THREAD_ID_DIGITS (NOTMUCH_THREAD_ID_BITS / 4) @@ -64,6 +84,8 @@ thread_id_generate (thread_id_t *thread_id) } } +/* XXX: We should drop this function and convert all callers to call + * _notmuch_message_add_term instead. */ static void add_term (Xapian::Document doc, const char *prefix_name,