From 3d0196c72e0e16b1aabb7e4f105db370b206957c Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Tue, 18 Dec 2007 19:25:39 +0000 Subject: [PATCH] Good riddance the helper module --- src/config/config.h | 3 --- src/config/core.c | 38 --------------------------------- src/libvlc-common.c | 51 --------------------------------------------- src/libvlc-module.c | 7 ------- 4 files changed, 99 deletions(-) diff --git a/src/config/config.h b/src/config/config.h index 53890cd2c9..9e5b6d5e03 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -34,9 +34,6 @@ extern "C" { int config_CreateDir( vlc_object_t *, const char * ); 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_SetCallbacks( module_config_t *, module_config_t *, size_t ); diff --git a/src/config/core.c b/src/config/core.c index f300ce0124..998777d065 100644 --- a/src/config/core.c +++ b/src/config/core.c @@ -479,44 +479,6 @@ module_config_t *config_FindConfig( vlc_object_t *p_this, const char *psz_name ) 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. ***************************************************************************** diff --git a/src/libvlc-common.c b/src/libvlc-common.c index 468fd953bc..8803b76ab7 100644 --- a/src/libvlc-common.c +++ b/src/libvlc-common.c @@ -247,7 +247,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, char * psz_control = NULL; vlc_bool_t b_exit = VLC_FALSE; int i_ret = VLC_EEXIT; - module_t *p_help_module = NULL; playlist_t *p_playlist = NULL; vlc_value_t val; #if defined( ENABLE_NLS ) \ @@ -289,25 +288,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, * options) */ 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 ) ) { - 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 ); return VLC_EGENERIC; } @@ -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; } - /* Hack: remove the help module here */ - vlc_object_detach( p_help_module ); - /* End hack */ - /* Will be re-done properly later on */ p_libvlc->i_verbose = config_GetInt( p_libvlc, "verbose" ); @@ -414,8 +392,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, if( b_exit ) { - p_help_module->p_config = NULL; p_help_module->confsize = 0; - vlc_object_destroy( p_help_module ); module_EndBank( p_libvlc ); return i_ret; } @@ -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", 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 */ if( (p_tmp = config_GetPsz( p_libvlc, "module" )) ) { @@ -503,29 +475,19 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, /* Check for config file options */ if( config_GetInt( p_libvlc, "reset-config" ) ) { - vlc_object_detach( p_help_module ); config_ResetAll( p_libvlc ); config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ); config_SaveConfigFile( p_libvlc, NULL ); - vlc_object_attach( p_help_module, libvlc_global.p_module_bank ); } if( config_GetInt( p_libvlc, "save-config" ) ) { - vlc_object_detach( p_help_module ); config_LoadConfigFile( p_libvlc, NULL ); config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE ); 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 ) { - p_help_module->p_config = NULL; p_help_module->confsize = 0; - vlc_object_destroy( p_help_module ); module_EndBank( p_libvlc ); return i_ret; } @@ -540,10 +502,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, */ 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 */ @@ -556,19 +514,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, "that they are valid.\n" ); PauseConsole(); #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 ); 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 */ diff --git a/src/libvlc-module.c b/src/libvlc-module.c index 1b801c1bea..4ffe64fdfd 100644 --- a/src/libvlc-module.c +++ b/src/libvlc-module.c @@ -2461,13 +2461,6 @@ vlc_module_begin(); set_capability( "main", 100 ); vlc_module_end(); -module_config_t libvlc_config[] = -{ -}; - -const size_t libvlc_config_count = sizeof (libvlc_config) - / sizeof (libvlc_config[0]); - /***************************************************************************** * End configuration. *****************************************************************************/ -- 2.39.5