X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=database.cc;h=5049b47e9ef593d44b586bc67d37064f79dc0a84;hp=e46fe5d8915dd55910a9822560ddb3ba0e37427d;hb=96c0d1c1cb020654fd582509b25d979f2752500f;hpb=6c5054ebee5beb72c22d91a57c66b8ecdc65f7bf diff --git a/database.cc b/database.cc index e46fe5d8..5049b47e 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,