summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/config.cc14
-rw-r--r--lib/notmuch.h17
2 files changed, 26 insertions, 5 deletions
diff --git a/lib/config.cc b/lib/config.cc
index 8bd3c35a..24418f98 100644
--- a/lib/config.cc
+++ b/lib/config.cc
@@ -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))
diff --git a/lib/notmuch.h b/lib/notmuch.h
index da556e50..dd3d06a1 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -2494,7 +2494,6 @@ notmuch_config_list_move_to_next (notmuch_config_list_t *config_list);
void
notmuch_config_list_destroy (notmuch_config_list_t *config_list);
-
/**
* Configuration keys known to libnotmuch
*/
@@ -2566,6 +2565,22 @@ notmuch_config_values_t *
notmuch_config_get_values (notmuch_database_t *notmuch, notmuch_config_key_t key);
/**
+ * Returns an iterator for a ';'-delimited list of configuration values
+ *
+ * These values reflect all configuration information given at the
+ * time the database was opened.
+ *
+ * @param[in] notmuch database
+ * @param[in] key configuration key
+ *
+ * @since libnotmuch 5.4 (notmuch 0.32)
+ *
+ * @retval NULL in case of error.
+ */
+notmuch_config_values_t *
+notmuch_config_get_values_string (notmuch_database_t *notmuch, const char *key);
+
+/**
* Is the given 'config_values' iterator pointing at a valid element.
*
* @param[in] values iterator