pub fn lua_load(
l: LuaState,
reader: LuaReader,
data: *mut c_void,
chunkname: LuaString,
) -> c_intExpand description
Loads a Lua chunk. If there are no errors, this pushes the compiled chunk as a Lua function on top of the stack. Otherwise, it pushes an error message.
§Parameters
l- Lua state,reader- LuaReader function used to read the chunk.data- Opaque value (userdata) passed to the reader functionchunkname- Name to identify the chunk, used in error messages / debugging.
§Returns
§Notes
- This function only loads a chunk; it does not run it.
- lua_load automatically detects whether the chunk is text or binary, and loads it accordingly.