unsigned int last_doc_id;
uint64_t last_thread_id;
+ /* error reporting; this value persists only until the
+ * next library call. May be NULL */
+ char *status_string;
+
Xapian::QueryParser *query_parser;
Xapian::TermGenerator *term_gen;
Xapian::ValueRangeProcessor *value_range_processor;
}
}
+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,
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] == '/')
return NULL;
}
}
+
+const char *
+notmuch_database_status_string (notmuch_database_t *notmuch)
+{
+ return notmuch->status_string;
+}
notmuch_status_t
_notmuch_database_ensure_writable (notmuch_database_t *notmuch);
+void
+_notmuch_database_log (notmuch_database_t *notmuch,
+ const char *format, ...);
+
const char *
_notmuch_database_relative_path (notmuch_database_t *notmuch,
const char *path);
notmuch_database_t **database,
char **error_message);
+/**
+ * Retrieve last status string for given database.
+ *
+ */
+const char *
+notmuch_database_status_string (notmuch_database_t *notmuch);
+
/**
* Commit changes and close the given notmuch database.
*