1 Return-Path: <alip@exherbo.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id C4B8A42D281
\r
6 for <notmuch@notmuchmail.org>; Mon, 10 Jan 2011 06:39:28 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id D4sGvJf0zs1T for <notmuch@notmuchmail.org>;
\r
17 Mon, 10 Jan 2011 06:39:27 -0800 (PST)
\r
18 Received: from bach.exherbo.org (bach.exherbo.org [78.47.197.147])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 45F61431FB6
\r
22 for <notmuch@notmuchmail.org>; Mon, 10 Jan 2011 06:39:27 -0800 (PST)
\r
23 Received: from localhost ([127.0.0.1] helo=karatren.karatren.ev ident=alip)
\r
24 by bach.exherbo.org with esmtpa (Exim 4.71)
\r
25 (envelope-from <alip@exherbo.org>)
\r
26 id 1PcIu0-0006iu-N4; Mon, 10 Jan 2011 14:39:21 +0000
\r
27 Received: by karatren.karatren.ev (Postfix, from userid 1000)
\r
28 id 5E5101BA628; Mon, 10 Jan 2011 16:39:28 +0200 (EET)
\r
29 From: Ali Polatel <alip@exherbo.org>
\r
30 To: notmuch@notmuchmail.org
\r
31 Subject: [PATCH 1/4] ruby: Add wrappers for query_get_s{ort,tring}
\r
32 Date: Mon, 10 Jan 2011 16:39:25 +0200
\r
34 <5eeb10ab65e90dd09705c6d2f5dcd7a154601eb9.1294669955.git.alip@exherbo.org>
\r
35 X-Mailer: git-send-email 1.7.3.5
\r
36 In-Reply-To: <cover.1294669955.git.alip@exherbo.org>
\r
37 References: <cover.1294669955.git.alip@exherbo.org>
\r
38 In-Reply-To: <cover.1294669955.git.alip@exherbo.org>
\r
39 References: <cover.1294669955.git.alip@exherbo.org>
\r
40 Organization: Pink Floyd
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Mon, 10 Jan 2011 14:39:29 -0000
\r
56 notmuch_query_get_sort(): QUERY.sort
\r
57 notmuch_query_get_query_string(): QUERY.to_s
\r
59 bindings/ruby/defs.h | 6 ++++++
\r
60 bindings/ruby/init.c | 2 ++
\r
61 bindings/ruby/query.c | 30 ++++++++++++++++++++++++++++++
\r
62 3 files changed, 38 insertions(+), 0 deletions(-)
\r
64 diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h
\r
65 index b1be5a3..db53096 100644
\r
66 --- a/bindings/ruby/defs.h
\r
67 +++ b/bindings/ruby/defs.h
\r
68 @@ -190,9 +190,15 @@ VALUE
\r
69 notmuch_rb_query_destroy(VALUE self);
\r
72 +notmuch_rb_query_get_sort(VALUE self);
\r
75 notmuch_rb_query_set_sort(VALUE self, VALUE sortv);
\r
78 +notmuch_rb_query_get_string(VALUE self);
\r
81 notmuch_rb_query_search_threads(VALUE self);
\r
84 diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c
\r
85 index e19b035..63ab205 100644
\r
86 --- a/bindings/ruby/init.c
\r
87 +++ b/bindings/ruby/init.c
\r
88 @@ -224,7 +224,9 @@ Init_notmuch(void)
\r
89 notmuch_rb_cQuery = rb_define_class_under(mod, "Query", rb_cData);
\r
90 rb_undef_method(notmuch_rb_cQuery, "initialize");
\r
91 rb_define_method(notmuch_rb_cQuery, "destroy", notmuch_rb_query_destroy, 0);
\r
92 + rb_define_method(notmuch_rb_cQuery, "sort", notmuch_rb_query_get_sort, 0);
\r
93 rb_define_method(notmuch_rb_cQuery, "sort=", notmuch_rb_query_set_sort, 1);
\r
94 + rb_define_method(notmuch_rb_cQuery, "to_s", notmuch_rb_query_get_string, 0);
\r
95 rb_define_method(notmuch_rb_cQuery, "search_threads", notmuch_rb_query_search_threads, 0);
\r
96 rb_define_method(notmuch_rb_cQuery, "search_messages", notmuch_rb_query_search_messages, 0);
\r
98 diff --git a/bindings/ruby/query.c b/bindings/ruby/query.c
\r
99 index c5b8a4c..ef9e1a0 100644
\r
100 --- a/bindings/ruby/query.c
\r
101 +++ b/bindings/ruby/query.c
\r
102 @@ -39,6 +39,21 @@ notmuch_rb_query_destroy(VALUE self)
\r
106 + * call-seq: QUERY.sort => fixnum
\r
108 + * Get sort type of the +QUERY+
\r
111 +notmuch_rb_query_get_sort(VALUE self)
\r
113 + notmuch_query_t *query;
\r
115 + Data_Get_Notmuch_Query(self, query);
\r
117 + return FIX2INT(notmuch_query_get_sort(query));
\r
121 * call-seq: QUERY.sort=(fixnum) => nil
\r
123 * Set sort type of the +QUERY+
\r
124 @@ -59,6 +74,21 @@ notmuch_rb_query_set_sort(VALUE self, VALUE sortv)
\r
128 + * call-seq: QUERY.to_s => string
\r
130 + * Get query string of the +QUERY+
\r
133 +notmuch_rb_query_get_string(VALUE self)
\r
135 + notmuch_query_t *query;
\r
137 + Data_Get_Notmuch_Query(self, query);
\r
139 + return rb_str_new2(notmuch_query_get_query_string(query));
\r
143 * call-seq: QUERY.search_threads => THREADS
\r
145 * Search for threads
\r