本文整理匯總了Golang中C.lua_rawseti函數的典型用法代碼示例。如果您正苦於以下問題:Golang lua_rawseti函數的具體用法?Golang lua_rawseti怎麽用?Golang lua_rawseti使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了lua_rawseti函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: unpackArrayToLua
func unpackArrayToLua(state State, a *P.Array) {
L := state.L
n := len(a.Elems)
C.lua_createtable(L, C.int(n), 0)
for i := 0; i < n; i++ {
UnpackObjectToLua(state, a.Elems[i])
C.lua_rawseti(L, C.int(-2), C.int(i+1))
}
}
示例2: luaKeys
func luaKeys(state State) int {
L := state.L
vmap := mustBeMap(state, 2)
if vmap == nil {
C.lua_pushnil(L)
pushStringToLua(L, "Keys() only apply to `map'")
return 2
}
vkeys := vmap.MapKeys()
C.lua_createtable(L, C.int(len(vkeys)), 0)
for i := 0; i < len(vkeys); i++ {
if !state.goToLuaValue(vkeys[i]) {
continue
}
C.lua_rawseti(L, C.int(-2), C.int(i+1))
}
return 1
}
示例3: RawSeti
// lua_rawseti
func (L *State) RawSeti(index int, n int) {
C.lua_rawseti(L.s, C.int(index), C.int(n))
}
示例4: Rawseti
// Does the equivalent of t[n] = v, where t is the value at the given valid
// index and v is the value at the top of the stack.
//
// This function pops the value from the stack. The assignment is raw;
// that is, it does not invoke metamethods.
func (this *State) Rawseti(index, n int) {
C.lua_rawseti(this.luastate, C.int(index), C.int(n))
}
示例5: Rawseti
// Does the equivalent of t[n] = v, where t is the value at the given valid
// index and v is the value at the top of the stack.
//
// This function pops the value from the stack. The assignment is raw;
// that is, it does not invoke metamethods.
func (s *State) Rawseti(index, n int) {
C.lua_rawseti(s.l, C.int(index), C.int(n))
}