]> git.notmuchmail.org Git - notmuch/commitdiff
lib: replace n_query_search_threads with status returning version
authorDavid Bremner <david@tethera.net>
Sun, 26 Feb 2017 21:21:31 +0000 (17:21 -0400)
committerDavid Bremner <david@tethera.net>
Wed, 22 Mar 2017 11:28:09 +0000 (08:28 -0300)
This function was deprecated in notmuch 0.21. We finally remove the
deprecated API, and rename the status returning version to the simpler
name. The status returning is kept as a deprecated alias.

bindings/python/notmuch/query.py
bindings/ruby/query.c
lib/notmuch.h
lib/query.cc
notmuch-search.c
notmuch-show.c

index a0f4f64ba4b37eb85edf337f4e0807fd6cdae77e..3419f6265d2a14c8114f963403ad91d6270f8687 100644 (file)
@@ -134,10 +134,10 @@ class Query(object):
         self._assert_query_is_initialized()
         self._exclude_tag(self._query, _str(tagname))
 
-    """notmuch_query_search_threads_st"""
-    _search_threads_st = nmlib.notmuch_query_search_threads_st
-    _search_threads_st.argtypes = [NotmuchQueryP, POINTER(NotmuchThreadsP)]
-    _search_threads_st.restype = c_uint
+    """notmuch_query_search_threads"""
+    _search_threads = nmlib.notmuch_query_search_threads
+    _search_threads.argtypes = [NotmuchQueryP, POINTER(NotmuchThreadsP)]
+    _search_threads.restype = c_uint
 
     def search_threads(self):
         """Execute a query for threads
@@ -155,7 +155,7 @@ class Query(object):
         """
         self._assert_query_is_initialized()
         threads_p = NotmuchThreadsP() # == NULL
-        status = Query._search_threads_st(self._query, byref(threads_p))
+        status = Query._search_threads(self._query, byref(threads_p))
         if status != 0:
             raise NotmuchError(status)
 
index ce66926cfe7428b0c825fcb388d69d898f332aa4..4b3f1c4f761a3c32f5101d299ed53bb1b3fea52e 100644 (file)
@@ -138,7 +138,7 @@ notmuch_rb_query_search_threads (VALUE self)
 
     Data_Get_Notmuch_Query (self, query);
 
-    status = notmuch_query_search_threads_st (query, &threads);
+    status = notmuch_query_search_threads (query, &threads);
     if (status)
        notmuch_rb_status_raise (status);
 
index af4efbc8a18fe030d1652a69807b9024ce75de6f..601b2e3e8550616c2deac5fad7870287f3634eeb 100644 (file)
@@ -855,24 +855,22 @@ notmuch_query_add_tag_exclude (notmuch_query_t *query, const char *tag);
  * notmuch_threads_destroy function, but there's no good reason
  * to call it if the query is about to be destroyed).
  *
- * @since libnotmuch 4.2 (notmuch 0.20)
+ * @since libnotmuch 5.0 (notmuch 0.25)
  */
 notmuch_status_t
-notmuch_query_search_threads_st (notmuch_query_t *query,
-                                notmuch_threads_t **out);
+notmuch_query_search_threads (notmuch_query_t *query,
+                             notmuch_threads_t **out);
 
 /**
- * Like notmuch_query_search_threads_st, but without a status return.
- *
- * If a Xapian exception occurs this function will return NULL.
+ * Deprecated alias for notmuch_query_search_threads.
  *
- * @deprecated Deprecated as of libnotmuch 4.3 (notmuch 0.21). Please
- * use notmuch_query_search_threads_st instead.
+ * @deprecated Deprecated as of libnotmuch 5 (notmuch 0.25). Please
+ * use notmuch_query_search_threads instead.
  *
  */
-NOTMUCH_DEPRECATED(4,3)
-notmuch_threads_t *
-notmuch_query_search_threads (notmuch_query_t *query);
+NOTMUCH_DEPRECATED(5,0)
+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
index 59e9141a50cc1f46c5fd48e3c2e2598dac01d22b..2581ee64a4932726307f68657ffcc1f889a27cee 100644 (file)
@@ -497,22 +497,15 @@ _notmuch_threads_destructor (notmuch_threads_t *threads)
     return 0;
 }
 
-
-notmuch_threads_t *
-notmuch_query_search_threads (notmuch_query_t *query)
+notmuch_status_t
+notmuch_query_search_threads_st (notmuch_query_t *query, notmuch_threads_t **out)
 {
-    notmuch_status_t status;
-    notmuch_threads_t *threads;
-    status = notmuch_query_search_threads_st (query, &threads);
-    if (status)
-       return NULL;
-    else
-       return threads;
+    return notmuch_query_search_threads(query, out);
 }
 
 notmuch_status_t
-notmuch_query_search_threads_st (notmuch_query_t *query,
-                                notmuch_threads_t **out)
+notmuch_query_search_threads (notmuch_query_t *query,
+                             notmuch_threads_t **out)
 {
     notmuch_threads_t *threads;
     notmuch_messages_t *messages;
index 8c65d5ad196d7705fca8142eac5199bae9c658b2..c6899ffa34cb6079aeb1ee37425cb7548e32ac16 100644 (file)
@@ -132,7 +132,7 @@ do_search_threads (search_context_t *ctx)
            ctx->offset = 0;
     }
 
-    status = notmuch_query_search_threads_st (ctx->query, &threads);
+    status = notmuch_query_search_threads (ctx->query, &threads);
     if (print_status_query("notmuch search", ctx->query, status))
        return 1;
 
index 7451d5ab563cd03a33df05671d4efce5af7eb12c..75fb284986eb068548a4b957afe96675cda63d3f 100644 (file)
@@ -947,7 +947,7 @@ do_show (void *ctx,
     notmuch_messages_t *messages;
     notmuch_status_t status, res = NOTMUCH_STATUS_SUCCESS;
 
-    status= notmuch_query_search_threads_st (query, &threads);
+    status= notmuch_query_search_threads (query, &threads);
     if (print_status_query ("notmuch show", query, status))
        return 1;