feat: include open bindings for lauxlib

This commit is contained in:
Erica Marigold 2024-07-21 12:41:38 +05:30
parent 7c8932710f
commit 982735a0a4
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1

View file

@ -234,4 +234,60 @@ func LOptString(L *LuaState, n int32, d string) string {
return LOptLString(L, n, d, nil)
}
const (
LUA_COLIBNAME = "coroutine"
LUA_TABLIBNAME = "table"
LUA_OSLIBNAME = "os"
LUA_STRLIBNAME = "string"
LUA_BITLIBNAME = "bit32"
LUA_BUFFERLIBNAME = "buffer"
LUA_UTF8LIBNAME = "utf8"
LUA_MATHLIBNAME = "math"
LUA_DBLIBNAME = "debug"
)
func OpenBase(L *LuaState) int32 {
return int32(C.luaopen_base(L))
}
func OpenCoroutine(L *LuaState) int32 {
return int32(C.luaopen_coroutine(L))
}
func OpenTable(L *LuaState) int32 {
return int32(C.luaopen_table(L))
}
func OpenOS(L *LuaState) int32 {
return int32(C.luaopen_os(L))
}
func OpenString(L *LuaState) int32 {
return int32(C.luaopen_string(L))
}
func OpenBit32(L *LuaState) int32 {
return int32(C.luaopen_bit32(L))
}
func OpenBuffer(L *LuaState) int32 {
return int32(C.luaopen_buffer(L))
}
func OpenUtf8(L *LuaState) int32 {
return int32(C.luaopen_utf8(L))
}
func OpenMath(L *LuaState) int32 {
return int32(C.luaopen_math(L))
}
func OpenDebug(L *LuaState) int32 {
return int32(C.luaopen_debug(L))
}
func OpenLibs(L *LuaState) {
C.luaL_openlibs(L)
}
// TODO: More utility functions, buffer bindings