]> git.sesse.net Git - vlc/commitdiff
Good riddance the helper module
authorRémi Denis-Courmont <rem@videolan.org>
Tue, 18 Dec 2007 19:25:39 +0000 (19:25 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Tue, 18 Dec 2007 19:25:39 +0000 (19:25 +0000)
src/config/config.h
src/config/core.c
src/libvlc-common.c
src/libvlc-module.c

index 53890cd2c9ed84885e45a2586e13819ad1014bf4..9e5b6d5e03ff1112b59e30e556824a5305af4ef4 100644 (file)
@@ -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 );
index f300ce0124f0ff3bb633a64d4aa1bff77274e0f3..998777d065579df0b37d4288f47c92714f54eca6 100644 (file)
@@ -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.
  *****************************************************************************
index 468fd953bc3da85968abf0302db83057f2245b46..8803b76ab71092076dc9c350f329b9ef4d2b2a95 100644 (file)
@@ -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
      */
index 1b801c1beab261e955fa294b0823dc1800172e82..4ffe64fdfd67b559c3b0fb8f07bbc6064633cee0 100644 (file)
@@ -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.
  *****************************************************************************/