当前位置: 首页>>代码示例>>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;未经允许,请勿转载。