當前位置: 首頁>>代碼示例>>Golang>>正文


Golang C.lua_rawseti函數代碼示例

本文整理匯總了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))
	}
}
開發者ID:hxyxj,項目名稱:goinfi,代碼行數:9,代碼來源:pack.go

示例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
}
開發者ID:hxyxj,項目名稱:goinfi,代碼行數:20,代碼來源:golang.go

示例3: RawSeti

// lua_rawseti
func (L *State) RawSeti(index int, n int) {
	C.lua_rawseti(L.s, C.int(index), C.int(n))
}
開發者ID:szll,項目名稱:golua,代碼行數:4,代碼來源:lua.go

示例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))
}
開發者ID:rdlaitila,項目名稱:leaf,代碼行數:8,代碼來源:State.go

示例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))
}
開發者ID:halturin,項目名稱:luajit,代碼行數:8,代碼來源:state.go


注:本文中的C.lua_rawseti函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。