[vlc-devel] commit: Use config chain in lua intf module. (Antoine Cellerier )
git version control
git at videolan.org
Mon Jan 19 23:41:12 CET 2009
vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Mon Jan 19 23:40:55 2009 +0100| [e8e1798986c448807ea831cc65cede5c3da1e42c] | committer: Antoine Cellerier
Use config chain in lua intf module.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e8e1798986c448807ea831cc65cede5c3da1e42c
---
modules/misc/lua/intf.c | 9 ++++++---
share/lua/intf/dummy.lua | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/modules/misc/lua/intf.c b/modules/misc/lua/intf.c
index c25e27b..3becf7b 100644
--- a/modules/misc/lua/intf.c
+++ b/modules/misc/lua/intf.c
@@ -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;
diff --git a/share/lua/intf/dummy.lua b/share/lua/intf/dummy.lua
index 34a3fce..1b64f21 100644
--- a/share/lua/intf/dummy.lua
+++ b/share/lua/intf/dummy.lua
@@ -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)
More information about the vlc-devel
mailing list