diff --git a/mlua-sys/Cargo.toml b/mlua-sys/Cargo.toml index d85ea96..dcf709d 100644 --- a/mlua-sys/Cargo.toml +++ b/mlua-sys/Cargo.toml @@ -38,9 +38,9 @@ module = [] cc = "1.0" cfg-if = "1.0" pkg-config = "0.3.17" -lua-src = { version = ">= 547.0.0, < 547.1.0", optional = true } -luajit-src = { version = ">= 210.5.0, < 210.6.0", optional = true } -luau0-src = { git = "https://github.com/mlua-rs/luau-src-rs", rev = "dc1102e", optional = true } +lua-src = { version = ">= 547.1.0, < 547.2.0", optional = true } +luajit-src = { version = ">= 210.6.0, < 210.7.0", optional = true } +luau0-src = { version = "0.14.2", optional = true } [lints.rust] unexpected_cfgs = { level = "allow", check-cfg = ['cfg(raw_dylib)'] } diff --git a/mlua-sys/src/luau/luarequire.rs b/mlua-sys/src/luau/luarequire.rs index 89daf91..30a7267 100644 --- a/mlua-sys/src/luau/luarequire.rs +++ b/mlua-sys/src/luau/luarequire.rs @@ -101,7 +101,9 @@ pub struct luarequire_Configuration { // Executes the module and places the result on the stack. Returns the number of results placed on the // stack. - pub load: unsafe extern "C" fn( + // Returning -1 directs the requiring thread to yield. In this case, this thread should be resumed with + // the module result pushed onto its stack. + pub load: unsafe extern "C-unwind" fn( L: *mut lua_State, ctx: *mut c_void, path: *const c_char, @@ -140,4 +142,11 @@ extern "C-unwind" { // required. // Expects the path and table to be passed as arguments on the stack. pub fn luarequire_registermodule(L: *mut lua_State) -> c_int; + + // Clears the entry associated with the given cache key from the require cache. + // Expects the cache key to be passed as an argument on the stack. + pub fn luarequire_clearcacheentry(L: *mut lua_State) -> c_int; + + // Clears all entries from the require cache. + pub fn luarequire_clearcache(L: *mut lua_State) -> c_int; }