Commit c8bc962e authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

LUA: limited and DEPRECATED comeback of vlc.misc.functions

Only version, copyright, mdate (NO mwait) and *dir are present.
ALL of them are outputting warnings.

None of this is in master. This is for smooth transition ONLY.
parent 717ff04f
...@@ -832,6 +832,7 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr, ...@@ -832,6 +832,7 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
luaopen_osd( L ); luaopen_osd( L );
luaopen_playlist( L ); luaopen_playlist( L );
luaopen_sd( L ); luaopen_sd( L );
luaopen_misc_extensions( L );
luaopen_stream( L ); luaopen_stream( L );
luaopen_strings( L ); luaopen_strings( L );
luaopen_variables( L ); luaopen_variables( L );
......
...@@ -31,6 +31,7 @@ void luaopen_httpd( lua_State * ); ...@@ -31,6 +31,7 @@ void luaopen_httpd( lua_State * );
void luaopen_input( lua_State * ); void luaopen_input( lua_State * );
void luaopen_msg( lua_State * ); void luaopen_msg( lua_State * );
void luaopen_misc( lua_State * ); void luaopen_misc( lua_State * );
void luaopen_misc_extensions( lua_State * );
void luaopen_net( lua_State * ); void luaopen_net( lua_State * );
void luaopen_object( lua_State * ); void luaopen_object( lua_State * );
void luaopen_osd( lua_State * ); void luaopen_osd( lua_State * );
......
...@@ -107,6 +107,13 @@ static int vlclua_version( lua_State *L ) ...@@ -107,6 +107,13 @@ static int vlclua_version( lua_State *L )
return 1; return 1;
} }
static int vlclua_version_ext( lua_State *L )
{
msg_Warn( vlclua_get_this( L ),
"This function misc.version() is DEPRECATED, please update your script" );
lua_pushstring( L, VERSION_MESSAGE );
return 1;
}
/***************************************************************************** /*****************************************************************************
* Get the VLC copyright * Get the VLC copyright
*****************************************************************************/ *****************************************************************************/
...@@ -115,6 +122,14 @@ static int vlclua_copyright( lua_State *L ) ...@@ -115,6 +122,14 @@ static int vlclua_copyright( lua_State *L )
lua_pushliteral( L, COPYRIGHT_MESSAGE ); lua_pushliteral( L, COPYRIGHT_MESSAGE );
return 1; return 1;
} }
static int vlclua_copyright_ext( lua_State *L )
{
msg_Warn( vlclua_get_this( L ),
"This function misc.copyright() is DEPRECATED, please update your script" );
lua_pushliteral( L, COPYRIGHT_MESSAGE );
return 1;
}
/***************************************************************************** /*****************************************************************************
* Get the VLC license msg/disclaimer * Get the VLC license msg/disclaimer
...@@ -228,6 +243,16 @@ static int vlclua_mdate( lua_State *L ) ...@@ -228,6 +243,16 @@ static int vlclua_mdate( lua_State *L )
return 1; return 1;
} }
static int vlclua_mdate_ext( lua_State *L )
{
msg_Warn( vlclua_get_this( L ),
"This function misc.mdate() is DEPRECATED, please update your script" );
lua_pushnumber( L, mdate() );
return 1;
}
static int vlclua_mwait( lua_State *L ) static int vlclua_mwait( lua_State *L )
{ {
double f = luaL_checknumber( L, 1 ); double f = luaL_checknumber( L, 1 );
...@@ -355,6 +380,28 @@ static int vlclua_timer_create( lua_State *L ) ...@@ -355,6 +380,28 @@ static int vlclua_timer_create( lua_State *L )
/***************************************************************************** /*****************************************************************************
* *
*****************************************************************************/ *****************************************************************************/
static const luaL_Reg vlclua_misc_ext_reg[] = {
{ "version", vlclua_version_ext },
{ "copyright", vlclua_copyright_ext },
{ "datadir", vlclua_datadir },
{ "userdatadir", vlclua_userdatadir },
{ "homedir", vlclua_homedir },
{ "configdir", vlclua_configdir },
{ "cachedir", vlclua_cachedir },
{ "mdate", vlclua_mdate_ext },
{ NULL, NULL }
};
void luaopen_misc_extensions( lua_State *L )
{
lua_newtable( L );
luaL_register( L, NULL, vlclua_misc_ext_reg );
lua_setfield( L, -2, "misc" );
}
static const luaL_Reg vlclua_misc_reg[] = { static const luaL_Reg vlclua_misc_reg[] = {
{ "version", vlclua_version }, { "version", vlclua_version },
{ "copyright", vlclua_copyright }, { "copyright", vlclua_copyright },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment