From: Christophe Mutricy Date: Wed, 1 Jun 2005 17:08:59 +0000 (+0000) Subject: * configuration.[ch]: treat the deleted options with add_suppressed_[bool,string... X-Git-Tag: 0.8.4~1587 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9b7380f571471c6f4d39f5946acddfc62e9bcb41;p=vlc * configuration.[ch]: treat the deleted options with add_suppressed_[bool,string,...] * standard.c: sap-ipv6 is no more used --- diff --git a/include/configuration.h b/include/configuration.h index 31d9dd6fd6..bad6b4f0b6 100644 --- a/include/configuration.h +++ b/include/configuration.h @@ -342,7 +342,7 @@ int config_AutoSaveConfigFile( vlc_object_t * ); if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \ (i_config+11) * sizeof(module_config_t)); \ { static module_config_t tmp = { CONFIG_ITEM_BOOL, NULL, name, '\0', text, longtext, NULL, b_value }; p_config[ i_config ] = tmp; p_config[ i_config ].pf_callback = p_callback; p_config[i_config].b_advanced = advc; } - +/* For option renamed */ #define add_deprecated( name, strict ) \ i_config++; \ if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \ @@ -353,7 +353,44 @@ int config_AutoSaveConfigFile( vlc_object_t * ); p_config[ i_config ].psz_name = name; \ p_config[i_config].b_strict = strict; \ p_config[ i_config ].psz_current = p_config[ i_config-1].psz_current?p_config[ i_config-1 ].psz_current:p_config[ i_config-1 ].psz_name; } +/* For option suppressed*/ +#define add_suppressed_bool( name ) \ + i_config++; \ + if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \ + (i_config+11) * sizeof(module_config_t)); \ + { static module_config_t tmp; \ + p_config[ i_config ] = tmp; \ + p_config[ i_config ].i_type = CONFIG_ITEM_BOOL; \ + p_config[ i_config ].psz_name = name; \ + p_config[ i_config ].psz_current = "SUPPRESSED"; } +#define add_suppressed_integer( name ) \ + i_config++; \ + if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \ + (i_config+11) * sizeof(module_config_t)); \ + { static module_config_t tmp; \ + p_config[ i_config ] = tmp; \ + p_config[ i_config ].i_type = CONFIG_ITEM_INTEGER; \ + p_config[ i_config ].psz_name = name; \ + p_config[ i_config ].psz_current = "SUPPRESSED"; } +#define add_suppressed_float( name ) \ + i_config++; \ + if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \ + (i_config+11) * sizeof(module_config_t)); \ + { static module_config_t tmp; \ + p_config[ i_config ] = tmp; \ + p_config[ i_config ].i_type = CONFIG_ITEM_FLOAT; \ + p_config[ i_config ].psz_name = name; \ + p_config[ i_config ].psz_current = "SUPPRESSED"; } +#define add_suppressed_string( name ) \ + i_config++; \ + if(!(i_config%10)) p_config = (module_config_t* )realloc(p_config, \ + (i_config+11) * sizeof(module_config_t)); \ + { static module_config_t tmp; \ + p_config[ i_config ] = tmp; \ + p_config[ i_config ].i_type = CONFIG_ITEM_STRING; \ + p_config[ i_config ].psz_name = name; \ + p_config[ i_config ].psz_current = "SUPPRESSED"; } /* Modifier macros for the config options (used for fine tuning) */ #define change_short( ch ) \ p_config[i_config].i_short = ch; diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c index 814c536cd6..975c9eace7 100644 --- a/modules/stream_out/standard.c +++ b/modules/stream_out/standard.c @@ -92,7 +92,7 @@ vlc_module_begin(); VLC_TRUE ); add_string( SOUT_CFG_PREFIX "group", "", NULL, GROUP_TEXT, GROUP_LONGTEXT, VLC_TRUE ); - add_deprecated( SOUT_CFG_PREFIX "sap-ipv6", VLC_FALSE ); + add_suppressed_bool( SOUT_CFG_PREFIX "sap-ipv6" ); add_bool( SOUT_CFG_PREFIX "slp", 0, NULL, SLP_TEXT, SLP_LONGTEXT, VLC_TRUE ); diff --git a/src/misc/configuration.c b/src/misc/configuration.c index c996882471..ca3d23bb1e 100644 --- a/src/misc/configuration.c +++ b/src/misc/configuration.c @@ -1551,6 +1551,16 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], /* Check if the option is deprecated */ if( p_conf->psz_current ) { + if( !strcmp(p_conf->psz_current,"SUPPRESSED") ) + { + if( !b_ignore_errors ) + { + fprintf(stderr, + "Warning: option --%s is no longer used.\n", + p_conf->psz_name); + } + continue; + } if( !b_ignore_errors ) { if( p_conf->b_strict )