+static void
+_config_set_list (notmuch_config_t *config,
+ const char *group, const char *name,
+ const char *list[],
+ size_t length, const char ***config_var )
+{
+ g_key_file_set_string_list (config->key_file, group, name, list, length);
+
+ /* drop the cached value */
+ talloc_free (*config_var);
+ *config_var = NULL;
+}
+
+const char *
+notmuch_config_get_database_path (notmuch_config_t *config)
+{
+ return _config_get (config, &config->database_path, "database", "path");
+}
+
+void
+notmuch_config_set_database_path (notmuch_config_t *config,
+ const char *database_path)
+{
+ _config_set (config, &config->database_path, "database", "path", database_path);
+}
+
+const char *
+notmuch_config_get_user_name (notmuch_config_t *config)
+{
+ return _config_get (config, &config->user_name, "user", "name");
+}
+
+void
+notmuch_config_set_user_name (notmuch_config_t *config,
+ const char *user_name)
+{
+ _config_set (config, &config->user_name, "user", "name", user_name);
+}
+
+const char *
+notmuch_config_get_user_primary_email (notmuch_config_t *config)
+{
+ return _config_get (config, &config->user_primary_email, "user", "primary_email");
+}
+
+void
+notmuch_config_set_user_primary_email (notmuch_config_t *config,
+ const char *primary_email)
+{
+ _config_set (config, &config->user_primary_email, "user", "primary_email", primary_email);
+}
+