]> git.sesse.net Git - vlc/commitdiff
Use config chain in lua intf module.
authorAntoine Cellerier <dionoea@videolan.org>
Mon, 19 Jan 2009 22:40:55 +0000 (23:40 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Mon, 19 Jan 2009 22:40:55 +0000 (23:40 +0100)
modules/misc/lua/intf.c
share/lua/intf/dummy.lua

index c25e27be1d6aac34e044d3f10aa83f08b2996274..3becf7bda94e34bc413c3927c6c8ec4fc517da68 100644 (file)
@@ -52,6 +52,8 @@
  *****************************************************************************/
 static void *Run( void * );
 
+static const char * const ppsz_intf_options[] = { "intf", "config", NULL };
+
 /*****************************************************************************
  *
  *****************************************************************************/
@@ -126,9 +128,9 @@ static char *GetModuleName( intf_thread_t *p_intf )
 {
     int i;
     const char *psz_intf;
-    if( *p_intf->psz_intf == '$' )
+    /*if( *p_intf->psz_intf == '$' )
         psz_intf = var_GetString( p_intf, p_intf->psz_intf+1 );
-    else
+    else*/
         psz_intf = p_intf->psz_intf;
     for( i = 0; pp_shortcuts[i].psz_name; i++ )
     {
@@ -136,7 +138,7 @@ static char *GetModuleName( intf_thread_t *p_intf )
             return strdup( pp_shortcuts[i].psz_name );
     }
 
-    return config_GetPsz( p_intf, "lua-intf" );
+    return var_GetString( p_intf, "lua-intf" );
 }
 
 static const luaL_Reg p_reg[] = { { NULL, NULL } };
@@ -147,6 +149,7 @@ int Open_LuaIntf( vlc_object_t *p_this )
     intf_sys_t *p_sys;
     lua_State *L;
 
+    config_ChainParse( p_intf, "lua-", ppsz_intf_options, p_intf->p_cfg );
     char *psz_name = GetModuleName( p_intf );
     const char *psz_config;
     bool b_config_set = false;
index 34a3fce9963559a8e676204a290fd27487b3bbaa..1b64f21264fec679b2e4a07b05dc0ae1bc079794 100644 (file)
@@ -4,8 +4,8 @@ msg = [[
 This is the `dummy' VLC Lua interface module.
 Please specify a VLC Lua interface to load with the --lua-intf option.
 VLC Lua interface modules include: `rc', `telnet' and `http'.
-For example: vlc -I lua --lua-intf rc]]
---You can also use the alternate syntax: vlc -I "lua{intf=rc}"]]
+For example: vlc -I lua --lua-intf rc
+You can also use the alternate syntax: vlc -I "lua{intf=rc}"]]
 
 for line in string.gmatch(msg,"([^\n]+)\n*") do
     vlc.msg.err(line)