theseus_mlua_sys/lua_factorio/
lualib.rs

1//! Contains definitions from `lualib.h`.
2
3use std::os::raw::{c_char, c_int};
4
5use super::lua::lua_State;
6
7pub const LUA_COLIBNAME: *const c_char = cstr!("coroutine");
8pub const LUA_TABLIBNAME: *const c_char = cstr!("table");
9pub const LUA_IOLIBNAME: *const c_char = cstr!("io");
10pub const LUA_OSLIBNAME: *const c_char = cstr!("os");
11pub const LUA_STRLIBNAME: *const c_char = cstr!("string");
12pub const LUA_BITLIBNAME: *const c_char = cstr!("bit32");
13pub const LUA_MATHLIBNAME: *const c_char = cstr!("math");
14pub const LUA_DBLIBNAME: *const c_char = cstr!("debug");
15pub const LUA_LOADLIBNAME: *const c_char = cstr!("package");
16
17extern "C-unwind" {
18    pub fn luaopen_base(L: *mut lua_State) -> c_int;
19    //pub fn luaopen_coroutine(L: *mut lua_State) -> c_int;
20    pub fn luaopen_table(L: *mut lua_State) -> c_int;
21    //pub fn luaopen_io(L: *mut lua_State) -> c_int;
22    //pub fn luaopen_os(L: *mut lua_State) -> c_int;
23    pub fn luaopen_string(L: *mut lua_State) -> c_int;
24    pub fn luaopen_bit32(L: *mut lua_State) -> c_int;
25    pub fn luaopen_math(L: *mut lua_State) -> c_int;
26    pub fn luaopen_debug(L: *mut lua_State) -> c_int;
27    pub fn luaopen_package(L: *mut lua_State) -> c_int;
28
29    // open all builtin libraries
30    pub fn luaL_openlibs(L: *mut lua_State);
31}