Skip to content

Commit 9fda2ec

Browse files
committedApr 25, 2025
mlua-sys: Update Luau to 0.671
1 parent 21fc924 commit 9fda2ec

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed
 

‎mlua-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cfg-if = "1.0"
4040
pkg-config = "0.3.17"
4141
lua-src = { version = ">= 547.0.0, < 547.1.0", optional = true }
4242
luajit-src = { version = ">= 210.5.0, < 210.6.0", optional = true }
43-
luau0-src = { git = "https://github.com/mlua-rs/luau-src-rs", rev = "37e1e34", optional = true }
43+
luau0-src = { git = "https://github.com/mlua-rs/luau-src-rs", rev = "dc1102e", optional = true }
4444

4545
[lints.rust]
4646
unexpected_cfgs = { level = "allow", check-cfg = ['cfg(raw_dylib)'] }

‎mlua-sys/src/luau/lauxlib.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,17 @@ extern "C-unwind" {
7171

7272
pub fn luaL_newstate() -> *mut lua_State;
7373

74-
// TODO: luaL_findtable
74+
pub fn luaL_findtable(
75+
L: *mut lua_State,
76+
idx: c_int,
77+
fname: *const c_char,
78+
szhint: c_int,
79+
) -> *const c_char;
7580

7681
pub fn luaL_typename(L: *mut lua_State, idx: c_int) -> *const c_char;
7782

83+
pub fn luaL_callyieldable(L: *mut lua_State, nargs: c_int, nresults: c_int) -> c_int;
84+
7885
// sandbox libraries and globals
7986
#[link_name = "luaL_sandbox"]
8087
pub fn luaL_sandbox_(L: *mut lua_State);

‎mlua-sys/src/luau/luarequire.rs

+19-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ pub struct luarequire_Configuration {
104104
pub load: unsafe extern "C-unwind" fn(
105105
L: *mut lua_State,
106106
ctx: *mut c_void,
107+
path: *const c_char,
107108
chunkname: *const c_char,
108109
contents: *const c_char,
109110
) -> c_int,
@@ -114,12 +115,29 @@ pub type luarequire_Configuration_init = unsafe extern "C" fn(config: *mut luare
114115

115116
extern "C-unwind" {
116117
// Initializes and pushes the require closure onto the stack without registration.
117-
pub fn lua_pushrequire(
118+
pub fn luarequire_pushrequire(
118119
L: *mut lua_State,
119120
config_init: luarequire_Configuration_init,
120121
ctx: *mut c_void,
121122
) -> c_int;
122123

123124
// Initializes the require library and registers it globally.
124125
pub fn luaopen_require(L: *mut lua_State, config_init: luarequire_Configuration_init, ctx: *mut c_void);
126+
127+
// Initializes and pushes a "proxyrequire" closure onto the stack.
128+
//
129+
// The closure takes two parameters: the string path to resolve and the chunkname of an existing
130+
// module.
131+
pub fn luarequire_pushproxyrequire(
132+
L: *mut lua_State,
133+
config_init: luarequire_Configuration_init,
134+
ctx: *mut c_void,
135+
) -> c_int;
136+
137+
// Registers an aliased require path to a result.
138+
//
139+
// After registration, the given result will always be immediately returned when the given path is
140+
// required.
141+
// Expects the path and table to be passed as arguments on the stack.
142+
pub fn luarequire_registermodule(L: *mut lua_State) -> c_int;
125143
}

0 commit comments

Comments
 (0)
Please sign in to comment.