[vlc-devel] commit: lua_libs: add a function to trigger callbacks. ( Rémi Duraffort )
git version control
git at videolan.org
Fri Nov 13 17:59:51 CET 2009
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Nov 12 18:52:34 2009 +0100| [1e724a9b7f89314a4b668414e125e3490fda234c] | committer: Rémi Duraffort
lua_libs: add a function to trigger callbacks.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1e724a9b7f89314a4b668414e125e3490fda234c
---
modules/misc/lua/libs/variables.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/modules/misc/lua/libs/variables.c b/modules/misc/lua/libs/variables.c
index c5ec5cd..c782022 100644
--- a/modules/misc/lua/libs/variables.c
+++ b/modules/misc/lua/libs/variables.c
@@ -537,6 +537,14 @@ static int vlclua_del_callback( lua_State *L )
return 0;
}
+static int vlclua_trigger_callback( lua_State *L )
+{
+ vlc_object_t **pp_obj = luaL_checkudata( L, 1, "vlc_object" );
+ const char *psz_var = luaL_checkstring( L, 2 );
+
+ return vlclua_push_ret( L, var_TriggerCallback( *pp_obj, psz_var ) );
+}
+
/*****************************************************************************
*
*****************************************************************************/
@@ -547,6 +555,7 @@ static const luaL_Reg vlclua_var_reg[] = {
{ "create", vlclua_var_create },
{ "add_callback", vlclua_add_callback },
{ "del_callback", vlclua_del_callback },
+ { "trigger_callback", vlclua_trigger_callback },
{ "command", vlclua_command },
{ "libvlc_command", vlclua_libvlc_command },
{ NULL, NULL }
More information about the vlc-devel
mailing list