aboutsummaryrefslogtreecommitdiffhomepage
path: root/bindings/go
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-05-13 19:36:10 -0400
committerGravatar David Bremner <bremner@debian.org>2012-05-15 08:58:36 -0300
commitcdaf253c9995fe00b096052ab85f0b8d5c010e7c (patch)
treee921a844c0b65cbb8cae2688e53df34ca3ce3ca6 /bindings/go
parent7199d22f4394abdf72ab791fc0aba2c697bf1209 (diff)
go: Update for changes to notmuch_database_get_directory
Diffstat (limited to 'bindings/go')
-rw-r--r--bindings/go/src/notmuch/notmuch.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go
index 12de4c8d..00bd53ac 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.