From 9bccdb3d8bc0d3c67cb42ac1b1c69f4c482f624f Mon Sep 17 00:00:00 2001 From: Ali Polatel Date: Mon, 26 Nov 2012 18:23:16 +0200 Subject: [PATCH] Re: [PATCH 6/6] ruby: Add bindings for notmuch_thread_get_messages --- 1e/2234949b129831318c3f4aeefe6915bf6b40e1 | 170 ++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 1e/2234949b129831318c3f4aeefe6915bf6b40e1 diff --git a/1e/2234949b129831318c3f4aeefe6915bf6b40e1 b/1e/2234949b129831318c3f4aeefe6915bf6b40e1 new file mode 100644 index 000000000..6fe8a0de3 --- /dev/null +++ b/1e/2234949b129831318c3f4aeefe6915bf6b40e1 @@ -0,0 +1,170 @@ +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 46D98431FAF + for ; Mon, 26 Nov 2012 08:23:05 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 JCBtJORwRxJV for ; + Mon, 26 Nov 2012 08:23:04 -0800 (PST) +Received: from mail-ea0-f181.google.com (mail-ea0-f181.google.com + [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8ED41431FAE + for ; Mon, 26 Nov 2012 08:23:04 -0800 (PST) +Received: by mail-ea0-f181.google.com with SMTP id k14so3538249eaa.26 + for ; Mon, 26 Nov 2012 08:23:03 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=date:from:to:cc:subject:message-id:mail-followup-to:references + :mime-version:content-type:content-disposition:in-reply-to + :organization:user-agent; + bh=WRDaEOn0RbNdxEl9RvnCxl+1ggQSwz5b1SR5HTTJ7Hw=; + b=rmb2rjgk6gDoWAW1KMNxZpd2ewyJgQzz2LTSoj2H/ZXrrj49UdS9bDVD+kMlFrnSv3 + WcvsG4atv68Ber/1TT3wWHX15O+nV48/18msiddsks05yxy6aROf9j7V+y8MsuQ5P7XO + LM9kgchHg+Zgt3kDxBwDsG8bKNK6yKZ3n8H2SWapfuDIJZ8r6LbmhrUFR072hDyCuFu/ + SbP3h+cAv4Ataddl1AdtnRdVN4i7bdY7AqXzNOId3NbokZ8eJ4DbIrq64aA2BS5m/ov9 + h0IagjelYOhH3FzY3cACUaSCS3VepEwRJ6tTzZM8WicT0uy4E2pMBS/7mwzFgZTkK7HD + HvDA== +Received: by 10.14.205.65 with SMTP id i41mr47519406eeo.2.1353946983405; + Mon, 26 Nov 2012 08:23:03 -0800 (PST) +Received: from localhost ([88.233.27.222]) + by mx.google.com with ESMTPS id b2sm3544616eep.9.2012.11.26.08.23.01 + (version=TLSv1/SSLv3 cipher=OTHER); + Mon, 26 Nov 2012 08:23:01 -0800 (PST) +Date: Mon, 26 Nov 2012 18:23:16 +0200 +From: Ali Polatel +To: Austin Clements +Subject: Re: [PATCH 6/6] ruby: Add bindings for notmuch_thread_get_messages +Message-ID: <20121126162316.GB5669@hayalet> +Mail-Followup-To: Austin Clements , notmuch@notmuchmail.org +References: <1353819427-13182-1-git-send-email-amdragon@mit.edu> + <1353819427-13182-7-git-send-email-amdragon@mit.edu> +MIME-Version: 1.0 +Content-Type: multipart/signed; micalg=pgp-sha1; + protocol="application/pgp-signature"; boundary="LpQ9ahxlCli8rRTG" +Content-Disposition: inline +In-Reply-To: <1353819427-13182-7-git-send-email-amdragon@mit.edu> +Organization: Pink Floyd +User-Agent: Mutt/1.5.21 (2011-07-01) +Cc: notmuch@notmuchmail.org +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, 26 Nov 2012 16:23:05 -0000 + + +--LpQ9ahxlCli8rRTG +Content-Type: text/plain; charset=us-ascii; format=flowed +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +LGTM. Thanks for showing love to the ruby bindings as I was away. + +On Sat, Nov 24, 2012 at 11:57:07PM -0500, Austin Clements wrote: +>--- +> bindings/ruby/defs.h | 3 +++ +> bindings/ruby/init.c | 1 + +> bindings/ruby/thread.c | 20 ++++++++++++++++++++ +> 3 files changed, 24 insertions(+) +> +>diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h +>index fe81b3f..5b44585 100644 +>--- a/bindings/ruby/defs.h +>+++ b/bindings/ruby/defs.h +>@@ -262,6 +262,9 @@ VALUE +> notmuch_rb_thread_get_toplevel_messages (VALUE self); +> +> VALUE +>+notmuch_rb_thread_get_messages (VALUE self); +>+ +>+VALUE +> notmuch_rb_thread_get_matched_messages (VALUE self); +> +> VALUE +>diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c +>index f4931d3..663271d 100644 +>--- a/bindings/ruby/init.c +>+++ b/bindings/ruby/init.c +>@@ -306,6 +306,7 @@ Init_notmuch (void) +> rb_define_method (notmuch_rb_cThread, "thread_id", notmuch_rb_thread_= +get_thread_id, 0); /* in thread.c */ +> rb_define_method (notmuch_rb_cThread, "total_messages", notmuch_rb_th= +read_get_total_messages, 0); /* in thread.c */ +> rb_define_method (notmuch_rb_cThread, "toplevel_messages", notmuch_rb= +_thread_get_toplevel_messages, 0); /* in thread.c */ +>+ rb_define_method (notmuch_rb_cThread, "messages", notmuch_rb_thread_g= +et_messages, 0); /* in thread.c */ +> rb_define_method (notmuch_rb_cThread, "matched_messages", notmuch_rb_= +thread_get_matched_messages, 0); /* in thread.c */ +> rb_define_method (notmuch_rb_cThread, "authors", notmuch_rb_thread_ge= +t_authors, 0); /* in thread.c */ +> rb_define_method (notmuch_rb_cThread, "subject", notmuch_rb_thread_ge= +t_subject, 0); /* in thread.c */ +>diff --git a/bindings/ruby/thread.c b/bindings/ruby/thread.c +>index efe5aaf..56616d9 100644 +>--- a/bindings/ruby/thread.c +>+++ b/bindings/ruby/thread.c +>@@ -92,6 +92,26 @@ notmuch_rb_thread_get_toplevel_messages (VALUE self) +> } +> +> /* +>+ * call-seq: THREAD.messages =3D> MESSAGES +>+ * +>+ * Get a Notmuch::Messages iterator for the all messages in thread. +>+ */ +>+VALUE +>+notmuch_rb_thread_get_messages (VALUE self) +>+{ +>+ notmuch_messages_t *messages; +>+ notmuch_thread_t *thread; +>+ +>+ Data_Get_Notmuch_Thread (self, thread); +>+ +>+ messages =3D notmuch_thread_get_messages (thread); +>+ if (!messages) +>+ rb_raise (notmuch_rb_eMemoryError, "Out of memory"); +>+ +>+ return Data_Wrap_Struct (notmuch_rb_cMessages, NULL, NULL, messages); +>+} +>+ +>+/* +> * call-seq: THREAD.matched_messages =3D> fixnum +> * +> * Get the number of messages in thread that matched the search +>--=20 +>1.7.10.4 +> +>_______________________________________________ +>notmuch mailing list +>notmuch@notmuchmail.org +>http://notmuchmail.org/mailman/listinfo/notmuch + +--LpQ9ahxlCli8rRTG +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.19 (GNU/Linux) + +iEYEARECAAYFAlCzl3QACgkQQU4yORhF8iCwrQCfbbu4SuiAV6UrlY9W57pG5lgP +IBoAoLwV0vDAS8RnHZoZeRz7Sgm+NMAL +=Lq/e +-----END PGP SIGNATURE----- + +--LpQ9ahxlCli8rRTG-- -- 2.26.2