]> git.notmuchmail.org Git - notmuch/commitdiff
go: Update for changes to notmuch_database_get_directory
authorAustin Clements <amdragon@MIT.EDU>
Sun, 13 May 2012 23:36:10 +0000 (19:36 -0400)
committerDavid Bremner <bremner@debian.org>
Tue, 15 May 2012 11:58:36 +0000 (08:58 -0300)
bindings/go/src/notmuch/notmuch.go

index 12de4c8da0a39ce5634039e1ca69a70b3bedd2c0..00bd53acc3cab3f8866553ce4a3abe85a5ac6208 100644 (file)
@@ -191,19 +191,20 @@ func (self *Database) NeedsUpgrade() bool {
  *
  * Can return NULL if a Xapian exception occurs.
  */
  *
  * 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 {
        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.
 }
 
 /* Add a new message to the given notmuch database.