X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fdatabase.cc;h=aa06b3efb013c96676998e10de3ca0ed02dcf9ab;hb=b53e1a2da720e9a0efd815b92f0a54dc2f644ffc;hp=4173b68162ac8be100ece4ac7497f56bee3ada18;hpb=84d3b15d251623cbb66e5eca7ddb8d61aa596d33;p=notmuch diff --git a/lib/database.cc b/lib/database.cc index 4173b681..aa06b3ef 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -348,6 +348,23 @@ notmuch_status_to_string (notmuch_status_t status) } } +void +_notmuch_database_log (notmuch_database_t *notmuch, + const char *format, + ...) +{ + va_list va_args; + + va_start (va_args, format); + + if (notmuch->status_string) + talloc_free (notmuch->status_string); + + notmuch->status_string = talloc_vasprintf (notmuch, format, va_args); + + va_end (va_args); +} + static void find_doc_ids_for_term (notmuch_database_t *notmuch, const char *term, @@ -863,6 +880,7 @@ notmuch_database_open_verbose (const char *path, notmuch = talloc_zero (NULL, notmuch_database_t); notmuch->exception_reported = FALSE; + notmuch->status_string = NULL; notmuch->path = talloc_strdup (notmuch, path); if (notmuch->path[strlen (notmuch->path) - 1] == '/') @@ -2552,3 +2570,9 @@ notmuch_database_get_all_tags (notmuch_database_t *db) return NULL; } } + +const char * +notmuch_database_status_string (notmuch_database_t *notmuch) +{ + return notmuch->status_string; +}