]> git.cworth.org Git - notmuch/commitdiff
lib: replace deprecated n_q_count_threads with status returning version
authorDavid Bremner <david@tethera.net>
Sun, 26 Feb 2017 21:21:35 +0000 (17:21 -0400)
committerDavid Bremner <david@tethera.net>
Wed, 22 Mar 2017 11:35:07 +0000 (08:35 -0300)
This function was deprecated in notmuch 0.21.  We re-use the name for
a status returning version, and deprecate the _st name.

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

index 10fb6dcce4d3b6450386c8008a46d882b243cbd9..06c7b11bb8648de7488092c6c2d63efed3e13bf0 100644 (file)
@@ -204,7 +204,7 @@ class Query(object):
             raise NotmuchError(status)
         return count.value
 
-    _count_threads = nmlib.notmuch_query_count_threads_st
+    _count_threads = nmlib.notmuch_query_count_threads
     _count_threads.argtypes = [NotmuchQueryP, POINTER(c_uint)]
     _count_threads.restype = c_uint
 
index b6edaef32b208b1aea4ed809476fb403169ff8f1..8b46d700bdab01554c8944ec7903ea9ce8a3707e 100644 (file)
@@ -201,7 +201,7 @@ notmuch_rb_query_count_threads (VALUE self)
 
     Data_Get_Notmuch_Query (self, query);
 
-    status = notmuch_query_count_threads_st (query, &count);
+    status = notmuch_query_count_threads (query, &count);
     if (status)
        notmuch_rb_status_raise (status);
 
index b79618f6127e78040104dbc9e8a754ba1329c849..e692e9bbe85d71b7f7b8b9aeb7e40826ca229cba 100644 (file)
@@ -1044,22 +1044,20 @@ notmuch_query_count_messages_st (notmuch_query_t *query, unsigned int *count);
  * NOTMUCH_STATUS_XAPIAN_EXCEPTION: a Xapian exception occured. The
  *      value of *count is not defined.
  *
- * @since libnotmuch 4.3 (notmuch 0.21)
+ * @since libnotmuch 5 (notmuch 0.25)
  */
 notmuch_status_t
-notmuch_query_count_threads_st (notmuch_query_t *query, unsigned *count);
+notmuch_query_count_threads (notmuch_query_t *query, unsigned *count);
 
 /**
- * like notmuch_query_count_threads, but without a status return.
- *
- * May return 0 in case of errors.
+ * Deprecated alias for notmuch_query_count_threads
  *
- * @deprecated Deprecated as of libnotmuch 4.3 (notmuch 0.21). Please
+ * @deprecated Deprecated as of libnotmuch 5.0 (notmuch 0.25). Please
  * use notmuch_query_count_threads_st instead.
  */
-NOTMUCH_DEPRECATED(4,3)
-unsigned int
-notmuch_query_count_threads (notmuch_query_t *query);
+NOTMUCH_DEPRECATED(5,0)
+notmuch_status_t
+notmuch_query_count_threads_st (notmuch_query_t *query, unsigned *count);
 
 /**
  * Get the thread ID of 'thread'.
index 754ccfccee6d5f48097b51ef14a0d853cc32052a..b7d4d3527d5a8b7062cb98b8e5342b6908c92525 100644 (file)
@@ -680,18 +680,14 @@ _notmuch_query_count_documents (notmuch_query_t *query, const char *type, unsign
     return NOTMUCH_STATUS_SUCCESS;
 }
 
-unsigned
-notmuch_query_count_threads (notmuch_query_t *query)
+notmuch_status_t
+notmuch_query_count_threads_st (notmuch_query_t *query, unsigned *count)
 {
-    notmuch_status_t status;
-    unsigned int count;
-
-    status = notmuch_query_count_threads_st (query, &count);
-    return status ? 0 : count;
+    return notmuch_query_count_threads (query, count);
 }
 
 notmuch_status_t
-notmuch_query_count_threads_st (notmuch_query_t *query, unsigned *count)
+notmuch_query_count_threads (notmuch_query_t *query, unsigned *count)
 {
     notmuch_messages_t *messages;
     GHashTable *hash;
index 493be30f07bb2d93d0beae2af01d7cee3b956c62..cf80ee25a102fc4f469fc26ce50c85bf8096eb1e 100644 (file)
@@ -98,7 +98,7 @@ print_count (notmuch_database_t *notmuch, const char *query_str,
        printf ("%u", ucount);
        break;
     case OUTPUT_THREADS:
-       status = notmuch_query_count_threads_st (query, &ucount);
+       status = notmuch_query_count_threads (query, &ucount);
        if (print_status_query ("notmuch count", query, status))
            return -1;
        printf ("%u", ucount);
index 71218fdd41af11c711bd197854d80fbd01e8840a..30722e86f5680abbc5ffa0360c41806eb2499830 100644 (file)
@@ -123,7 +123,7 @@ do_search_threads (search_context_t *ctx)
     if (ctx->offset < 0) {
        unsigned count;
        notmuch_status_t status;
-       status = notmuch_query_count_threads_st (ctx->query, &count);
+       status = notmuch_query_count_threads (ctx->query, &count);
        if (print_status_query ("notmuch search", ctx->query, status))
            return 1;