X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fmisc%2Flua%2Fvlc.h;h=d3187e76beb4ab2b32959e4a4668fde3a8cbc20a;hb=c04668ad5effb61eda668b293aa9aa8e161d369e;hp=ba7fd052835dfcf8430b4023ff7a5b1b0d1c78ae;hpb=555cb288eea92ac9b2b5416225f678323f439ece;p=vlc diff --git a/modules/misc/lua/vlc.h b/modules/misc/lua/vlc.h index ba7fd05283..d3187e76be 100644 --- a/modules/misc/lua/vlc.h +++ b/modules/misc/lua/vlc.h @@ -35,11 +35,6 @@ #include #include #include -#include - -#ifdef HAVE_SYS_STAT_H -# include -#endif #include /* Low level lua C API */ #include /* Higher level C API */ @@ -49,7 +44,7 @@ * Module entry points *****************************************************************************/ int ReadMeta( vlc_object_t * ); - +int FetchMeta( vlc_object_t * ); int FindArt( vlc_object_t * ); int Import_LuaPlaylist( vlc_object_t * ); @@ -58,6 +53,11 @@ void Close_LuaPlaylist( vlc_object_t * ); int Open_LuaIntf( vlc_object_t * ); void Close_LuaIntf( vlc_object_t * ); +int Open_Extension( vlc_object_t * ); +void Close_Extension( vlc_object_t * ); + +int Open_LuaSD( vlc_object_t * ); +void Close_LuaSD( vlc_object_t * ); /***************************************************************************** * Lua debug @@ -66,15 +66,14 @@ static inline void lua_Dbg( vlc_object_t * p_this, const char * ppz_fmt, ... ) { va_list ap; va_start( ap, ppz_fmt ); - __msg_GenericVa( ( vlc_object_t *)p_this, VLC_MSG_DBG, MODULE_STRING, - ppz_fmt, ap ); + msg_GenericVa( p_this, VLC_MSG_DBG, MODULE_STRING, ppz_fmt, ap ); va_end( ap ); } /***************************************************************************** * Functions that should be in lua ... but aren't for some obscure reason *****************************************************************************/ -static inline int luaL_checkboolean( lua_State *L, int narg ) +static inline bool luaL_checkboolean( lua_State *L, int narg ) { luaL_checktype( L, narg, LUA_TBOOLEAN ); /* can raise an error */ return lua_toboolean( L, narg ); @@ -92,8 +91,20 @@ static inline const char *luaL_nilorcheckstring( lua_State *L, int narg ) return luaL_checkstring( L, narg ); } +static inline char *luaL_strdupornull( lua_State *L, int narg ) +{ + if( lua_isstring( L, narg ) ) + return strdup( luaL_checkstring( L, narg ) ); + return NULL; +} + +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 *****************************************************************************/ @@ -105,10 +116,11 @@ int vlclua_push_ret( lua_State *, int i_error ); * success. *****************************************************************************/ int vlclua_scripts_batch_execute( vlc_object_t *p_this, const char * luadirname, - int (*func)(vlc_object_t *, const char *, lua_State *, void *), - lua_State * L, void * user_data ); -int vlclua_dir_list( vlc_object_t *p_this, const char *luadirname, char **ppsz_dir_list ); + int (*func)(vlc_object_t *, const char *, void *), + void * user_data ); +int vlclua_dir_list( vlc_object_t *p_this, const char *luadirname, char ***pppsz_dir_list ); void vlclua_dir_list_free( char **ppsz_dir_list ); +char *vlclua_find_file( vlc_object_t *p_this, const char *psz_luadirname, const char *psz_name ); /***************************************************************************** * Playlist and meta data internal utilities. @@ -124,6 +136,9 @@ 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 */