[PATCH 6/7] go: Bind notmuch_database_find_message_by_filename
authorAdrien Bustany <adrien@bustany.org>
Wed, 18 Jul 2012 18:34:34 +0000 (21:34 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:23 +0000 (09:48 -0800)
21/0ce372d5689517a09993a45d2cd100cd8e6a62 [new file with mode: 0644]

diff --git a/21/0ce372d5689517a09993a45d2cd100cd8e6a62 b/21/0ce372d5689517a09993a45d2cd100cd8e6a62
new file mode 100644 (file)
index 0000000..f4e4f27
--- /dev/null
@@ -0,0 +1,102 @@
+Return-Path: <adrien@bustany.org>\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 6601B431FB6\r
+       for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 11:41:06 -0700 (PDT)\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 TSS4m52QqxwL for <notmuch@notmuchmail.org>;\r
+       Wed, 18 Jul 2012 11:41:05 -0700 (PDT)\r
+Received: from mail.bustany.org (bustany.org [176.31.244.208])\r
+       by olra.theworths.org (Postfix) with ESMTP id DF4DE431FBF\r
+       for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 11:41:04 -0700 (PDT)\r
+Received: from localhost.localdomain (91-158-2-79.elisa-laajakaista.fi\r
+       [91.158.2.79])\r
+       by mail.bustany.org (Postfix) with ESMTPSA id 7A71E1400D9\r
+       for <notmuch@notmuchmail.org>; Wed, 18 Jul 2012 20:37:09 +0200 (CEST)\r
+From: Adrien Bustany <adrien@bustany.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 6/7] go: Bind notmuch_database_find_message_by_filename\r
+Date: Wed, 18 Jul 2012 21:34:34 +0300\r
+Message-Id: <1342636475-16057-7-git-send-email-adrien@bustany.org>\r
+X-Mailer: git-send-email 1.7.7.6\r
+In-Reply-To: <1342636475-16057-1-git-send-email-adrien@bustany.org>\r
+References: <1342636475-16057-1-git-send-email-adrien@bustany.org>\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: Wed, 18 Jul 2012 18:41:06 -0000\r
+\r
+---\r
+ bindings/go/src/notmuch/notmuch.go |   39 ++++++++++++++++++++++++++++++++++++\r
+ 1 files changed, 39 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go\r
+index 384d5a5..be4cb8c 100644\r
+--- a/bindings/go/src/notmuch/notmuch.go\r
++++ b/bindings/go/src/notmuch/notmuch.go\r
+@@ -453,6 +453,45 @@ func (self *Database) FindMessage(message_id string) (*Message, Status) {\r
+       return createMessage(msg, nil), st\r
+ }\r
\r
++/* Find a message with the given filename.\r
++ *\r
++ * If the database contains a message with the given filename then, on\r
++ * successful return (NOTMUCH_STATUS_SUCCESS) '*message' will be initialized to\r
++ * a message object. The caller should call notmuch_message_destroy when done\r
++ * with the message.\r
++ *\r
++ * On any failure or when the message is not found, this function initializes\r
++ * '*message' to NULL. This means, when NOTMUCH_STATUS_SUCCESS is returned, the\r
++ * caller is supposed to check '*message' for NULL to find out whether the\r
++ * message with the given filename is found.\r
++ *\r
++ * Return value:\r
++ *\r
++ * NOTMUCH_STATUS_SUCCESS: Successful return, check '*message'\r
++ *\r
++ * NOTMUCH_STATUS_NULL_POINTER: The given 'message' argument is NULL\r
++ *\r
++ * NOTMUCH_STATUS_OUT_OF_MEMORY: Out of memory, creating the message object\r
++ *\r
++ * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred\r
++ */\r
++func (self *Database) FindMessageByFilename(filename string) (*Message, Status) {\r
++\r
++      var c_msg_filename *C.char = C.CString(filename)\r
++      defer C.free(unsafe.Pointer(c_msg_filename))\r
++\r
++      if c_msg_filename == nil {\r
++              return nil, STATUS_OUT_OF_MEMORY\r
++      }\r
++\r
++      var msg *C.notmuch_message_t\r
++      st := Status(C.notmuch_database_find_message_by_filename(self.db, c_msg_filename, &msg))\r
++      if st != STATUS_SUCCESS {\r
++              return nil, st\r
++      }\r
++      return createMessage(msg, nil), st\r
++}\r
++\r
+ /* Return a list of all tags found in the database.\r
+  *\r
+  * This function creates a list of all tags found in the database. The\r
+-- \r
+1.7.7.6\r
+\r