From: David Bremner <david@tethera.net>
To: David Bremner <david@tethera.net>, 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 [thread overview]
Message-ID: <20170226212135.4119-3-david@tethera.net> (raw)
In-Reply-To: <20170226212135.4119-1-david@tethera.net>
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
next prev parent reply other threads:[~2017-02-26 21:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 1:46 [PATCH] lib: remove notmuch_query_{count,search}_{threads,messages} David Bremner
2017-02-25 19:26 ` [PATCH] lib: remove notmuch_query_{count, search}_{threads, messages} Jani Nikula
2017-02-25 20:06 ` David Bremner
2017-02-26 9:07 ` Tomi Ollila
2017-02-26 21:21 ` v2 remove notmuch_query_{count,search}_{threads,messages} David Bremner
2017-02-26 21:21 ` [PATCH 1/6] lib: bump SONAME to libnotmuch5 David Bremner
2017-03-22 11:53 ` David Bremner
2017-02-26 21:21 ` David Bremner [this message]
2017-02-26 21:21 ` [PATCH 3/6] lib: replace deprecated n_q_search_messages with status returning version David Bremner
2017-02-26 21:21 ` [PATCH 4/6] fixup! " David Bremner
2017-02-26 21:21 ` [PATCH 5/6] lib: replace deprecated n_q_count_messages " David Bremner
2017-02-26 21:21 ` [PATCH 6/6] lib: replace deprecated n_q_count_threads " David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170226212135.4119-3-david@tethera.net \
--to=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).