[vlc-commits] lua: move some code, no functional changes
Rémi Denis-Courmont
git at videolan.org
Mon Mar 24 18:56:23 CET 2014
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar 24 19:23:10 2014 +0200| [6da72c20cf4e4064b1758938131d00d327552770] | committer: Rémi Denis-Courmont
lua: move some code, no functional changes
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6da72c20cf4e4064b1758938131d00d327552770
---
modules/lua/libs/misc.c | 15 +++------------
modules/lua/libs/misc.h | 3 +++
modules/lua/libs/playlist.c | 11 +++++++++++
3 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/modules/lua/libs/misc.c b/modules/lua/libs/misc.c
index 81b5a7e..067af57 100644
--- a/modules/lua/libs/misc.c
+++ b/modules/lua/libs/misc.c
@@ -42,18 +42,19 @@
#include "../vlc.h"
#include "../libs.h"
+#include "misc.h"
/*****************************************************************************
* Internal lua<->vlc utils
*****************************************************************************/
-static void vlclua_set_object( lua_State *L, void *id, void *value )
+void vlclua_set_object( lua_State *L, void *id, void *value )
{
lua_pushlightuserdata( L, id );
lua_pushlightuserdata( L, value );
lua_rawset( L, LUA_REGISTRYINDEX );
}
-static void *vlclua_get_object( lua_State *L, void *id )
+void *vlclua_get_object( lua_State *L, void *id )
{
lua_pushlightuserdata( L, id );
lua_rawget( L, LUA_REGISTRYINDEX );
@@ -73,16 +74,6 @@ vlc_object_t * vlclua_get_this( lua_State *L )
return vlclua_get_object( L, vlclua_set_this );
}
-void vlclua_set_playlist_internal( lua_State *L, playlist_t *pl )
-{
- vlclua_set_object( L, vlclua_set_playlist_internal, pl );
-}
-
-playlist_t *vlclua_get_playlist_internal( lua_State *L )
-{
- return vlclua_get_object( L, vlclua_set_playlist_internal );
-}
-
/*****************************************************************************
* VLC error code translation
*****************************************************************************/
diff --git a/modules/lua/libs/misc.h b/modules/lua/libs/misc.h
index 67a386e..e4f2f00 100644
--- a/modules/lua/libs/misc.h
+++ b/modules/lua/libs/misc.h
@@ -25,6 +25,9 @@
#ifndef VLC_LUA_MISC_H
#define VLC_LUA_MISC_H
+void vlclua_set_object( lua_State *, void *id, void *value );
+void *vlclua_get_object( lua_State *, void *id );
+
vlc_object_t * vlclua_get_this( lua_State * );
int vlclua_push_ret( lua_State *, int );
diff --git a/modules/lua/libs/playlist.c b/modules/lua/libs/playlist.c
index 8dfd048..ab4faf1 100644
--- a/modules/lua/libs/playlist.c
+++ b/modules/lua/libs/playlist.c
@@ -41,6 +41,17 @@
#include "../libs.h"
#include "input.h"
#include "variables.h"
+#include "misc.h"
+
+void vlclua_set_playlist_internal( lua_State *L, playlist_t *pl )
+{
+ vlclua_set_object( L, vlclua_set_playlist_internal, pl );
+}
+
+playlist_t *vlclua_get_playlist_internal( lua_State *L )
+{
+ return vlclua_get_object( L, vlclua_set_playlist_internal );
+}
static int vlclua_playlist_prev( lua_State * L )
{
More information about the vlc-commits
mailing list