Search
lxdream.org :: lxdream/src/config.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/config.c
changeset 1034:7044e01148f0
prev1024:c67f2d61ab97
next1036:af7b0c5905dd
author nkeynes
date Wed Jun 24 02:41:12 2009 +0000 (13 years ago)
permissions -rw-r--r--
last change Add initial VMU support
file annotate diff log raw
1.1 --- a/src/config.c Sat Jun 13 00:50:48 2009 +0000
1.2 +++ b/src/config.c Wed Jun 24 02:41:12 2009 +0000
1.3 @@ -42,9 +42,11 @@
1.4 { "flash", N_("Flash ROM"), CONFIG_TYPE_FILE, "dcflash.rom" },
1.5 { "default path", N_("Default disc path"), CONFIG_TYPE_PATH, "." },
1.6 { "save path", N_("Save-state path"), CONFIG_TYPE_PATH, "save" },
1.7 + { "vmu path", N_("VMU path"), CONFIG_TYPE_PATH, "vmu" },
1.8 { "bootstrap", N_("Bootstrap IP.BIN"), CONFIG_TYPE_FILE, "IP.BIN" },
1.9 { "gdrom", NULL, CONFIG_TYPE_FILE, NULL },
1.10 - { "recent", NULL, CONFIG_TYPE_FILE, NULL },
1.11 + { "recent", NULL, CONFIG_TYPE_FILELIST, NULL },
1.12 + { "vmu", NULL, CONFIG_TYPE_FILELIST, NULL },
1.13 { NULL, CONFIG_TYPE_NONE }};
1.14
1.15 static struct lxdream_config_entry serial_config[] =
1.16 @@ -139,6 +141,42 @@
1.17 return global_config[key].value;
1.18 }
1.19
1.20 +GList *lxdream_get_global_config_list_value( int key )
1.21 +{
1.22 + GList *result = NULL;
1.23 + const gchar *str = lxdream_get_config_value( key );
1.24 + if( str != NULL ) {
1.25 + gchar **strv = g_strsplit(str, ":",0);
1.26 + int i;
1.27 + for( i=0; strv[i] != NULL; i++ ) {
1.28 + result = g_list_append( result, g_strdup(strv[i]) );
1.29 + }
1.30 + g_strfreev(strv);
1.31 + }
1.32 + return result;
1.33 +}
1.34 +
1.35 +void lxdream_set_global_config_list_value( int key, const GList *list )
1.36 +{
1.37 + if( list == NULL ) {
1.38 + lxdream_set_global_config_value( key, NULL );
1.39 + } else {
1.40 + GList *ptr;
1.41 + int size = 0;
1.42 +
1.43 + for( ptr = list; ptr != NULL; ptr = g_list_next(ptr) ) {
1.44 + size += strlen( (gchar *)ptr->data ) + 1;
1.45 + }
1.46 + char buf[size];
1.47 + strcpy( buf, (gchar *)list->data );
1.48 + for( ptr = g_list_next(list); ptr != NULL; ptr = g_list_next(ptr) ) {
1.49 + strcat( buf, ":" );
1.50 + strcat( buf, (gchar *)ptr->data );
1.51 + }
1.52 + lxdream_set_global_config_value( key, buf );
1.53 + }
1.54 +}
1.55 +
1.56 void lxdream_set_config_value( lxdream_config_entry_t param, const gchar *value )
1.57 {
1.58 if( param->value != value ) {
.