From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A71AA431FC3 for ; Sat, 28 Apr 2012 15:18:00 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 v0tC0wCY0DtJ for ; Sat, 28 Apr 2012 15:18:00 -0700 (PDT) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by olra.theworths.org (Postfix) with ESMTP id A9BB2431FB6 for ; Sat, 28 Apr 2012 15:17:59 -0700 (PDT) X-AuditID: 12074424-b7fae6d000000906-de-4f9c6c977d77 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 35.EE.02310.79C6C9F4; Sat, 28 Apr 2012 18:17:59 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q3SMHw9v005267; Sat, 28 Apr 2012 18:17:58 -0400 Received: from drake.mit.edu (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3SMHvCa008923 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 28 Apr 2012 18:17:58 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1SOFxl-00058P-Jl; Sat, 28 Apr 2012 18:17:57 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 5/6] ruby: Update Ruby bindings for new notmuch_database_{open, create} signatures Date: Sat, 28 Apr 2012 18:17:52 -0400 Message-Id: <1335651473-19652-6-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1335651473-19652-1-git-send-email-amdragon@mit.edu> References: <1335651473-19652-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsUixCmqrTs9Z46/wco1ChbXb85kdmD0eLbq FnMAYxSXTUpqTmZZapG+XQJXxo0H21gKGjkrThzazdLA2MfexcjJISFgItH25TozhC0mceHe erYuRi4OIYF9jBInd+xngXA2MErs2LebFcK5zyTRuWo5I4Qzn1Hiz9xLYP1sAhoS2/aDJDg5 RASkJXbenQ3UwcHBLKAm8adLBcQUFkiUaDseA1LBIqAqsbFtAtgVvAIOEhMuHWeDuEJB4tm6 40wgNqeAo8T/zSfAaoSAajrmTWCbwMi/gJFhFaNsSm6Vbm5iZk5xarJucXJiXl5qka65Xm5m iV5qSukmRlDQsLuo7GBsPqR0iFGAg1GJh3dX1hx/IdbEsuLK3EOMkhxMSqK8LCAhvqT8lMqM xOKM+KLSnNTiQ4wSHMxKIrza4kA53pTEyqrUonyYlDQHi5I4r4bWOz8hgfTEktTs1NSC1CKY rAwHh5IEb2s2UKNgUWp6akVaZk4JQpqJgxNkOA/Q8D0gNbzFBYm5xZnpEPlTjIpS4rzrQRIC IImM0jy4XlhUv2IUB3pFmHc6SBUPMCHAdb8CGswENJjJcxbI4JJEhJRUA6N4Y+Kzmy+MqnaF +l13+x0RVPcmt5i9uV7gd+lEzuQysSuKH0+p6Pp0fDESlK21mFk5VdPr2u6rL8/V5mtOkph+ /fm7xOnFJv+/llo0tPrd33SQ6fODL/mfldLMdHqY22eylJpXq/IUXls9LZZviY6s9YaupJNH Ll0PzbydVVX44Vh7cU1QuBJLcUaioRZzUXEiAF8tiHfFAgAA 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: Sat, 28 Apr 2012 22:18:00 -0000 --- bindings/ruby/database.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c index ba9a139..409d54f 100644 --- a/bindings/ruby/database.c +++ b/bindings/ruby/database.c @@ -42,6 +42,8 @@ notmuch_rb_database_initialize (int argc, VALUE *argv, VALUE self) int create, mode; VALUE pathv, hashv; VALUE modev; + notmuch_database_t *database; + notmuch_status_t ret; /* Check arguments */ rb_scan_args (argc, argv, "11", &pathv, &hashv); @@ -73,9 +75,13 @@ notmuch_rb_database_initialize (int argc, VALUE *argv, VALUE self) } Check_Type (self, T_DATA); - DATA_PTR (self) = create ? notmuch_database_create (path) : notmuch_database_open (path, mode); - if (!DATA_PTR (self)) - rb_raise (notmuch_rb_eDatabaseError, "Failed to open database"); + if (create) + ret = notmuch_database_create (path, &database); + else + ret = notmuch_database_open (path, mode, &database); + notmuch_rb_status_raise (ret); + + DATA_PTR (self) = database; return self; } -- 1.7.9.1