unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] go: Update to the current notmuch_database_find_message API
@ 2012-04-28 21:45 Austin Clements
  2012-04-30 11:53 ` David Bremner
  2012-05-04 11:56 ` David Bremner
  0 siblings, 2 replies; 21+ messages in thread
From: Austin Clements @ 2012-04-28 21:45 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2012-05-11 11:48 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-28 21:45 [PATCH] go: Update to the current notmuch_database_find_message API Austin Clements
2012-04-30 11:53 ` David Bremner
2012-04-30 19:54   ` Justus Winter
2012-04-30 19:55     ` [PATCH 1/5] go: reorganize the go bindings Justus Winter
2012-04-30 19:55       ` [PATCH 2/5] go: set LDFLAGS, fix include directive Justus Winter
2012-04-30 19:55       ` [PATCH 3/5] go: update the addrlookup utility to go 1 Justus Winter
2012-04-30 19:55       ` [PATCH 4/5] go: update the build system Justus Winter
2012-04-30 19:55       ` [PATCH 5/5] go: format the souce code using gofmt Justus Winter
2012-05-04 18:38       ` [PATCH 1/5] go: reorganize the go bindings Austin Clements
2012-05-04 18:43         ` Austin Clements
2012-05-05 11:15           ` Justus Winter
2012-05-09 11:15             ` [patch v2] update the go stuff to go 1 Justus Winter
2012-05-09 11:15               ` [PATCH 1/5] go: reorganize the go bindings Justus Winter
2012-05-09 11:15               ` [PATCH 2/5] go: set LDFLAGS to -lnotmuch in the packages source file Justus Winter
2012-05-09 11:15               ` [PATCH 3/5] go: update the addrlookup utility to go 1 Justus Winter
2012-05-09 11:15               ` [PATCH 4/5] go: update the build system Justus Winter
2012-05-09 11:15               ` [PATCH 5/5] go: format the souce code using gofmt Justus Winter
2012-05-09 18:10               ` [patch v2] update the go stuff to go 1 Austin Clements
2012-05-11 11:48               ` David Bremner
2012-04-30 20:14     ` [PATCH] go: Update to the current notmuch_database_find_message API Sebastien Binet
2012-05-04 11:56 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).