]> git.notmuchmail.org Git - notmuch/commit
lib: Consolidate checks for read-only database.
authorCarl Worth <cworth@cworth.org>
Thu, 7 Jan 2010 18:19:44 +0000 (10:19 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 7 Jan 2010 18:19:44 +0000 (10:19 -0800)
commitf93b7218c3e2d11c5b3cdd4c367a42ca7a7ede77
tree7d1cd35cb6e21d2c1dbf3bf79799fbeb35ae6422
parent6ed606c19edfe06d2dfd48854fc97f8502eaaf7c
lib: Consolidate checks for read-only database.

Previously, many checks were deep in the library just before a cast
operation. These have now been replaced with internal errors and new
checks have instead been added at the beginning of all top-levelentry
points requiring a read-write database.

The new checks now also use a single function for checking and
printing the error message. This will give us a convenient location to
extend the check, (such as based on database version as well).
lib/database.cc
lib/directory.cc
lib/message.cc
lib/notmuch-private.h
lib/notmuch.h