Search
lxdream.org :: lxdream/src/config.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/config.c
changeset 1144:00dd49743974
prev1077:136fc24d17ef
next1296:30ecee61f811
author nkeynes
date Mon Nov 08 14:12:10 2010 +1000 (9 years ago)
permissions -rw-r--r--
last change Add boolean config type
file annotate diff log raw
1.1 --- a/src/config.c Wed Oct 07 17:53:56 2009 +1000
1.2 +++ b/src/config.c Mon Nov 08 14:12:10 2010 +1000
1.3 @@ -154,6 +154,21 @@
1.4 return group->params[key].value;
1.5 }
1.6
1.7 +gboolean lxdream_get_config_boolean_value( lxdream_config_group_t group, int key )
1.8 +{
1.9 + const gchar *value = lxdream_get_config_value(group, key);
1.10 + if( strcasecmp(value, "on") == 0 || strcasecmp(value, "true") == 0 ||
1.11 + strcasecmp(value, "yes") == 0 || strcasecmp(value, "1") == 0 ) {
1.12 + return TRUE;
1.13 + } else {
1.14 + return FALSE;
1.15 + }
1.16 +}
1.17 +
1.18 +gboolean lxdream_set_config_boolean_value( lxdream_config_group_t group, int key, gboolean value )
1.19 +{
1.20 + return lxdream_set_config_value(group, key, value ? "on" : "off");
1.21 +}
1.22
1.23 gboolean lxdream_set_config_value( lxdream_config_group_t group, int key, const gchar *value )
1.24 {
.