llgo/c/lua:link style

This commit is contained in:
luoliwoshang
2024-07-13 22:57:01 +08:00
parent 9edeee4b3f
commit de4b5b70da
12 changed files with 225 additions and 183 deletions

View File

@@ -8,15 +8,19 @@ import (
)
func main() {
L := lua.NewState()
L := lua.Newstate()
defer L.Close()
L.OpenLibs()
if res := L.LoadString(c.Str("print('hello world')")); res != lua.OK {
L.Openlibs()
if res := L.Loadstring(c.Str("print('hello world')")); res != lua.OK {
println("error")
}
if res := L.PCall(0, 0, 0); res != lua.OK {
if res := L.Pcall(0, 0, 0); res != lua.OK {
println("error")
}
}
/* Expected output:
hello world
*/