]> git.sesse.net Git - vlc/blobdiff - modules/misc/lua/vlc.h
lua: factorize the right way.
[vlc] / modules / misc / lua / vlc.h
index 7bca326a19b544edb31a16232589b33146c044cc..d3187e76beb4ab2b32959e4a4668fde3a8cbc20a 100644 (file)
@@ -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
  *****************************************************************************/
@@ -106,7 +118,7 @@ int vlclua_push_ret( lua_State *, int i_error );
 int vlclua_scripts_batch_execute( vlc_object_t *p_this, const char * luadirname,
         int (*func)(vlc_object_t *, const char *, void *),
         void * user_data );
-int vlclua_dir_list( vlc_object_t *p_this, const char *luadirname, char **ppsz_dir_list );
+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 );