MCPcopy Create free account
hub / github.com/RyouZhang/go-lua / pushMapToLua

Function pushMapToLua

wapper.go:158–168  ·  view source on GitHub ↗
(L *C.struct_lua_State, data map[string]interface{})

Source from the content-addressed store, hash-verified

156}
157
158func pushMapToLua(L *C.struct_lua_State, data map[string]interface{}) {
159 C.glua_createtable(L, 0, 0)
160 if len(data) == 0 {
161 return
162 }
163 for key, value := range data {
164 C.glua_pushlstring(L, C.CString(key), C.size_t(len([]byte(key))))
165 pushToLua(L, value)
166 C.glua_settable(L, -3)
167 }
168}
169
170func pullLuaTable(_L *C.struct_lua_State) interface{} {
171 keys := make([]interface{}, 0)

Callers 1

pushToLuaFunction · 0.85

Calls 1

pushToLuaFunction · 0.85

Tested by

no test coverage detected