Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
6da72c20
Commit
6da72c20
authored
Mar 24, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: move some code, no functional changes
parent
8c5e52f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
modules/lua/libs/misc.c
modules/lua/libs/misc.c
+3
-12
modules/lua/libs/misc.h
modules/lua/libs/misc.h
+3
-0
modules/lua/libs/playlist.c
modules/lua/libs/playlist.c
+11
-0
No files found.
modules/lua/libs/misc.c
View file @
6da72c20
...
@@ -42,18 +42,19 @@
...
@@ -42,18 +42,19 @@
#include "../vlc.h"
#include "../vlc.h"
#include "../libs.h"
#include "../libs.h"
#include "misc.h"
/*****************************************************************************
/*****************************************************************************
* Internal lua<->vlc utils
* 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
,
id
);
lua_pushlightuserdata
(
L
,
value
);
lua_pushlightuserdata
(
L
,
value
);
lua_rawset
(
L
,
LUA_REGISTRYINDEX
);
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_pushlightuserdata
(
L
,
id
);
lua_rawget
(
L
,
LUA_REGISTRYINDEX
);
lua_rawget
(
L
,
LUA_REGISTRYINDEX
);
...
@@ -73,16 +74,6 @@ vlc_object_t * vlclua_get_this( lua_State *L )
...
@@ -73,16 +74,6 @@ vlc_object_t * vlclua_get_this( lua_State *L )
return
vlclua_get_object
(
L
,
vlclua_set_this
);
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
* VLC error code translation
*****************************************************************************/
*****************************************************************************/
...
...
modules/lua/libs/misc.h
View file @
6da72c20
...
@@ -25,6 +25,9 @@
...
@@ -25,6 +25,9 @@
#ifndef VLC_LUA_MISC_H
#ifndef VLC_LUA_MISC_H
#define 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
*
);
vlc_object_t
*
vlclua_get_this
(
lua_State
*
);
int
vlclua_push_ret
(
lua_State
*
,
int
);
int
vlclua_push_ret
(
lua_State
*
,
int
);
...
...
modules/lua/libs/playlist.c
View file @
6da72c20
...
@@ -41,6 +41,17 @@
...
@@ -41,6 +41,17 @@
#include "../libs.h"
#include "../libs.h"
#include "input.h"
#include "input.h"
#include "variables.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
)
static
int
vlclua_playlist_prev
(
lua_State
*
L
)
{
{
...
...
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