X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fnotmuch.h;h=5a5d99c0f750e2e7db2d824eea1c07263dc576e8;hp=4f384e58881faa7f1a0bc08a40550f45585ac808;hb=4922416cccb826483e8306461a15a7372e97d3ce;hpb=eea258c0c9386a5eecae48a98b552113a3584a7d diff --git a/lib/notmuch.h b/lib/notmuch.h index 4f384e58..5a5d99c0 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -212,6 +212,10 @@ typedef enum _notmuch_status { * Unable to load a config file */ NOTMUCH_STATUS_NO_CONFIG, + /** + * Database exists, so not (re)-created + */ + NOTMUCH_STATUS_DATABASE_EXISTS, /** * Not an actual status value. Just a way to find out how many * valid status values there are. @@ -438,6 +442,33 @@ notmuch_database_open_with_config (const char *database_path, const char *profile, notmuch_database_t **database, char **error_message); +/** + * Create a new notmuch database located at 'database_path', using + * configuration in 'config_path'. + * + * For description of arguments, @see notmuch_database_open_with_config + * + * @retval NOTMUCH_STATUS_SUCCESS: Successfully created the database. + * + * @retval NOTMUCH_STATUS_DATABASE_EXISTS: Database already exists, not created + * + * @retval NOTMUCH_STATUS_OUT_OF_MEMORY: Out of memory. + * + * @retval NOTMUCH_STATUS_FILE_ERROR: An error occurred trying to open the + * database or config file (such as permission denied, or file not found, + * etc.) + * + * @retval NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred. + * + * @since libnotmuch 5.4 (notmuch 0.32) + */ + +notmuch_status_t +notmuch_database_create_with_config (const char *database_path, + const char *config_path, + const char *profile, + notmuch_database_t **database, + char **error_message); /** * Retrieve last status string for given database. @@ -2429,6 +2460,7 @@ notmuch_config_list_destroy (notmuch_config_list_t *config_list); typedef enum _notmuch_config_key { NOTMUCH_CONFIG_FIRST, NOTMUCH_CONFIG_DATABASE_PATH = NOTMUCH_CONFIG_FIRST, + NOTMUCH_CONFIG_HOOK_DIR, NOTMUCH_CONFIG_EXCLUDE_TAGS, NOTMUCH_CONFIG_NEW_TAGS, NOTMUCH_CONFIG_NEW_IGNORE,