From 9974eb3d4518f5a72f43d4a70e71b6dd53e91eb2 Mon Sep 17 00:00:00 2001 From: Allan Wind Date: Tue, 31 Jan 2012 15:35:44 +1900 Subject: [PATCH 1/1] [PATCH] lib: update notmuch_tags_get example to reflect api change --- d1/d569fbcd6e72fe386289e904daf32ba8b254ae | 93 +++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 d1/d569fbcd6e72fe386289e904daf32ba8b254ae diff --git a/d1/d569fbcd6e72fe386289e904daf32ba8b254ae b/d1/d569fbcd6e72fe386289e904daf32ba8b254ae new file mode 100644 index 000000000..287b96e19 --- /dev/null +++ b/d1/d569fbcd6e72fe386289e904daf32ba8b254ae @@ -0,0 +1,93 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 917AC431E64 + for ; Mon, 30 Jan 2012 12:35:45 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 5hv-kfrUVvT2 for ; + Mon, 30 Jan 2012 12:35:45 -0800 (PST) +Received: from pawan.lifeintegrity.com (lifeintegrity.com [173.48.39.13]) + by olra.theworths.org (Postfix) with ESMTP id 1D74D431FBC + for ; Mon, 30 Jan 2012 12:35:45 -0800 (PST) +Received: from vent.lifeintegrity.com + (173-162-190-62-NewEngland.hfc.comcastbusiness.net [173.162.190.62]) + by submission.lifeintegrity.com (Postfix) with ESMTPS id 50F111F8 + for ; Mon, 30 Jan 2012 20:35:44 +0000 (UTC) +Received: by vent.lifeintegrity.com (Postfix, from userid 1000) + id 0C00018284E; Mon, 30 Jan 2012 20:35:44 +0000 (UTC) +From: Allan Wind +To: notmuch@notmuchmail.org +Subject: [PATCH] lib: update notmuch_tags_get example to reflect api change +Date: Mon, 30 Jan 2012 15:35:44 -0500 +Message-Id: <1327955744-13031-1-git-send-email-allan_wind@lifeintegrity.com> +X-Mailer: git-send-email 1.7.2.5 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Mon, 30 Jan 2012 20:35:45 -0000 + +The function notmuch_database_find_message_by_filename now requires a +notmuch_message_t and returns a notmuch_status_t. This +change was introduced with 02a3076711, LIBNOTMUCH_VERSION_MAJOR = 2, +version 0.9. +--- + lib/notmuch.h | 21 +++++++++++---------- + 1 files changed, 11 insertions(+), 10 deletions(-) + +diff --git a/lib/notmuch.h b/lib/notmuch.h +index 7929fe7..5e6e449 100644 +--- a/lib/notmuch.h ++++ b/lib/notmuch.h +@@ -941,21 +941,22 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header); + * Typical usage might be: + * + * notmuch_message_t *message; ++ * notmuch_status_t status; + * notmuch_tags_t *tags; + * const char *tag; + * +- * message = notmuch_database_find_message (database, message_id); +- * +- * for (tags = notmuch_message_get_tags (message); +- * notmuch_tags_valid (tags); +- * notmuch_result_move_to_next (tags)) +- * { +- * tag = notmuch_tags_get (tags); +- * .... ++ * status = notmuch_database_find_message (database, message_id, &message); ++ * if (!status && message) { ++ * for (tags = notmuch_message_get_tags (message); ++ * notmuch_tags_valid (tags); ++ * notmuch_result_move_to_next (tags)) ++ * { ++ * tag = notmuch_tags_get (tags); ++ * .... ++ * } ++ * notmuch_message_destroy (message); + * } + * +- * notmuch_message_destroy (message); +- * + * Note that there's no explicit destructor needed for the + * notmuch_tags_t object. (For consistency, we do provide a + * notmuch_tags_destroy function, but there's no good reason to call +-- +1.7.2.5 + -- 2.26.2