From 8cecf0ae927eae1dfb5ab2eef78f55e8e162a7f9 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sat, 7 Jul 2001 23:34:55 +0000 Subject: use of devdir command --- mixlib/mix_config.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'mixlib/mix_config.c') diff --git a/mixlib/mix_config.c b/mixlib/mix_config.c index d03e949..871af91 100644 --- a/mixlib/mix_config.c +++ b/mixlib/mix_config.c @@ -34,6 +34,7 @@ static const gchar *DEF_DIR_ = ".mdk"; static const gchar *AUTOSAVE_KEY_ = "Autosave"; static const gchar *AUTOSAVE_YES_ = "True"; static const gchar *AUTOSAVE_NO_ = "False"; +static const gchar *DEVICES_KEY_ = "DevicesDir"; /* the config type */ struct mix_config_t @@ -106,6 +107,14 @@ mix_config_delete (mix_config_t *config) g_free (config); } +/* get the config filename */ +const gchar * +mix_config_get_filename (const mix_config_t *config) +{ + g_return_val_if_fail (config != NULL, NULL); + return config->filename; +} + /* get a config item's value from its key */ const gchar * mix_config_get (const mix_config_t *config, const gchar *key) @@ -183,3 +192,20 @@ mix_config_is_autosave (const mix_config_t *config) return config->autosave; } +/* devices dir*/ +void +mix_config_set_devices_dir (mix_config_t *config, const gchar *dirname) +{ + g_return_if_fail (config != NULL); + g_return_if_fail (dirname != NULL); + if (mix_stat_dir (dirname, "devices")) + mix_config_update (config, DEVICES_KEY_, dirname); +} + +extern const gchar * +mix_config_get_devices_dir (const mix_config_t *config) +{ + g_return_val_if_fail (config != NULL, NULL); + return mix_config_get (config, DEVICES_KEY_); +} + -- cgit v1.2.3