/*****************************************************************************
* Generic vlc_object_t wrapper creation
*****************************************************************************/
-int __vlclua_push_vlc_object( lua_State *L, vlc_object_t *p_obj,
- lua_CFunction pf_gc )
-{
- vlc_object_t **udata = (vlc_object_t **)
- lua_newuserdata( L, sizeof( vlc_object_t * ) );
- *udata = p_obj;
-
- if( luaL_newmetatable( L, "vlc_object" ) )
- {
- /* Hide the metatable */
- lua_pushliteral( L, "none of your business" );
- lua_setfield( L, -2, "__metatable" );
- if( pf_gc ) /* FIXME */
- {
- /* Set the garbage collector if needed */
- lua_pushcfunction( L, pf_gc );
- lua_setfield( L, -2, "__gc" );
- }
- }
- lua_setmetatable( L, -2 );
- return 1;
-}
-
int vlclua_gc_release( lua_State *L )
{
vlc_object_t **p_obj = (vlc_object_t **)luaL_checkudata( L, 1, "vlc_object" );
return 1;
}
+#undef vlclua_push_vlc_object
+int vlclua_push_vlc_object( lua_State *L, vlc_object_t *p_obj,
+ lua_CFunction pf_gc )
+{
+ vlc_object_t **udata = (vlc_object_t **)
+ lua_newuserdata( L, sizeof( vlc_object_t * ) );
+ *udata = p_obj;
+
+ if( luaL_newmetatable( L, "vlc_object" ) )
+ {
+ /* Hide the metatable */
+ lua_pushliteral( L, "none of your business" );
+ lua_setfield( L, -2, "__metatable" );
+ if( pf_gc ) /* FIXME */
+ {
+ /* Set the garbage collector if needed */
+ lua_pushcfunction( L, pf_gc );
+ lua_setfield( L, -2, "__gc" );
+ }
+ }
+ lua_setmetatable( L, -2 );
+ return 1;
+}
+
/*****************************************************************************
*
*****************************************************************************/
#ifndef VLC_LUA_OBJECTS_H
#define VLC_LUA_OBJECTS_H
-int __vlclua_push_vlc_object( lua_State *L, vlc_object_t *p_obj,
+int vlclua_push_vlc_object( lua_State *L, vlc_object_t *p_obj,
lua_CFunction pf_gc );
#define vlclua_push_vlc_object( a, b, c ) \
- __vlclua_push_vlc_object( a, VLC_OBJECT( b ), c )
+ vlclua_push_vlc_object( a, VLC_OBJECT( b ), c )
int vlclua_gc_release( lua_State *L );
#endif
return vlclua_push_ret( L, i_ret );
}
-int __vlclua_var_toggle_or_set( lua_State *L, vlc_object_t *p_obj,
- const char *psz_name )
+#undef vlclua_var_toggle_or_set
+int vlclua_var_toggle_or_set( lua_State *L, vlc_object_t *p_obj,
+ const char *psz_name )
{
bool b_bool;
if( lua_gettop( L ) > 1 ) return vlclua_error( L );
#ifndef VLC_LUA_VARIABLES_H
#define VLC_LUA_VARIABLES_H
-#define vlclua_var_toggle_or_set(a,b,c) \
- __vlclua_var_toggle_or_set(a,VLC_OBJECT(b),c)
-int __vlclua_var_toggle_or_set( lua_State *, vlc_object_t *, const char * );
+int vlclua_var_toggle_or_set( lua_State *, vlc_object_t *, const char * );
+
+#define vlclua_var_toggle_or_set( a, b, c ) \
+ vlclua_var_toggle_or_set( a, VLC_OBJECT( b ), c )
#endif
* Meta data setters utility.
* Playlist item table should be on top of the stack when these are called
*****************************************************************************/
-void __vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
- input_item_t *p_input )
+#undef vlclua_read_meta_data
+void vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
+ input_item_t *p_input )
{
#define TRY_META( a, b ) \
lua_getfield( L, -1, a ); \
TRY_META( "trackid", TrackID );
}
-void __vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
+#undef vlclua_read_custom_meta_data
+void vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
input_item_t *p_input )
{
/* Lock the input item and create the meta table if needed */
/**
* Playlist item table should be on top of the stack when this is called
*/
-void __vlclua_read_options( vlc_object_t *p_this, lua_State *L,
+#undef vlclua_read_options
+void vlclua_read_options( vlc_object_t *p_this, lua_State *L,
int *pi_options, char ***pppsz_options )
{
lua_getfield( L, -1, "options" );
lua_pop( L, 1 ); /* pop "options" */
}
-int __vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
+#undef vlclua_playlist_add_internal
+int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
playlist_t *p_playlist,
input_item_t *p_parent, bool b_play )
{
return count;
}
-int __vlclua_add_modules_path( vlc_object_t *obj, lua_State *L, const char *psz_filename )
+#undef vlclua_add_modules_path
+int vlclua_add_modules_path( vlc_object_t *obj, lua_State *L, const char *psz_filename )
{
/* Setup the module search path:
* * "The script's directory"/modules
/*****************************************************************************
* Playlist and meta data internal utilities.
*****************************************************************************/
-void __vlclua_read_options( vlc_object_t *, lua_State *, int *, char *** );
-#define vlclua_read_options(a,b,c,d) __vlclua_read_options(VLC_OBJECT(a),b,c,d)
-void __vlclua_read_meta_data( vlc_object_t *, lua_State *, input_item_t * );
-#define vlclua_read_meta_data(a,b,c) __vlclua_read_meta_data(VLC_OBJECT(a),b,c)
-void __vlclua_read_custom_meta_data( vlc_object_t *, lua_State *,
- input_item_t *);
-#define vlclua_read_custom_meta_data(a,b,c) __vlclua_read_custom_meta_data(VLC_OBJECT(a),b,c)
-int __vlclua_playlist_add_internal( vlc_object_t *, lua_State *, playlist_t *,
- input_item_t *, bool );
-#define vlclua_playlist_add_internal(a,b,c,d,e) __vlclua_playlist_add_internal(VLC_OBJECT(a),b,c,d,e)
-
-int __vlclua_add_modules_path( vlc_object_t *, lua_State *, const char *psz_filename );
-#define vlclua_add_modules_path( a, b, c ) __vlclua_add_modules_path(VLC_OBJECT(a), b, c)
+void vlclua_read_options( vlc_object_t *, lua_State *, int *, char *** );
+#define vlclua_read_options( a, b, c, d ) vlclua_read_options( VLC_OBJECT( a ), b, c, d )
+void vlclua_read_meta_data( vlc_object_t *, lua_State *, input_item_t * );
+#define vlclua_read_meta_data( a, b, c ) vlclua_read_meta_data( VLC_OBJECT( a ), b, c )
+void vlclua_read_custom_meta_data( vlc_object_t *, lua_State *,
+ input_item_t *);
+#define vlclua_read_custom_meta_data( a, b, c ) vlclua_read_custom_meta_data( VLC_OBJECT( a ), b, c )
+int vlclua_playlist_add_internal( vlc_object_t *, lua_State *, playlist_t *,
+ input_item_t *, bool );
+#define vlclua_playlist_add_internal( a, b, c, d, e ) vlclua_playlist_add_internal( VLC_OBJECT( a ), b, c, d, e )
+
+int vlclua_add_modules_path( vlc_object_t *, lua_State *, const char *psz_filename );
+#define vlclua_add_modules_path( a, b, c ) vlclua_add_modules_path( VLC_OBJECT( a ), b, c )
/**
* Per-interface private state