diff options
| author | David Bremner <david@tethera.net> | 2015-01-20 08:53:41 +0100 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2015-03-01 08:49:14 +0100 |
| commit | 7a0fc103678ea1b1da2df561d222c08db04c5af2 (patch) | |
| tree | d7ecaa6545e8035ddd1c0086488334153519a39f /lib/notmuch.h | |
| parent | a9e0786f72bd01186b58b739986e7ac0680ff7c0 (diff) | |
lib: add new status reporting API for notmuch_query_search_{m,t}
This at least allows distinguishing between out of memory and Xapian
exceptions. Adding finer grained status codes would allow different
Xapian exceptions to be preserved.
Adding wrappers allows people to transition gradually to the new API,
at the cost of bloating the library API a bit.
Diffstat (limited to 'lib/notmuch.h')
| -rw-r--r-- | lib/notmuch.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h index 220839b7..3e326bfc 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -780,11 +780,19 @@ notmuch_query_add_tag_exclude (notmuch_query_t *query, const char *tag); * to call it if the query is about to be destroyed). * * If a Xapian exception occurs this function will return NULL. + * For better error reporting, use the _st variant. */ notmuch_threads_t * notmuch_query_search_threads (notmuch_query_t *query); /** + * Like notmuch_query_search_threads, but with a status return. + */ +notmuch_status_t +notmuch_query_search_threads_st (notmuch_query_t *query, + notmuch_threads_t **out); + +/** * Execute a query for messages, returning a notmuch_messages_t object * which can be used to iterate over the results. The returned * messages object is owned by the query and as such, will only be @@ -822,11 +830,19 @@ notmuch_query_search_threads (notmuch_query_t *query); * reason to call it if the query is about to be destroyed). * * If a Xapian exception occurs this function will return NULL. + * For better error reporting, use the _st variant. */ notmuch_messages_t * notmuch_query_search_messages (notmuch_query_t *query); /** + * Like notmuch_query_search_messages, but with a status return. + */ +notmuch_status_t +notmuch_query_search_messages_st (notmuch_query_t *query, + notmuch_messages_t **out); + +/** * Destroy a notmuch_query_t along with any associated resources. * * This will in turn destroy any notmuch_threads_t and |
