X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fmisc%2Flua%2Fvlc.h;h=d3187e76beb4ab2b32959e4a4668fde3a8cbc20a;hb=c04668ad5effb61eda668b293aa9aa8e161d369e;hp=e6e13d2ca82be2aabf313413ec67084cb49c2f69;hpb=c58a5af7401735b50fa058fe5ab83d8ae911de4c;p=vlc diff --git a/modules/misc/lua/vlc.h b/modules/misc/lua/vlc.h index e6e13d2ca8..d3187e76be 100644 --- a/modules/misc/lua/vlc.h +++ b/modules/misc/lua/vlc.h @@ -73,7 +73,7 @@ static inline void lua_Dbg( vlc_object_t * p_this, const char * ppz_fmt, ... ) /***************************************************************************** * 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 ); @@ -91,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 *****************************************************************************/