Search
lxdream.org :: lxdream/src/config.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/config.c
changeset 1024:c67f2d61ab97
prev1015:ad448bedc48a
next1034:7044e01148f0
author nkeynes
date Sat Jun 13 00:50:48 2009 +0000 (12 years ago)
permissions -rw-r--r--
last change Build drivers with library dependencies as shared objects (ie plugins)
file annotate diff log raw
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.3 @@ -27,6 +27,7 @@
1.4 #include "config.h"
1.5 #include "maple/maple.h"
1.6
1.7 +#define MAX_ROOT_GROUPS 16
1.8
1.9 extern struct lxdream_config_entry alsa_config[];
1.10 extern struct lxdream_config_entry hotkeys_config[];
1.11 @@ -50,19 +51,31 @@
1.12 {{ "device", N_("Serial device"), CONFIG_TYPE_FILE, "/dev/ttyS1" },
1.13 { NULL, CONFIG_TYPE_NONE }};
1.14
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.21 -#ifdef HAVE_ALSA
1.22 - { "alsa", alsa_config },
1.23 -#endif
1.24 { NULL, CONFIG_TYPE_NONE }};
1.25
1.26 static gchar *lxdream_config_load_filename = NULL;
1.27 static gchar *lxdream_config_save_filename = NULL;
1.28
1.29 +void lxdream_register_config_group( const gchar *key, lxdream_config_entry_t group )
1.30 +{
1.31 + int i;
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.38 + return;
1.39 + }
1.40 + }
1.41 + ERROR( "Unable to register config group '%s': Too many configuration groups", key );
1.42 +}
1.43 +
1.44 gboolean lxdream_find_config()
1.45 {
1.46 gboolean result = TRUE;
.