Successfully opened the database.
The given 'path' argument is NULL.
Out of memory.
An error occurred trying to open the * database file (such as permission denied, or file not found, * etc.), or the database version is unknown.
A Xapian exception occurred.
Open an existing notmuch database located at 'path'.
The database should have been created at some time in the past, (not necessarily by this process), by calling notmuch_database_create with 'path'. By default the database should be opened for reading only. In order to write to the database you need to pass the NOTMUCH_DATABASE_MODE_READ_WRITE mode.
An existing notmuch database can be identified by the presence of a directory named ".notmuch" below 'path'.
The caller should call notmuch_database_destroy when finished with this database.
In case of any failure, this function returns an error status and sets *database to NULL (after printing an error message on stderr).
Return value: