From: David Bremner <david@tethera.net>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: [PATCH 6/6] lib: replace deprecated n_q_count_threads with status returning version
Date: Sun, 26 Feb 2017 17:21:35 -0400 [thread overview]
Message-ID: <20170226212135.4119-7-david@tethera.net> (raw)
In-Reply-To: <20170226212135.4119-1-david@tethera.net>
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 | 2 +-
bindings/ruby/query.c | 2 +-
lib/notmuch.h | 16 +++++++---------
lib/query.cc | 12 ++++--------
notmuch-count.c | 2 +-
notmuch-search.c | 2 +-
6 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/bindings/python/notmuch/query.py b/bindings/python/notmuch/query.py
index 10fb6dcc..06c7b11b 100644
--- a/bindings/python/notmuch/query.py
+++ b/bindings/python/notmuch/query.py
@@ -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
diff --git a/bindings/ruby/query.c b/bindings/ruby/query.c
index b6edaef3..8b46d700 100644
--- a/bindings/ruby/query.c
+++ b/bindings/ruby/query.c
@@ -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);
diff --git a/lib/notmuch.h b/lib/notmuch.h
index b79618f6..e692e9bb 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -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'.
diff --git a/lib/query.cc b/lib/query.cc
index 25b953c7..6c692e8e 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -612,18 +612,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;
diff --git a/notmuch-count.c b/notmuch-count.c
index 493be30f..cf80ee25 100644
--- a/notmuch-count.c
+++ b/notmuch-count.c
@@ -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);
diff --git a/notmuch-search.c b/notmuch-search.c
index 71218fdd..30722e86 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -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;
--
2.11.0
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 ` [PATCH 2/6] lib: replace n_query_search_threads with status returning version David Bremner
2017-02-26 21:21 ` [PATCH 3/6] lib: replace deprecated n_q_search_messages " 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 ` David Bremner [this message]
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-7-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).