]> git.sesse.net Git - vlc/commitdiff
Add support for config chain for interface modules
authorAntoine Cellerier <dionoea@videolan.org>
Mon, 19 Jan 2009 22:40:11 +0000 (23:40 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Mon, 19 Jan 2009 22:40:11 +0000 (23:40 +0100)
include/vlc_interface.h
include/vlc_plugin.h
src/interface/interface.c

index f24633bc0f668d1bc9663118111923bd3f8358e7..056167a5480b4daf511ccef642ede25b4706827a 100644 (file)
@@ -67,6 +67,8 @@ struct intf_thread_t
                                intf_dialog_args_t * );
 
     vlc_mutex_t  change_lock;
+
+    config_chain_t *p_cfg;
 };
 
 /** \brief Arguments passed to a dialogs provider
index 0d2542f4b45b42a381d49f7fd4aeff3ab5f67bcd..a1e550ddb2263d99a888e49c5a90fb3b09c369aa 100644 (file)
@@ -132,8 +132,8 @@ enum vlc_config_properties
 /**
  * Current plugin ABI version
  */
-# define MODULE_SYMBOL 1_0_0c
-# define MODULE_SUFFIX "__1_0_0c"
+# define MODULE_SYMBOL 1_0_0d
+# define MODULE_SUFFIX "__1_0_0d"
 
 /*****************************************************************************
  * Add a few defines. You do not want to read this section. Really.
index 6dc2382c21bde1788fd00e4da2299df70ef76d5c..9392d0ddc2817e0101292a6934d430f56ba545c1 100644 (file)
@@ -69,6 +69,7 @@ static void intf_Destroy( vlc_object_t *obj )
         module_unneed( p_intf, p_intf->p_module );
 
     free( p_intf->psz_intf );
+    config_ChainDestroy( p_intf->p_cfg );
     vlc_mutex_destroy( &p_intf->change_lock );
 }
 
@@ -94,8 +95,15 @@ intf_thread_t* __intf_Create( vlc_object_t *p_this, const char *psz_module )
 #endif
 
     /* Choose the best module */
-    p_intf->psz_intf = strdup( psz_module );
-    p_intf->p_module = module_need( p_intf, "interface", psz_module, true );
+    p_intf->p_cfg = NULL;
+    char *psz_parser = *psz_module == '$'
+                     ? var_CreateGetString(p_intf,psz_module+1)
+                     : strdup( psz_module );
+    char *psz_tmp = config_ChainCreate( &p_intf->psz_intf, &p_intf->p_cfg,
+                                        psz_parser );
+    free( psz_tmp );
+    free( psz_parser );
+    p_intf->p_module = module_need( p_intf, "interface", p_intf->psz_intf, true );
 
     if( p_intf->p_module == NULL )
     {