1.1 --- a/src/config.c Tue Jun 02 23:16:26 2009 +0000
1.2 +++ b/src/config.c Sat Jun 13 00:50:48 2009 +0000
1.5 #include "maple/maple.h"
1.7 +#define MAX_ROOT_GROUPS 16
1.9 extern struct lxdream_config_entry alsa_config[];
1.10 extern struct lxdream_config_entry hotkeys_config[];
1.12 {{ "device", N_("Serial device"), CONFIG_TYPE_FILE, "/dev/ttyS1" },
1.13 { NULL, CONFIG_TYPE_NONE }};
1.15 -struct lxdream_config_group lxdream_config_root[] =
1.16 +struct lxdream_config_group lxdream_config_root[MAX_ROOT_GROUPS+1] =
1.17 {{ "global", global_config },
1.18 { "controllers", NULL },
1.19 { "hotkeys", hotkeys_config },
1.20 { "serial", serial_config },
1.22 - { "alsa", alsa_config },
1.24 { NULL, CONFIG_TYPE_NONE }};
1.26 static gchar *lxdream_config_load_filename = NULL;
1.27 static gchar *lxdream_config_save_filename = NULL;
1.29 +void lxdream_register_config_group( const gchar *key, lxdream_config_entry_t group )
1.32 + for( i=0; i<MAX_ROOT_GROUPS; i++ ) {
1.33 + if( lxdream_config_root[i].key == NULL ) {
1.34 + lxdream_config_root[i].key = key;
1.35 + lxdream_config_root[i].params = group;
1.36 + lxdream_config_root[i+1].key = NULL;
1.37 + lxdream_config_root[i+1].params = CONFIG_TYPE_NONE;
1.41 + ERROR( "Unable to register config group '%s': Too many configuration groups", key );
1.44 gboolean lxdream_find_config()
1.46 gboolean result = TRUE;