From 7852bd29a7011d1495d05050116e3ea986642cd8 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 7 Jun 2015 17:01:55 +0200 Subject: [PATCH] [PATCH 02/10] lib: deprecate notmuch_query_search_{threads, messages} --- 26/be56001df960300fbecefd0822cf94faef0879 | 126 ++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 26/be56001df960300fbecefd0822cf94faef0879 diff --git a/26/be56001df960300fbecefd0822cf94faef0879 b/26/be56001df960300fbecefd0822cf94faef0879 new file mode 100644 index 000000000..916e9c834 --- /dev/null +++ b/26/be56001df960300fbecefd0822cf94faef0879 @@ -0,0 +1,126 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 82A6B6DE1557 + for ; Sun, 7 Jun 2015 08:04:11 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.225 +X-Spam-Level: +X-Spam-Status: No, score=0.225 tagged_above=-999 required=5 tests=[AWL=0.215, + T_HEADER_FROM_DIFFERENT_DOMAINS=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 cz30srmcgHGM for ; + Sun, 7 Jun 2015 08:04:10 -0700 (PDT) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id D695F6DE15C9 + for ; Sun, 7 Jun 2015 08:04:09 -0700 (PDT) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.80) (envelope-from ) + id 1Z1c6f-0004ok-16; Sun, 07 Jun 2015 15:03:25 +0000 +Received: (nullmailer pid 7852 invoked by uid 1000); Sun, 07 Jun 2015 + 15:02:11 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH 02/10] lib: deprecate notmuch_query_search_{threads, messages} +Date: Sun, 7 Jun 2015 17:01:55 +0200 +Message-Id: <1433689323-7520-3-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1433689323-7520-1-git-send-email-david@tethera.net> +References: <1433689323-7520-1-git-send-email-david@tethera.net> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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, 07 Jun 2015 15:04:11 -0000 + +The CLI (and bindings) code should really be updated to use the new +status-code-returning versions. Here are some warnings to prod us (and +other clients) to do so. +--- + lib/notmuch.h | 41 ++++++++++++++++++++++++++--------------- + 1 file changed, 26 insertions(+), 15 deletions(-) + +diff --git a/lib/notmuch.h b/lib/notmuch.h +index 6a69f31..c2ada4b 100644 +--- a/lib/notmuch.h ++++ b/lib/notmuch.h +@@ -809,20 +809,25 @@ 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). + * +- * If a Xapian exception occurs this function will return NULL. +- * For better error reporting, use the _st variant. +- */ +-notmuch_threads_t * +-notmuch_query_search_threads (notmuch_query_t *query); +- +-/** +- * Like notmuch_query_search_threads, but with a status return. + */ + notmuch_status_t + notmuch_query_search_threads_st (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 Deprecated as of libnotmuch 4.3 (notmuch 0.21). Please ++ * use notmuch_query_search_threads_st instead. ++ * ++ */ ++NOTMUCH_DEPRECATED(4,3) ++notmuch_threads_t * ++notmuch_query_search_threads (notmuch_query_t *query); ++ ++/** + * Execute a query for messages, returning a notmuch_messages_t object + * which can be used to iterate over the results. The returned + * messages object is owned by the query and as such, will only be +@@ -860,17 +865,23 @@ notmuch_query_search_threads_st (notmuch_query_t *query, + * reason to call it if the query is about to be destroyed). + * + * If a Xapian exception occurs this function will return NULL. +- * For better error reporting, use the _st variant. +- */ +-notmuch_messages_t * +-notmuch_query_search_messages (notmuch_query_t *query); +- +-/** +- * Like notmuch_query_search_messages, but with a status return. ++ * + */ + notmuch_status_t + notmuch_query_search_messages_st (notmuch_query_t *query, + notmuch_messages_t **out); ++/** ++ * Like notmuch_query_search_messages, but without a status return. ++ * ++ * If a Xapian exception occurs this function will return NULL. ++ * ++ * @deprecated Deprecated as of libnotmuch 4.3 (notmuch 0.21). Please use ++ * notmuch_query_search_messages_st instead. ++ * ++ */ ++NOTMUCH_DEPRECATED(4,3) ++notmuch_messages_t * ++notmuch_query_search_messages (notmuch_query_t *query); + + /** + * Destroy a notmuch_query_t along with any associated resources. +-- +2.1.4 + -- 2.26.2