]> git.cworth.org Git - notmuch/blobdiff - lib/config.cc
lib/config: add notmuch_config_get_values_string
[notmuch] / lib / config.cc
index f2060e281cea249c1ef06b7a6fe6d05732e10b00..24418f980d55aeabd48d58c736c549eb0122c66a 100644 (file)
@@ -261,13 +261,19 @@ _notmuch_config_load_from_database (notmuch_database_t *notmuch)
 notmuch_config_values_t *
 notmuch_config_get_values (notmuch_database_t *notmuch, notmuch_config_key_t key)
 {
-    notmuch_config_values_t *values = NULL;
-    bool ok = false;
-
     const char *key_str = _notmuch_config_key_to_string (key);
 
     if (! key_str)
-       goto DONE;
+       return NULL;
+
+    return notmuch_config_get_values_string (notmuch, key_str);
+}
+
+notmuch_config_values_t *
+notmuch_config_get_values_string (notmuch_database_t *notmuch, const char *key_str)
+{
+    notmuch_config_values_t *values = NULL;
+    bool ok = false;
 
     values = talloc (notmuch, notmuch_config_values_t);
     if (unlikely (! values))
@@ -410,6 +416,8 @@ _notmuch_config_key_to_string (notmuch_config_key_t key)
        return "database.mail_root";
     case NOTMUCH_CONFIG_HOOK_DIR:
        return "database.hook_dir";
+    case NOTMUCH_CONFIG_BACKUP_DIR:
+       return "database.backup_dir";
     case NOTMUCH_CONFIG_EXCLUDE_TAGS:
        return "search.exclude_tags";
     case NOTMUCH_CONFIG_NEW_TAGS:
@@ -453,6 +461,7 @@ _notmuch_config_default (notmuch_database_t *notmuch, notmuch_config_key_t key)
     case NOTMUCH_CONFIG_SYNC_MAILDIR_FLAGS:
        return "true";
     case NOTMUCH_CONFIG_HOOK_DIR:
+    case NOTMUCH_CONFIG_BACKUP_DIR:
     case NOTMUCH_CONFIG_NEW_IGNORE:
     case NOTMUCH_CONFIG_USER_NAME:
     case NOTMUCH_CONFIG_PRIMARY_EMAIL: