]> git.cworth.org Git - obsolete/notmuch-old/commit
lib/cli: Make notmuch_database_get_directory return a status code
authorAustin Clements <amdragon@MIT.EDU>
Sun, 13 May 2012 23:36:09 +0000 (19:36 -0400)
committerDavid Bremner <bremner@debian.org>
Tue, 15 May 2012 11:56:33 +0000 (08:56 -0300)
commit7199d22f4394abdf72ab791fc0aba2c697bf1209
tree0c374ee00423ce624b1e7136ccae48060ea9ba5d
parent8a810c485f53b274f49cee9b02c1f4321ec78823
lib/cli: Make notmuch_database_get_directory return a status code

Previously, notmuch_database_get_directory had no way to indicate how
it had failed.  This changes its prototype to return a status code and
set an out-argument to the retrieved directory, like similar functions
in the library API.  This does *not* change its currently broken
behavior of creating directory objects when they don't exist, but it
does document it and paves the way for fixing this.  Also, it can now
check for a read-only database and return
NOTMUCH_STATUS_READ_ONLY_DATABASE instead of crashing.

In the interest of atomicity, this also updates calls from the CLI so
that notmuch still compiles.
lib/database.cc
lib/notmuch.h
notmuch-new.c