aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/notmuch.h
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-12 16:47:27 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-12 16:47:27 -0800
commit93dcc3b695e19dd36cc8f638c6e01ecbbd9a447d (patch)
tree5464887b28a4c53bc015fc8e6ea1a35221cf54c8 /lib/notmuch.h
parente530910ae2f4a25ddf0a45bb9eb0402561d46686 (diff)
libnotmuch: Underlying support for doing partial-results searches.
The library interface now allows the caller to do incremental searches, (such as one page of results at a time). Next we'll just need to hook this up to "notmuch search" and the emacs interface.
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r--lib/notmuch.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h
index 4004af90..c67376eb 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -313,6 +313,14 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);
* object is owned by the query and as such, will only be valid until
* notmuch_query_destroy.
*
+ * The 'first' and 'max_threads' arguments can be used to obtain
+ * partial results from the search. For example, to get results 10 at
+ * a time, pass 'max_threads' as 10 and for 'first' pass the values 0,
+ * 10, 20, etc. As a special case, a value of -1 for 'max_threads'
+ * indicates that no limiting is to be performed. So a search with
+ * 'first' == 0 and 'max_threads' == -1 will return the complete
+ * results of the search.
+ *
* Typical usage might be:
*
* notmuch_query_t *query;
@@ -345,13 +353,22 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);
* to call it if the query is about to be destroyed).
*/
notmuch_threads_t *
-notmuch_query_search_threads (notmuch_query_t *query);
+notmuch_query_search_threads (notmuch_query_t *query,
+ int first, int max_threads);
/* 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
* valid until notmuch_query_destroy.
*
+ * The 'first' and 'max_messages' arguments can be used to obtain
+ * partial results from the search. For example, to get results 10 at
+ * a time, pass 'max_messages' as 10 and for 'first' pass the values
+ * 0, 10, 20, etc. As a special case, a value of -1 for 'max_messages'
+ * indicates that no limiting is to be performed. So a search with
+ * 'first' == 0 and 'max_messages' == -1 will return the complete
+ * results of the search.
+ *
* Typical usage might be:
*
* notmuch_query_t *query;
@@ -384,7 +401,8 @@ notmuch_query_search_threads (notmuch_query_t *query);
* reason to call it if the query is about to be destroyed).
*/
notmuch_messages_t *
-notmuch_query_search_messages (notmuch_query_t *query);
+notmuch_query_search_messages (notmuch_query_t *query,
+ int first, int max_messages);
/* Destroy a notmuch_query_t along with any associated resources.
*