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
17bb975a
Commit
17bb975a
authored
Jul 11, 2011
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: remove leading '__' in function name
parent
189185bf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
49 deletions
+57
-49
modules/lua/libs/objects.c
modules/lua/libs/objects.c
+24
-23
modules/lua/libs/objects.h
modules/lua/libs/objects.h
+2
-2
modules/lua/libs/variables.c
modules/lua/libs/variables.c
+3
-2
modules/lua/libs/variables.h
modules/lua/libs/variables.h
+4
-3
modules/lua/vlc.c
modules/lua/vlc.c
+11
-6
modules/lua/vlc.h
modules/lua/vlc.h
+13
-13
No files found.
modules/lua/libs/objects.c
View file @
17bb975a
...
@@ -51,29 +51,6 @@ typedef struct
...
@@ -51,29 +51,6 @@ typedef struct
/*****************************************************************************
/*****************************************************************************
* Generic vlc_object_t wrapper creation
* 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
)
int
vlclua_gc_release
(
lua_State
*
L
)
{
{
vlc_object_t
**
p_obj
=
(
vlc_object_t
**
)
luaL_checkudata
(
L
,
1
,
"vlc_object"
);
vlc_object_t
**
p_obj
=
(
vlc_object_t
**
)
luaL_checkudata
(
L
,
1
,
"vlc_object"
);
...
@@ -118,6 +95,30 @@ static int vlclua_get_input( lua_State *L )
...
@@ -118,6 +95,30 @@ static int vlclua_get_input( lua_State *L )
return
1
;
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
;
}
/*****************************************************************************
/*****************************************************************************
*
*
*****************************************************************************/
*****************************************************************************/
...
...
modules/lua/libs/objects.h
View file @
17bb975a
...
@@ -25,10 +25,10 @@
...
@@ -25,10 +25,10 @@
#ifndef VLC_LUA_OBJECTS_H
#ifndef VLC_LUA_OBJECTS_H
#define 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
);
lua_CFunction
pf_gc
);
#define vlclua_push_vlc_object( a, b, c ) \
#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
);
int
vlclua_gc_release
(
lua_State
*
L
);
#endif
#endif
...
...
modules/lua/libs/variables.c
View file @
17bb975a
...
@@ -263,8 +263,9 @@ static int vlclua_libvlc_command( lua_State *L )
...
@@ -263,8 +263,9 @@ static int vlclua_libvlc_command( lua_State *L )
return
vlclua_push_ret
(
L
,
i_ret
);
return
vlclua_push_ret
(
L
,
i_ret
);
}
}
int
__vlclua_var_toggle_or_set
(
lua_State
*
L
,
vlc_object_t
*
p_obj
,
#undef vlclua_var_toggle_or_set
const
char
*
psz_name
)
int
vlclua_var_toggle_or_set
(
lua_State
*
L
,
vlc_object_t
*
p_obj
,
const
char
*
psz_name
)
{
{
bool
b_bool
;
bool
b_bool
;
if
(
lua_gettop
(
L
)
>
1
)
return
vlclua_error
(
L
);
if
(
lua_gettop
(
L
)
>
1
)
return
vlclua_error
(
L
);
...
...
modules/lua/libs/variables.h
View file @
17bb975a
...
@@ -25,9 +25,10 @@
...
@@ -25,9 +25,10 @@
#ifndef VLC_LUA_VARIABLES_H
#ifndef VLC_LUA_VARIABLES_H
#define VLC_LUA_VARIABLES_H
#define VLC_LUA_VARIABLES_H
#define vlclua_var_toggle_or_set(a,b,c) \
int
vlclua_var_toggle_or_set
(
lua_State
*
,
vlc_object_t
*
,
const
char
*
);
__vlclua_var_toggle_or_set(a,VLC_OBJECT(b),c)
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
#endif
modules/lua/vlc.c
View file @
17bb975a
...
@@ -372,8 +372,9 @@ char *vlclua_find_file( vlc_object_t *p_this, const char *psz_luadirname, const
...
@@ -372,8 +372,9 @@ char *vlclua_find_file( vlc_object_t *p_this, const char *psz_luadirname, const
* Meta data setters utility.
* Meta data setters utility.
* Playlist item table should be on top of the stack when these are called
* 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
,
#undef vlclua_read_meta_data
input_item_t
*
p_input
)
void
vlclua_read_meta_data
(
vlc_object_t
*
p_this
,
lua_State
*
L
,
input_item_t
*
p_input
)
{
{
#define TRY_META( a, b ) \
#define TRY_META( a, b ) \
lua_getfield( L, -1, a ); \
lua_getfield( L, -1, a ); \
...
@@ -406,7 +407,8 @@ void __vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
...
@@ -406,7 +407,8 @@ void __vlclua_read_meta_data( vlc_object_t *p_this, lua_State *L,
TRY_META
(
"trackid"
,
TrackID
);
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
)
input_item_t
*
p_input
)
{
{
/* Lock the input item and create the meta table if needed */
/* Lock the input item and create the meta table if needed */
...
@@ -451,7 +453,8 @@ void __vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
...
@@ -451,7 +453,8 @@ void __vlclua_read_custom_meta_data( vlc_object_t *p_this, lua_State *L,
/**
/**
* Playlist item table should be on top of the stack when this is called
* 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
)
int
*
pi_options
,
char
***
pppsz_options
)
{
{
lua_getfield
(
L
,
-
1
,
"options"
);
lua_getfield
(
L
,
-
1
,
"options"
);
...
@@ -477,7 +480,8 @@ void __vlclua_read_options( vlc_object_t *p_this, lua_State *L,
...
@@ -477,7 +480,8 @@ void __vlclua_read_options( vlc_object_t *p_this, lua_State *L,
lua_pop
(
L
,
1
);
/* pop "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
,
playlist_t
*
p_playlist
,
input_item_t
*
p_parent
,
bool
b_play
)
input_item_t
*
p_parent
,
bool
b_play
)
{
{
...
@@ -750,7 +754,8 @@ static int vlclua_add_modules_path_inner( lua_State *L, const char *psz_path )
...
@@ -750,7 +754,8 @@ static int vlclua_add_modules_path_inner( lua_State *L, const char *psz_path )
return
count
;
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:
/* Setup the module search path:
* * "The script's directory"/modules
* * "The script's directory"/modules
...
...
modules/lua/vlc.h
View file @
17bb975a
...
@@ -135,19 +135,19 @@ int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *url );
...
@@ -135,19 +135,19 @@ int vlclua_dofile( vlc_object_t *p_this, lua_State *L, const char *url );
/*****************************************************************************
/*****************************************************************************
* Playlist and meta data internal utilities.
* Playlist and meta data internal utilities.
*****************************************************************************/
*****************************************************************************/
void
__
vlclua_read_options
(
vlc_object_t
*
,
lua_State
*
,
int
*
,
char
***
);
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
)
#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
*
);
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
)
#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
*
,
void
vlclua_read_custom_meta_data
(
vlc_object_t
*
,
lua_State
*
,
input_item_t
*
);
input_item_t
*
);
#define vlclua_read_custom_meta_data(
a,b,c) __vlclua_read_custom_meta_data(VLC_OBJECT(a),b,c
)
#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
*
,
int
vlclua_playlist_add_internal
(
vlc_object_t
*
,
lua_State
*
,
playlist_t
*
,
input_item_t
*
,
bool
);
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
)
#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
);
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
)
#define vlclua_add_modules_path( a, b, c )
vlclua_add_modules_path( VLC_OBJECT( a ), b, c
)
/**
/**
* Per-interface private state
* Per-interface private state
...
...
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