Example #1
0
func main() {
	l := LuaL_newstate()
	LuaL_openlibs(l)

	LuaL_newlib(l, C.lfuncs())
	Lua_setglobal(l, "GoLib")

	LuaL_dostring(l, `GoLib.myGoCFunc('world')`)
	LuaL_dostring(l, `GoLib.anotherGoCFunc()`)

	Lua_close(l)
}
Example #2
0
func main() {
	l := LuaL_newstate()
	LuaL_openlibs(l)

	Lua_pushglobaltable(l)
	LuaL_setfuncs(l, C.lfuncs(), 0)

	LuaL_dostring(l, `myGoCFunc('world')`)
	LuaL_dostring(l, `anotherGoCFunc()`)

	Lua_close(l)
}