[PATCH 3/4] ruby: Add wrapper for message_get_filenames
authorAli Polatel <alip@exherbo.org>
Mon, 10 Jan 2011 14:39:27 +0000 (16:39 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:41 +0000 (09:37 -0800)
09/96c5e309dd90dce47e772d578fc7530b70c080 [new file with mode: 0644]

diff --git a/09/96c5e309dd90dce47e772d578fc7530b70c080 b/09/96c5e309dd90dce47e772d578fc7530b70c080
new file mode 100644 (file)
index 0000000..f35e372
--- /dev/null
@@ -0,0 +1,118 @@
+Return-Path: <alip@exherbo.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 B529B431FB5\r
+       for <notmuch@notmuchmail.org>; Mon, 10 Jan 2011 06:39:29 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\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 2pW3-wjwqypr for <notmuch@notmuchmail.org>;\r
+       Mon, 10 Jan 2011 06:39:29 -0800 (PST)\r
+Received: from bach.exherbo.org (bach.exherbo.org [78.47.197.147])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 57A6742D283\r
+       for <notmuch@notmuchmail.org>; Mon, 10 Jan 2011 06:39:27 -0800 (PST)\r
+Received: from localhost ([127.0.0.1] helo=karatren.karatren.ev ident=alip)\r
+       by bach.exherbo.org with esmtpa (Exim 4.71)\r
+       (envelope-from <alip@exherbo.org>)\r
+       id 1PcIu0-0006iw-Pl; Mon, 10 Jan 2011 14:39:21 +0000\r
+Received: by karatren.karatren.ev (Postfix, from userid 1000)\r
+       id 69EB71BAA38; Mon, 10 Jan 2011 16:39:28 +0200 (EET)\r
+From: Ali Polatel <alip@exherbo.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 3/4] ruby: Add wrapper for message_get_filenames\r
+Date: Mon, 10 Jan 2011 16:39:27 +0200\r
+Message-Id:\r
+ <44ae5735aa93b3285405ed95e33b33ef640b01ef.1294669955.git.alip@exherbo.org>\r
+X-Mailer: git-send-email 1.7.3.5\r
+In-Reply-To: <cover.1294669955.git.alip@exherbo.org>\r
+References: <cover.1294669955.git.alip@exherbo.org>\r
+In-Reply-To: <cover.1294669955.git.alip@exherbo.org>\r
+References: <cover.1294669955.git.alip@exherbo.org>\r
+Organization: Pink Floyd\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, 10 Jan 2011 14:39:30 -0000\r
+\r
+---\r
+ bindings/ruby/defs.h    |    3 +++\r
+ bindings/ruby/init.c    |    1 +\r
+ bindings/ruby/message.c |   18 ++++++++++++++++++\r
+ 3 files changed, 22 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h\r
+index 1f52988..f00afef 100644\r
+--- a/bindings/ruby/defs.h\r
++++ b/bindings/ruby/defs.h\r
+@@ -269,6 +269,9 @@ VALUE\r
+ notmuch_rb_message_get_filename(VALUE self);\r
\r
+ VALUE\r
++notmuch_rb_message_get_filenames(VALUE self);\r
++\r
++VALUE\r
+ notmuch_rb_message_get_flag(VALUE self, VALUE flagv);\r
\r
+ VALUE\r
+diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c\r
+index 4a63ba0..aa09c8d 100644\r
+--- a/bindings/ruby/init.c\r
++++ b/bindings/ruby/init.c\r
+@@ -263,6 +263,7 @@ Init_notmuch(void)\r
+     rb_define_method(notmuch_rb_cMessage, "thread_id", notmuch_rb_message_get_thread_id, 0);\r
+     rb_define_method(notmuch_rb_cMessage, "replies", notmuch_rb_message_get_replies, 0);\r
+     rb_define_method(notmuch_rb_cMessage, "filename", notmuch_rb_message_get_filename, 0);\r
++    rb_define_method(notmuch_rb_cMessage, "filenames", notmuch_rb_message_get_filenames, 0);\r
+     rb_define_method(notmuch_rb_cMessage, "get_flag", notmuch_rb_message_get_flag, 1);\r
+     rb_define_method(notmuch_rb_cMessage, "set_flag", notmuch_rb_message_set_flag, 2);\r
+     rb_define_method(notmuch_rb_cMessage, "date", notmuch_rb_message_get_date, 0);\r
+diff --git a/bindings/ruby/message.c b/bindings/ruby/message.c\r
+index 1b2c01e..49dbace 100644\r
+--- a/bindings/ruby/message.c\r
++++ b/bindings/ruby/message.c\r
+@@ -111,6 +111,24 @@ notmuch_rb_message_get_filename(VALUE self)\r
+ }\r
\r
+ /*\r
++ * call-seq: MESSAGE.filanames => FILENAMES\r
++ *\r
++ * Get all filenames for the email corresponding to MESSAGE.\r
++ */\r
++VALUE\r
++notmuch_rb_message_get_filenames(VALUE self)\r
++{\r
++    notmuch_filenames_t *fnames;\r
++    notmuch_message_t *message;\r
++\r
++    Data_Get_Notmuch_Message(self, message);\r
++\r
++    fnames = notmuch_message_get_filenames(message);\r
++\r
++    return Data_Wrap_Struct(notmuch_rb_cFileNames, NULL, NULL, fnames);\r
++}\r
++\r
++/*\r
+  * call-seq: MESSAGE.get_flag(flag) => true or false\r
+  *\r
+  * Get a value of a flag for the email corresponding to 'message'\r
+-- \r
+1.7.3.5\r
+\r