1 Return-Path: <bremner@tethera.net>
\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 arlo.cworth.org (Postfix) with ESMTP id 312BB6DE0274
\r
6 for <notmuch@notmuchmail.org>; Sun, 27 Sep 2015 08:34:29 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.108 tagged_above=-999 required=5 tests=[AWL=0.108]
\r
13 Received: from arlo.cworth.org ([127.0.0.1])
\r
14 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id WT0kDGxaax9O for <notmuch@notmuchmail.org>;
\r
16 Sun, 27 Sep 2015 08:34:27 -0700 (PDT)
\r
17 Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])
\r
18 by arlo.cworth.org (Postfix) with ESMTPS id 745966DE14F2
\r
19 for <notmuch@notmuchmail.org>; Sun, 27 Sep 2015 08:34:27 -0700 (PDT)
\r
20 Received: from remotemail by gitolite.debian.net with local (Exim 4.80)
\r
21 (envelope-from <bremner@tethera.net>)
\r
22 id 1ZgDxR-0008En-NC; Sun, 27 Sep 2015 15:33:45 +0000
\r
23 Received: (nullmailer pid 11947 invoked by uid 1000); Sun, 27 Sep 2015
\r
25 From: David Bremner <david@tethera.net>
\r
26 To: notmuch@notmuchmail.org
\r
27 Subject: [Patch v4 9/9] ruby: use new query_search API
\r
28 Date: Sun, 27 Sep 2015 12:32:03 -0300
\r
29 Message-Id: <1443367923-11867-10-git-send-email-david@tethera.net>
\r
30 X-Mailer: git-send-email 2.5.3
\r
31 In-Reply-To: <1443367923-11867-1-git-send-email-david@tethera.net>
\r
32 References: <1443367923-11867-1-git-send-email-david@tethera.net>
\r
33 X-BeenThere: notmuch@notmuchmail.org
\r
34 X-Mailman-Version: 2.1.18
\r
36 List-Id: "Use and development of the notmuch mail system."
\r
37 <notmuch.notmuchmail.org>
\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
39 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
41 List-Post: <mailto:notmuch@notmuchmail.org>
\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
45 X-List-Received-Date: Sun, 27 Sep 2015 15:34:29 -0000
\r
47 These changes should not be too surprising for users because the
\r
48 routines were already potentially throwing exceptions.
\r
50 bindings/ruby/query.c | 14 ++++++++------
\r
51 1 file changed, 8 insertions(+), 6 deletions(-)
\r
53 diff --git a/bindings/ruby/query.c b/bindings/ruby/query.c
\r
54 index f87700a..8cbc73f 100644
\r
55 --- a/bindings/ruby/query.c
\r
56 +++ b/bindings/ruby/query.c
\r
57 @@ -134,12 +134,13 @@ notmuch_rb_query_search_threads (VALUE self)
\r
59 notmuch_query_t *query;
\r
60 notmuch_threads_t *threads;
\r
61 + notmuch_status_t status;
\r
63 Data_Get_Notmuch_Query (self, query);
\r
65 - threads = notmuch_query_search_threads (query);
\r
67 - rb_raise (notmuch_rb_eMemoryError, "Out of memory");
\r
68 + status = notmuch_query_search_threads_st (query, &threads);
\r
70 + notmuch_rb_status_raise (status);
\r
72 return Data_Wrap_Struct (notmuch_rb_cThreads, NULL, NULL, threads);
\r
74 @@ -154,12 +155,13 @@ notmuch_rb_query_search_messages (VALUE self)
\r
76 notmuch_query_t *query;
\r
77 notmuch_messages_t *messages;
\r
78 + notmuch_status_t status;
\r
80 Data_Get_Notmuch_Query (self, query);
\r
82 - messages = notmuch_query_search_messages (query);
\r
84 - rb_raise (notmuch_rb_eMemoryError, "Out of memory");
\r
85 + status = notmuch_query_search_messages_st (query, &messages);
\r
87 + notmuch_rb_status_raise (status);
\r
89 return Data_Wrap_Struct (notmuch_rb_cMessages, NULL, NULL, messages);
\r