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 652F5431FB6 for ; Sun, 13 May 2012 12:57: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 0wbQhxGUu9uh for ; Sun, 13 May 2012 12:57:22 -0700 (PDT) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id 8B3A0431FAE for ; Sun, 13 May 2012 12:57:22 -0700 (PDT) X-AuditID: 1209190d-b7fbf6d0000008ba-a0-4fb012214999 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id DA.C9.02234.12210BF4; Sun, 13 May 2012 15:57:21 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q4DJvKdr007436; Sun, 13 May 2012 15:57:20 -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 q4DJvFSY022909 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 13 May 2012 15:57:16 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1STeup-0003eq-Pl; Sun, 13 May 2012 15:57:15 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 2/5] go: Update for changes to notmuch_database_get_directory Date: Sun, 13 May 2012 15:57:06 -0400 Message-Id: <1336939029-13969-3-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1336939029-13969-1-git-send-email-amdragon@mit.edu> References: <1336939029-13969-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsUixCmqrKsotMHfYM8zI4vZrT+YLG60djNa NE13trh+cyazxZuV81gdWD0Of13I4jHx/Gk2j1v3X7N7PFt1i9ljy6H3zAGsUVw2Kak5mWWp Rfp2CVwZs99PYS74wFcxc9Ej9gbGTTxdjJwcEgImEkt2TGCDsMUkLtxbD2RzcQgJ7GOU+Hl0 FguEs4FR4u7bG0wQzn0miR1nf0GVzWeU+P5iLStIP5uAhsS2/csZQWwRAWmJnXdns4IUMQt0 MUr8ftPMDJIQFvCVuLXlCFARBweLgKrEyfZkkDCvgIPE2r5z7BB3yEs8vd8HdhOngKPEsisL wVqFgGpOfvzLPIGRfwEjwypG2ZTcKt3cxMyc4tRk3eLkxLy81CJdI73czBK91JTSTYzgMJTk 3cH47qDSIUYBDkYlHt4Fouv9hVgTy4orcw8xSnIwKYnypglu8BfiS8pPqcxILM6ILyrNSS0+ xCjBwawkwrv+IVA5b0piZVVqUT5MSpqDRUmcV1XrnZ+QQHpiSWp2ampBahFMVoaDQ0mCNxdk qGBRanpqRVpmTglCmomDE2Q4D9DwFJAa3uKCxNzizHSI/ClGRSlxiGYBkERGaR5cLyxNvGIU B3pFmNcVpIoHmGLgul8BDWYCGswvsA5kcEkiQkqqgdF22f3NpXcOXXnwZaaI5PvyiN437up2 /o4dP7ct83gVY6pf+J27R7cyVELn9Z4Pdz8ExJuqP1u62c2r4NrJJIFu8/xld85XOUQlXvbV Tn62YtX+rTu8s7f94j8RFOWWesOYZZKXtnxoUpaT20tRt+Z8i8zcqZGauzbkvDOOWGdn9m+r 8JrTvEosxRmJhlrMRcWJAKvubZ/uAgAA Cc: tomi.ollila@iki.fi 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: Sun, 13 May 2012 19:57:23 -0000 --- bindings/go/src/notmuch/notmuch.go | 13 +++++++------ bindings/python/notmuch/database.py | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go index 12de4c8..00bd53a 100644 --- a/bindings/go/src/notmuch/notmuch.go +++ b/bindings/go/src/notmuch/notmuch.go @@ -191,19 +191,20 @@ func (self *Database) NeedsUpgrade() bool { * * Can return NULL if a Xapian exception occurs. */ -func (self *Database) GetDirectory(path string) *Directory { +func (self *Database) GetDirectory(path string) (*Directory, Status) { var c_path *C.char = C.CString(path) defer C.free(unsafe.Pointer(c_path)) if c_path == nil { - return nil + return nil, STATUS_OUT_OF_MEMORY } - c_dir := C.notmuch_database_get_directory(self.db, c_path) - if c_dir == nil { - return nil + var c_dir *C.notmuch_directory_t + st := Status(C.notmuch_database_get_directory(self.db, c_path, &c_dir)) + if st != STATUS_SUCCESS || c_dir == nil { + return nil, st } - return &Directory{dir: c_dir} + return &Directory{dir: c_dir}, st } /* Add a new message to the given notmuch database. diff --git a/bindings/python/notmuch/database.py b/bindings/python/notmuch/database.py index 1b1ddc3..0a58dd0 100644 --- a/bindings/python/notmuch/database.py +++ b/bindings/python/notmuch/database.py @@ -73,8 +73,8 @@ class Database(object): """notmuch_database_get_directory""" _get_directory = nmlib.notmuch_database_get_directory - _get_directory.argtypes = [NotmuchDatabaseP, c_char_p] - _get_directory.restype = NotmuchDirectoryP + _get_directory.argtypes = [NotmuchDatabaseP, c_char_p, POINTER(NotmuchDirectoryP)] + _get_directory.restype = c_uint """notmuch_database_get_path""" _get_path = nmlib.notmuch_database_get_path -- 1.7.10