Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
30aaaa4a
Commit
30aaaa4a
authored
Apr 11, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LUA: store p_intf->p_sys separately
parent
c1d3b260
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
8 deletions
+32
-8
modules/misc/lua/intf.c
modules/misc/lua/intf.c
+1
-0
modules/misc/lua/libs/misc.c
modules/misc/lua/libs/misc.c
+28
-8
modules/misc/lua/vlc.h
modules/misc/lua/vlc.h
+3
-0
No files found.
modules/misc/lua/intf.c
View file @
30aaaa4a
...
...
@@ -171,6 +171,7 @@ int Open_LuaIntf( vlc_object_t *p_this )
}
vlclua_set_this
(
L
,
p_intf
);
vlclua_set_intf
(
L
,
p_sys
);
luaL_openlibs
(
L
);
...
...
modules/misc/lua/libs/misc.c
View file @
30aaaa4a
...
...
@@ -47,24 +47,44 @@
#include "../vlc.h"
#include "../libs.h"
#undef vlclua_set_this
/*****************************************************************************
* Internal lua<->vlc utils
*****************************************************************************/
void
vlclua_set_this
(
lua_State
*
L
,
vlc_object_t
*
p_this
)
static
void
vlclua_set_object
(
lua_State
*
L
,
void
*
id
,
void
*
value
)
{
lua_pushlightuserdata
(
L
,
vlclua_set_this
);
lua_pushlightuserdata
(
L
,
p_this
);
lua_pushlightuserdata
(
L
,
id
);
lua_pushlightuserdata
(
L
,
value
);
lua_rawset
(
L
,
LUA_REGISTRYINDEX
);
}
vlc_object_t
*
vlclua_get_this
(
lua_State
*
L
)
static
void
*
vlclua_get_object
(
lua_State
*
L
,
void
*
id
)
{
lua_pushlightuserdata
(
L
,
vlclua_set_this
);
lua_pushlightuserdata
(
L
,
id
);
lua_rawget
(
L
,
LUA_REGISTRYINDEX
);
vlc_object_t
*
p_this
=
(
vlc_object_t
*
)
lua_topointer
(
L
,
-
1
);
const
void
*
p
=
lua_topointer
(
L
,
-
1
);
lua_pop
(
L
,
1
);
return
p_this
;
return
(
void
*
)
p
;
}
#undef vlclua_set_this
void
vlclua_set_this
(
lua_State
*
L
,
vlc_object_t
*
p_this
)
{
vlclua_set_object
(
L
,
vlclua_set_this
,
p_this
);
}
vlc_object_t
*
vlclua_get_this
(
lua_State
*
L
)
{
return
vlclua_get_object
(
L
,
vlclua_set_this
);
}
void
vlclua_set_intf
(
lua_State
*
L
,
intf_sys_t
*
p_intf
)
{
vlclua_set_object
(
L
,
vlclua_set_intf
,
p_intf
);
}
static
intf_sys_t
*
vlclua_get_intf
(
lua_State
*
L
)
{
return
vlclua_get_object
(
L
,
vlclua_set_intf
);
}
/*****************************************************************************
...
...
modules/misc/lua/vlc.h
View file @
30aaaa4a
...
...
@@ -95,6 +95,9 @@ void vlclua_set_this( lua_State *, vlc_object_t * );
#define vlclua_set_this(a, b) vlclua_set_this(a, VLC_OBJECT(b))
vlc_object_t
*
vlclua_get_this
(
lua_State
*
);
struct
intf_sys_t
;
void
vlclua_set_intf
(
lua_State
*
,
struct
intf_sys_t
*
);
/*****************************************************************************
* Lua function bridge
*****************************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment