go: Update for changes to notmuch_database_get_directory

This commit is contained in:
Austin Clements 2012-05-13 19:36:10 -04:00 committed by David Bremner
parent 7199d22f43
commit cdaf253c99

View 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) var c_path *C.char = C.CString(path)
defer C.free(unsafe.Pointer(c_path)) defer C.free(unsafe.Pointer(c_path))
if c_path == nil { if c_path == nil {
return nil return nil, STATUS_OUT_OF_MEMORY
} }
c_dir := C.notmuch_database_get_directory(self.db, c_path) var c_dir *C.notmuch_directory_t
if c_dir == nil { st := Status(C.notmuch_database_get_directory(self.db, c_path, &c_dir))
return nil 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.