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 E140E431FAF for ; Sat, 28 Apr 2012 14:45:23 -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 s4yDpDqO8SYd for ; Sat, 28 Apr 2012 14:45:23 -0700 (PDT) Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id 4EB9B431FAE for ; Sat, 28 Apr 2012 14:45:23 -0700 (PDT) X-AuditID: 12074422-b7fd66d0000008f9-b6-4f9c64f23af2 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP id 8A.7D.02297.2F46C9F4; Sat, 28 Apr 2012 17:45:22 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q3SLjLAB005494; Sat, 28 Apr 2012 17:45:21 -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 q3SLjK9o005936 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 28 Apr 2012 17:45:21 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1SOFSB-0000X1-UQ; Sat, 28 Apr 2012 17:45:20 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH] go: Update to the current notmuch_database_find_message API Date: Sat, 28 Apr 2012 17:45:18 -0400 Message-Id: <1335649518-1970-1-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFIsWRmVeSWpSXmKPExsUixG6nrvspZY6/wZUVshbXb85kdmD0eLbq FnMAYxSXTUpqTmZZapG+XQJXxv0TtxgL2rgrzvy6ztzA+J+ji5GDQ0LARGLzTO8uRk4gU0zi wr31bF2MXBxCAvsYJZ6cucsM4WxglHjwezIjhHOfSeL610ksEM58Romlv9vZQfrZBDQktu1f zghiiwhIS+y8O5sVZAWzgJrEny4VkLCwgI/EmoOzmUFsFgFVibkzfrOB2LwC9hKdW9eyQ5yh IPFs3XGmCYy8CxgZVjHKpuRW6eYmZuYUpybrFicn5uWlFuma6uVmluilppRuYgQHgYvSDsaf B5UOMQpwMCrx8B5aP8tfiDWxrLgy9xCjJAeTkihvQfIcfyG+pPyUyozE4oz4otKc1OJDjBIc zEoivNriQDnelMTKqtSifJiUNAeLkjivutY7PyGB9MSS1OzU1ILUIpisDAeHkgQvEzDYhQSL UtNTK9Iyc0oQ0kwcnCDDeYCG/wNZzFtckJhbnJkOkT/FqCglzisJ0iwAksgozYPrhUXpK0Zx oFeEeblAqniAEQ7X/QpoMBPQYCbPWSCDSxIRUlINjH6Hb/Au3eIgqzr5pJNc+ML5G1XbFxl0 TpkYkLm/rHBVU3ykHqvDd1nfbrlZN14kzLw18VmUYcIuNdfr2xdF+8wrWst8u1L0Qtzu97sF vmTVcR6UE3p5L7NmW+jqV3whBdIT1PPNXVP2ZAQezkjceNp00fX+qUmnPNd9nM3V1bMpUGxm 3o6fDUosxRmJhlrMRcWJAAo+rJ2tAgAA 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 21:45:24 -0000 The signature of notmuch_database_find_message was changed in 02a30767 to report errors and the Go bindings were never updated. This brings the Go bindings in sync with that change and at least makes them compile with Go r60.3, the last release before Go 1. --- bindings/go/pkg/notmuch.go | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bindings/go/pkg/notmuch.go b/bindings/go/pkg/notmuch.go index c6844ef..8fe400b 100644 --- a/bindings/go/pkg/notmuch.go +++ b/bindings/go/pkg/notmuch.go @@ -306,20 +306,21 @@ func (self *Database) RemoveMessage(fname string) Status { * * An out-of-memory situation occurs * * A Xapian exception occurs */ -func (self *Database) FindMessage(message_id string) *Message { +func (self *Database) FindMessage(message_id string) (*Message, Status) { var c_msg_id *C.char = C.CString(message_id) defer C.free(unsafe.Pointer(c_msg_id)) if c_msg_id == nil { - return nil + return nil, STATUS_OUT_OF_MEMORY } - msg := C.notmuch_database_find_message(self.db, c_msg_id) - if msg == nil { - return nil + msg := &Message{message:nil} + st := Status(C.notmuch_database_find_message(self.db, c_msg_id, &msg.message)) + if st != STATUS_SUCCESS { + return nil, st } - return &Message{message:msg} + return msg, st } /* Return a list of all tags found in the database. -- 1.7.9.1