Search
lxdream.org :: lxdream/src/config.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/config.c
changeset 458:cbb2dd12daeb
prev450:207461e79f21
next460:a0c865b74c63
author nkeynes
date Mon Oct 22 21:12:54 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Add set value by name method
file annotate diff log raw
1.1 --- a/src/config.c Wed Oct 17 11:26:45 2007 +0000
1.2 +++ b/src/config.c Mon Oct 22 21:12:54 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: config.c,v 1.1 2007-10-17 11:26:45 nkeynes Exp $
1.6 + * $Id: config.c,v 1.2 2007-10-22 21:12:54 nkeynes Exp $
1.7 *
1.8 * User configuration support
1.9 *
1.10 @@ -117,6 +117,22 @@
1.11 param->value = g_strdup(value);
1.12 }
1.13
1.14 +gboolean lxdream_set_group_value( lxdream_config_group_t group, const gchar *key, const gchar *value )
1.15 +{
1.16 + int i;
1.17 + for( i=0; group->params[i].key != NULL; i++ ) {
1.18 + if( strcasecmp( group->params[i].key, key ) == 0 ) {
1.19 + if( group->params[i].value != group->params[i].default_value &&
1.20 + group->params[i].value != NULL ) {
1.21 + free( group->params[i].value );
1.22 + }
1.23 + group->params[i].value = g_strdup( value );
1.24 + return TRUE;
1.25 + }
1.26 + }
1.27 + return FALSE;
1.28 +}
1.29 +
1.30 gboolean lxdream_load_config( )
1.31 {
1.32 if( lxdream_config_load_filename == NULL ) {
.