+
+const char **
+notmuch_config_get_new_tags (notmuch_config_t *config,
+ size_t *length)
+{
+ char **tags;
+ size_t tags_length;
+ unsigned int i;
+
+ if (config->new_tags == NULL) {
+ tags = g_key_file_get_string_list (config->key_file,
+ "new", "tags",
+ &tags_length, NULL);
+ if (tags) {
+ config->new_tags = talloc_size (config,
+ sizeof (char *) *
+ (tags_length + 1));
+ for (i = 0; i < tags_length; i++)
+ config->new_tags[i] = talloc_strdup (config->new_tags,
+ tags[i]);
+ config->new_tags[i] = NULL;
+
+ g_strfreev (tags);
+
+ config->new_tags_length = tags_length;
+ }
+ }
+
+ *length = config->new_tags_length;
+ return config->new_tags;
+}
+
+void
+notmuch_config_set_new_tags (notmuch_config_t *config,
+ const char *new_tags[],
+ size_t length)
+{
+ g_key_file_set_string_list (config->key_file,
+ "new", "tags",
+ new_tags, length);
+
+ talloc_free (config->new_tags);
+ config->new_tags = NULL;
+}
+