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