From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 267E46DE00DB for ; Tue, 8 Aug 2017 02:58:47 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.12 X-Spam-Level: X-Spam-Status: No, score=-0.12 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7HABrr8kzQSf for ; Tue, 8 Aug 2017 02:58:46 -0700 (PDT) Received: from mail-ua0-f181.google.com (mail-ua0-f181.google.com [209.85.217.181]) by arlo.cworth.org (Postfix) with ESMTPS id 136676DE00B4 for ; Tue, 8 Aug 2017 02:58:46 -0700 (PDT) Received: by mail-ua0-f181.google.com with SMTP id f9so12413247uaf.4 for ; Tue, 08 Aug 2017 02:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=yzvjpynQ/xQgFIrR61me1I6u3PIsbiPNnE3GhxNX+Jc=; b=JAV5JX/xEfdVxkp1EWqFyft13bbKcVU9Lfe1YkRut+ETVtIWnLT02Qs0/Olu6dBT78 3Vcao82/quKYxvVx166MC2gVZq2h1FJeUjhKpf87LEaIRikWF4D7vOdqm9ZdGLY1I/x4 9RvipTF10P4VNNT9T4jOZHFvPC70Reuq8G4aIUEGWdYvueL4dQD4j3i3ITaRlzEbsTA3 h2XI1Sv4aSLmelEhrD0OynxIBimXXJr2HafEp4AK5qt7nYctpKx7K4QiltpHP7qEtJ25 mao10M8euvFz39/qTrFpNU1Fje2CqZ6whBTZNIF/URKPrzXjWQ9cfEzOneA6onwHbenb F8ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=yzvjpynQ/xQgFIrR61me1I6u3PIsbiPNnE3GhxNX+Jc=; b=YVHTyv+IrNLQD5oysycS0OmIe3ZpUDq5zWwxvm7fbdgTcSckqkWDlzl2i+fb0HbrQ2 tWwkSmOnuiCpV2xmdmBKEU6ea24odrvyc6xamRqPcgkWqyNUjyPvJHuxDqZwM2MDJQmk g1lB7gKquwJFKFlaXIDo3MNflnCsc7cFVgpiy+2uUyx055DXRipAA7+dYKD7tXueyLN7 OdnIxrmBVEBQusAPohVXzQZ4ujsW2pCoIaTctgFt2EZtuYLRO2Cnw8u6HGR9UNLKPEIp LtmdRm4pyDc7YWKfnzwr+7MV02aE2HOt0c6l6AmOLfo8amRwKppnaw/iM+GR6Shtuwk6 BYhA== X-Gm-Message-State: AHYfb5hDBqOD6J8BnjBZ+/E2PqyGew3m0PB6cI9X+jMrKsRfBp5qdAEd rVNpEur6voGGFe6SXZ9RSY+j8E7cdmBPkfg= X-Received: by 10.159.59.223 with SMTP id y31mr2142677uah.115.1502186322300; Tue, 08 Aug 2017 02:58:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.60.80 with HTTP; Tue, 8 Aug 2017 02:58:41 -0700 (PDT) From: Kamil Klimkiewicz Date: Tue, 8 Aug 2017 11:58:41 +0200 Message-ID: Subject: [PATCH] go: update bindings to compile with notmuch 0.25 To: notmuch@notmuchmail.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Tue, 08 Aug 2017 09:58:47 -0000 Attached is a simple patch that fixes go bindings to compile with notmuch 0.25. Please note it doesn't change the go API, ie. go methods *don't* return Status values. I am not sure you also want to break go API with the update. If you do, I can update the patch to return go-idiomatic (*Messages, Status) tuple. --- contrib/go/src/notmuch/notmuch.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/contrib/go/src/notmuch/notmuch.go b/contrib/go/src/notmuch/notmuch.go index 2d684311..936f927c 100644 --- a/contrib/go/src/notmuch/notmuch.go +++ b/contrib/go/src/notmuch/notmuch.go @@ -455,11 +455,12 @@ func (self *Query) GetSort() Sort { * If a Xapian exception occurs this function will return NULL. */ func (self *Query) SearchThreads() *Threads { - threads := C.notmuch_query_search_threads(self.query) - if threads == nil { + var threads Threads + C.notmuch_query_search_threads(self.query, &threads.threads) + if threads.threads == nil { return nil } - return &Threads{threads: threads} + return &threads } /* Execute a query for messages, returning a notmuch_messages_t object @@ -501,11 +502,12 @@ func (self *Query) SearchThreads() *Threads { * If a Xapian exception occurs this function will return NULL. */ func (self *Query) SearchMessages() *Messages { - msgs := C.notmuch_query_search_messages(self.query) - if msgs == nil { + var messages Messages + C.notmuch_query_search_messages(self.query, &messages.messages) + if messages.messages == nil { return nil } - return &Messages{messages: msgs} + return &messages } /* Destroy a notmuch_query_t along with any associated resources. @@ -531,7 +533,9 @@ func (self *Query) Destroy() { * printing a message). */ func (self *Query) CountMessages() uint { - return uint(C.notmuch_query_count_messages(self.query)) + var count C.uint + C.notmuch_query_count_messages(self.query, &count) + return uint(count) } /* Is the given 'threads' iterator pointing at a valid thread. -- 2.14.0