[PATCH] lib: update notmuch_tags_get example to reflect api change
authorAllan Wind <allan_wind@lifeintegrity.com>
Mon, 30 Jan 2012 20:35:44 +0000 (15:35 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:43 +0000 (09:43 -0800)
d1/d569fbcd6e72fe386289e904daf32ba8b254ae [new file with mode: 0644]

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