@@ -60,12 +60,14 @@ pub const LUA_SHARED_RAW: Lazy<Library> = Lazy::new(|| {
6060use std:: path:: PathBuf ;
6161use once_cell:: sync:: Lazy ;
6262use crate :: types:: * ;
63- use crate :: globals:: Lua :: GLOBALSINDEX ;
63+ use crate :: globals:: Lua :: { self , GLOBALSINDEX } ;
6464
6565// Load lua Code
6666expose_symbol ! ( luaL_loadbufferx, CInt , ( state: LuaState , code: CharBuf , size: SizeT , id: CharBuf , mode: CharBuf ) ) ;
6767expose_symbol ! ( luaL_loadbuffer, CInt , ( state: LuaState , code: CharBuf , size: SizeT , id: CharBuf ) ) ;
6868expose_symbol ! ( luaL_loadstring, CInt , ( state: LuaState , code: CharBuf ) ) ;
69+ expose_symbol ! ( luaL_loadfile, CInt , ( state: LuaState , filename: CharBuf ) ) ;
70+ expose_symbol ! ( luaL_loadfilex, CInt , ( state: LuaState , filename: CharBuf , mode: CharBuf ) ) ;
6971
7072// Call lua code
7173expose_symbol ! ( lua_pcall, CInt , ( state: LuaState , nargs: CInt , nresults: CInt , msgh: CInt ) ) ;
@@ -119,7 +121,7 @@ expose_symbol!( lua_pushfstring, CharBuf, (state: LuaState, fmt: CharBuf, ...) )
119121// Type Checks
120122expose_symbol ! ( luaL_checkinteger, LuaInteger , ( state: LuaState , narg: CInt ) ) ;
121123expose_symbol ! ( luaL_checknumber, LuaNumber , ( state: LuaState , narg: CInt ) ) ;
122- expose_symbol ! ( luaL_checklstring, CharBuf , ( state: LuaState , narg: CInt ) ) ;
124+ expose_symbol ! ( luaL_checklstring, CharBuf , ( state: LuaState , narg: CInt , len : SizeT ) ) ;
123125
124126// Type Checks that return nothing
125127expose_symbol ! ( luaL_checkstack, ( ) , ( state: LuaState , size: CInt , msg: CharBuf ) ) ;
@@ -150,6 +152,26 @@ expose_symbol!( lua_rawequal, CInt, (state: LuaState, ind1: CInt, ind2: CInt) );
150152// Raising Errors
151153expose_symbol ! ( luaL_typerror, CInt , ( state: LuaState , narg: CInt , typename: CharBuf ) ) ;
152154
155+ // Open
156+ expose_symbol ! ( luaopen_table, CInt , ( state: LuaState ) ) ;
157+ expose_symbol ! ( luaopen_string, CInt , ( state: LuaState ) ) ;
158+ expose_symbol ! ( luaopen_package, CInt , ( state: LuaState ) ) ;
159+ expose_symbol ! ( luaopen_os, CInt , ( state: LuaState ) ) ;
160+ expose_symbol ! ( luaopen_math, CInt , ( state: LuaState ) ) ;
161+ expose_symbol ! ( luaopen_jit, CInt , ( state: LuaState ) ) ;
162+ expose_symbol ! ( luaopen_debug, CInt , ( state: LuaState ) ) ;
163+ expose_symbol ! ( luaopen_bit, CInt , ( state: LuaState ) ) ;
164+ expose_symbol ! ( luaopen_base, CInt , ( state: LuaState ) ) ;
165+ expose_symbol ! ( luaL_openlib, CInt , ( state: LuaState ) ) ;
166+
167+ // Ref
168+ expose_symbol ! ( luaL_ref, CInt , ( state: LuaState , t: CInt ) ) ;
169+ expose_symbol ! ( luaL_unref, ( ) , ( state: LuaState , t: CInt , r: CInt ) ) ;
170+
171+ // Metatables
172+ expose_symbol ! ( luaL_newmetatable, CInt , ( state: LuaState , tname: CharBuf ) ) ;
173+ expose_symbol ! ( luaL_newmetatable_type, CInt , ( state: LuaState , tname: CharBuf , typ: CInt ) ) ;
174+
153175#[ inline( always) ]
154176pub fn lua_pop ( state : LuaState , ind : CInt ) {
155177 lua_settop ( state, -( ind) -1 ) ;
0 commit comments