From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 2CD896DE2194 for ; Sun, 26 Feb 2017 13:22:15 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZTg5fa43stEa for ; Sun, 26 Feb 2017 13:22:14 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 6FBDB6DE2196 for ; Sun, 26 Feb 2017 13:22:06 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1ci6Fz-0000sQ-BJ; Sun, 26 Feb 2017 16:21:27 -0500 Received: (nullmailer pid 6575 invoked by uid 1000); Sun, 26 Feb 2017 21:21:57 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH 2/6] lib: replace n_query_search_threads with status returning version Date: Sun, 26 Feb 2017 17:21:31 -0400 Message-Id: <20170226212135.4119-3-david@tethera.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170226212135.4119-1-david@tethera.net> References: <20170223014656.9500-1-david@tethera.net> <20170226212135.4119-1-david@tethera.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2017 21:22:15 -0000 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 | 10 +++++----- bindings/ruby/query.c | 2 +- lib/notmuch.h | 20 +++++++++----------- lib/query.cc | 17 +++++------------ notmuch-search.c | 2 +- notmuch-show.c | 2 +- 6 files changed, 22 insertions(+), 31 deletions(-) diff --git a/bindings/python/notmuch/query.py b/bindings/python/notmuch/query.py index a0f4f64b..3419f626 100644 --- a/bindings/python/notmuch/query.py +++ b/bindings/python/notmuch/query.py @@ -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) diff --git a/bindings/ruby/query.c b/bindings/ruby/query.c index ce66926c..4b3f1c4f 100644 --- a/bindings/ruby/query.c +++ b/bindings/ruby/query.c @@ -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); diff --git a/lib/notmuch.h b/lib/notmuch.h index af4efbc8..601b2e3e 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -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 diff --git a/lib/query.cc b/lib/query.cc index 4ccd8104..d138f09b 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -432,22 +432,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; diff --git a/notmuch-search.c b/notmuch-search.c index 8c65d5ad..c6899ffa 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -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; diff --git a/notmuch-show.c b/notmuch-show.c index ab4ea1c2..3e87bfec 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -951,7 +951,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; -- 2.11.0