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 C5440431FC0 for ; Sun, 13 May 2012 16:36:24 -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 p3da1f3-rUrz for ; Sun, 13 May 2012 16:36:24 -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 72765431FBC for ; Sun, 13 May 2012 16:36:23 -0700 (PDT) X-AuditID: 12074424-b7fae6d000000906-87-4fb04576a1af Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id AC.DA.02310.67540BF4; Sun, 13 May 2012 19:36:22 -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 q4DNaLGQ025783; Sun, 13 May 2012 19:36: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 q4DNaKf7001097 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 13 May 2012 19:36:20 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1STiKq-0004YM-0o; Sun, 13 May 2012 19:36:20 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH v2 2/5] go: Update for changes to notmuch_database_get_directory Date: Sun, 13 May 2012 19:36:10 -0400 Message-Id: <1336952173-17422-3-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1336952173-17422-1-git-send-email-amdragon@mit.edu> References: <1336939029-13969-1-git-send-email-amdragon@mit.edu> <1336952173-17422-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsUixCmqrFvmusHfYPZRbovZrT+YLG60djNa NE13trh+cyazxZuV81gdWD0Of13I4jHx/Gk2j1v3X7N7PFt1i9ljy6H3zAGsUVw2Kak5mWWp Rfp2CVwZj5+8YymYxFmx/O80pgbGvexdjJwcEgImEk0vJkHZYhIX7q1nA7GFBPYxSrxaHtjF yAVkb2CU2LnoDAuEc59JYnbHMWYIZxajxJl5r1lAWtgENCS27V/OCGKLCEhL7Lw7mxWkiFmg i1Hi95tmZpCEsECAxL11R4EaODhYBFQlnh9QBwnzCjhIrFq2iQniDHmJp/f7wM7gFHCU6Hvw kR3ipHKJGe3XWSYw8i9gZFjFKJuSW6Wbm5iZU5yarFucnJiXl1qka66Xm1mil5pSuokRFITs Lio7GJsPKR1iFOBgVOLhnWS8wV+INbGsuDL3EKMkB5OSKC+TE1CILyk/pTIjsTgjvqg0J7X4 EKMEB7OSCO/6h+v9hXhTEiurUovyYVLSHCxK4rwaWu/8hATSE0tSs1NTC1KLYLIyHBxKErwP XICGChalpqdWpGXmlCCkmTg4QYbzAA3nBEatEG9xQWJucWY6RP4Uo6KUOO8VkGYBkERGaR5c LyxJvGIUB3pFmPcHSBUPMMHAdb8CGswENJhfYB3I4JJEhJRUA6PUmyjzH5FK7UZp0j/mVc3r 8vlnPFH5Vf9FwXpra01jx5WLyy/wXi5S6+1gOcGccOHvunc7T6svy3YonGY4ect7nfcXnV4s UWc/HKu9fOnWgz0mR7PUzLs8rBa6t81Kfb+mYYrGyZj6FwLTo2L96oxu3pnd+eeSiRDzWS/P 1P9+Aoeipe//b1JiKc5INNRiLipOBABufnpp7QIAAA== 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 23:36:25 -0000 --- bindings/go/src/notmuch/notmuch.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 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. -- 1.7.10