Commit 3d0196c7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Good riddance the helper module

parent 92fc113b
...@@ -34,9 +34,6 @@ extern "C" { ...@@ -34,9 +34,6 @@ extern "C" {
int config_CreateDir( vlc_object_t *, const char * ); int config_CreateDir( vlc_object_t *, const char * );
int config_AutoSaveConfigFile( vlc_object_t * ); int config_AutoSaveConfigFile( vlc_object_t * );
/* TODO: remove this, only used for helper module */
int config_Duplicate( module_t *, module_config_t *, size_t );
void config_Free( module_t * ); void config_Free( module_t * );
void config_SetCallbacks( module_config_t *, module_config_t *, size_t ); void config_SetCallbacks( module_config_t *, module_config_t *, size_t );
......
...@@ -479,44 +479,6 @@ module_config_t *config_FindConfig( vlc_object_t *p_this, const char *psz_name ) ...@@ -479,44 +479,6 @@ module_config_t *config_FindConfig( vlc_object_t *p_this, const char *psz_name )
return NULL; return NULL;
} }
/*****************************************************************************
* config_Duplicate: creates a duplicate of a module's configuration data.
*****************************************************************************
* Unfortunatly we cannot work directly with the module's config data as
* this module might be unloaded from memory at any time (remember HideModule).
* This is why we need to create an exact copy of the config data.
*****************************************************************************/
int config_Duplicate( module_t *p_module, module_config_t *p_orig,
size_t n )
{
const module_config_t *p_item, *p_end = p_orig + n;
/* Calculate the structure length */
for( p_item = p_orig; p_item < p_end; p_item++ )
{
if( p_item->i_type & CONFIG_ITEM )
{
p_module->i_config_items++;
}
if( p_item->i_type == CONFIG_ITEM_BOOL )
{
p_module->i_bool_items++;
}
}
p_module->p_config = p_orig;
p_module->confsize = n;
/* Do the duplication job */
for( size_t i = 0; i < n ; i++ )
{
p_module->p_config[i].p_lock = &p_module->object_lock;
}
return VLC_SUCCESS;
}
/***************************************************************************** /*****************************************************************************
* config_Free: frees a duplicated module's configuration data. * config_Free: frees a duplicated module's configuration data.
***************************************************************************** *****************************************************************************
......
...@@ -247,7 +247,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -247,7 +247,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
char * psz_control = NULL; char * psz_control = NULL;
vlc_bool_t b_exit = VLC_FALSE; vlc_bool_t b_exit = VLC_FALSE;
int i_ret = VLC_EEXIT; int i_ret = VLC_EEXIT;
module_t *p_help_module = NULL;
playlist_t *p_playlist = NULL; playlist_t *p_playlist = NULL;
vlc_value_t val; vlc_value_t val;
#if defined( ENABLE_NLS ) \ #if defined( ENABLE_NLS ) \
...@@ -289,25 +288,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -289,25 +288,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
* options) */ * options) */
module_InitBank( p_libvlc ); module_InitBank( p_libvlc );
/* Hack: insert the help module here */
p_help_module = vlc_module_create( VLC_OBJECT(p_libvlc) );
if( p_help_module == NULL )
{
module_EndBank( p_libvlc );
return VLC_EGENERIC;
}
p_help_module->psz_object_name = "help";
p_help_module->psz_longname = N_("Help options");
config_Duplicate( p_help_module, libvlc_config, libvlc_config_count );
vlc_object_attach( p_help_module, libvlc_global.p_module_bank );
/* End hack */
if( config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ) ) if( config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ) )
{ {
vlc_object_detach( p_help_module );
p_help_module->p_config = NULL;
p_help_module->confsize = 0;
vlc_object_destroy( p_help_module );
module_EndBank( p_libvlc ); module_EndBank( p_libvlc );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -340,10 +322,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -340,10 +322,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
libvlc_global.p_module_bank->b_cache_delete = VLC_TRUE; libvlc_global.p_module_bank->b_cache_delete = VLC_TRUE;
} }
/* Hack: remove the help module here */
vlc_object_detach( p_help_module );
/* End hack */
/* Will be re-done properly later on */ /* Will be re-done properly later on */
p_libvlc->i_verbose = config_GetInt( p_libvlc, "verbose" ); p_libvlc->i_verbose = config_GetInt( p_libvlc, "verbose" );
...@@ -414,8 +392,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -414,8 +392,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
if( b_exit ) if( b_exit )
{ {
p_help_module->p_config = NULL; p_help_module->confsize = 0;
vlc_object_destroy( p_help_module );
module_EndBank( p_libvlc ); module_EndBank( p_libvlc );
return i_ret; return i_ret;
} }
...@@ -467,10 +443,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -467,10 +443,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
msg_Dbg( p_libvlc, "module bank initialized, found %i modules", msg_Dbg( p_libvlc, "module bank initialized, found %i modules",
libvlc_global.p_module_bank->i_children ); libvlc_global.p_module_bank->i_children );
/* Hack: insert the help module here */
vlc_object_attach( p_help_module, libvlc_global.p_module_bank );
/* End hack */
/* Check for help on modules */ /* Check for help on modules */
if( (p_tmp = config_GetPsz( p_libvlc, "module" )) ) if( (p_tmp = config_GetPsz( p_libvlc, "module" )) )
{ {
...@@ -503,29 +475,19 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -503,29 +475,19 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
/* Check for config file options */ /* Check for config file options */
if( config_GetInt( p_libvlc, "reset-config" ) ) if( config_GetInt( p_libvlc, "reset-config" ) )
{ {
vlc_object_detach( p_help_module );
config_ResetAll( p_libvlc ); config_ResetAll( p_libvlc );
config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ); config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE );
config_SaveConfigFile( p_libvlc, NULL ); config_SaveConfigFile( p_libvlc, NULL );
vlc_object_attach( p_help_module, libvlc_global.p_module_bank );
} }
if( config_GetInt( p_libvlc, "save-config" ) ) if( config_GetInt( p_libvlc, "save-config" ) )
{ {
vlc_object_detach( p_help_module );
config_LoadConfigFile( p_libvlc, NULL ); config_LoadConfigFile( p_libvlc, NULL );
config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ); config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE );
config_SaveConfigFile( p_libvlc, NULL ); config_SaveConfigFile( p_libvlc, NULL );
vlc_object_attach( p_help_module, libvlc_global.p_module_bank );
} }
/* Hack: remove the help module here */
vlc_object_detach( p_help_module );
/* End hack */
if( b_exit ) if( b_exit )
{ {
p_help_module->p_config = NULL; p_help_module->confsize = 0;
vlc_object_destroy( p_help_module );
module_EndBank( p_libvlc ); module_EndBank( p_libvlc );
return i_ret; return i_ret;
} }
...@@ -540,10 +502,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -540,10 +502,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
*/ */
config_LoadConfigFile( p_libvlc, NULL ); config_LoadConfigFile( p_libvlc, NULL );
/* Hack: insert the help module here */
vlc_object_attach( p_help_module, libvlc_global.p_module_bank );
/* End hack */
/* /*
* Override configuration with command line settings * Override configuration with command line settings
*/ */
...@@ -556,19 +514,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, ...@@ -556,19 +514,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
"that they are valid.\n" ); "that they are valid.\n" );
PauseConsole(); PauseConsole();
#endif #endif
vlc_object_detach( p_help_module );
p_help_module->p_config = NULL; p_help_module->confsize = 0;
vlc_object_destroy( p_help_module );
module_EndBank( p_libvlc ); module_EndBank( p_libvlc );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
/* Hack: remove the help module here */
vlc_object_detach( p_help_module );
p_help_module->p_config = NULL; p_help_module->confsize = 0;
vlc_object_destroy( p_help_module );
/* End hack */
/* /*
* System specific configuration * System specific configuration
*/ */
......
...@@ -2461,13 +2461,6 @@ vlc_module_begin(); ...@@ -2461,13 +2461,6 @@ vlc_module_begin();
set_capability( "main", 100 ); set_capability( "main", 100 );
vlc_module_end(); vlc_module_end();
module_config_t libvlc_config[] =
{
};
const size_t libvlc_config_count = sizeof (libvlc_config)
/ sizeof (libvlc_config[0]);
/***************************************************************************** /*****************************************************************************
* End configuration. * End configuration.
*****************************************************************************/ *****************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment