diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-04 18:21:41 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-04 18:21:41 (EDT) |
commit | 22c5a71045176d87fa833be04642256ffafa0f64 (patch) | |
tree | 1f8e0f40e05a83cea087d400d41a75d117a445c0 /src | |
parent | 2f6902ce85cab3f1fba0ad32b1e11707c4206f4c (diff) | |
download | marquee-22c5a71045176d87fa833be04642256ffafa0f64.zip marquee-22c5a71045176d87fa833be04642256ffafa0f64.tar.gz marquee-22c5a71045176d87fa833be04642256ffafa0f64.tar.bz2 |
mq_config_get_*(): Define
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 36 | ||||
-rw-r--r-- | src/config.h | 9 |
2 files changed, 45 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index d4de2af..b63e4a5 100644 --- a/src/config.c +++ b/src/config.c @@ -136,6 +136,42 @@ mq_config_save(MqConfig *config) NULL); } +gboolean +mq_config_get_boolean(MqConfig *config, const gchar *name) +{ + gchar *group; + gchar *key; + + split_name(name, &group, &key); + + /* TODO: Handle value parsing errors? */ + return g_key_file_get_boolean(config->key_file, group, key, NULL); +} + +gint +mq_config_get_integer(MqConfig *config, const gchar *name) +{ + gchar *group; + gchar *key; + + split_name(name, &group, &key); + + /* TODO: Handle value parsing errors? */ + return g_key_file_get_integer(config->key_file, group, key, NULL); +} + +gboolean +mq_config_get_double(MqConfig *config, const gchar *name) +{ + gchar *group; + gchar *key; + + split_name(name, &group, &key); + + /* TODO: Handle value parsing errors? */ + return g_key_file_get_double(config->key_file, group, key, NULL); +} + void mq_config_set_boolean(MqConfig *config, const gchar *name, gboolean value) { diff --git a/src/config.h b/src/config.h index 126e790..a5a7bdc 100644 --- a/src/config.h +++ b/src/config.h @@ -36,6 +36,15 @@ struct MqConfig { MqConfig * mq_config_new(const gchar *profile); +gboolean +mq_config_get_boolean(MqConfig *config, const gchar *name); + +gint +mq_config_get_integer(MqConfig *config, const gchar *name); + +gboolean +mq_config_get_double(MqConfig *config, const gchar *name); + void mq_config_set_boolean(MqConfig *config, const gchar *name, gboolean value); |