Keep track of whether the config is newly created, and add
notmuch_config_is_new() accessor function to query this.
This is to support anyone with a config handle to check this, instead
of just whoever called notmuch_config_open().
int
notmuch_config_save (notmuch_config_t *config);
+notmuch_bool_t
+notmuch_config_is_new (notmuch_config_t *config);
+
const char *
notmuch_config_get_database_path (notmuch_config_t *config);
struct _notmuch_config {
char *filename;
GKeyFile *key_file;
+ notmuch_bool_t is_new;
char *database_path;
char *user_name;
config->key_file = g_key_file_new ();
+ config->is_new = FALSE;
config->database_path = NULL;
config->user_name = NULL;
config->user_primary_email = NULL;
if (is_new_ret)
*is_new_ret = is_new;
+ config->is_new = is_new;
+
return config;
}
return 0;
}
+notmuch_bool_t
+notmuch_config_is_new (notmuch_config_t *config)
+{
+ return config->is_new;
+}
+
+
static const char **
_config_get_list (notmuch_config_t *config,
const char *section, const char *key,