]> git.cworth.org Git - notmuch/blobdiff - lib/notmuch.h
libnotmuch: Underlying support for doing partial-results searches.
[notmuch] / lib / notmuch.h
index 4004af907d2e808c07e449b6b0d9d64d418a5bb5..c67376ebd2b0fdeef2016c53b7537f9c253ca282 100644 (file)
@@ -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.
  *