xlua和lua

  • lua_rawgeti(lua_State *L, int index, int key)  和   lua_rawseti(lua_State *L, int index, int key)

  index表示table在栈中的位置,key表示元素在table中的位置。假设t为正数

  那么调用lua_rawgeti(L,t,key)等价于

  lua_pushnumber(L,key);

  lua_rawget(L, t);

 

  lua_rawgeti表示将栈中index的table中索引为key的元素放到栈顶

  lua_rawseti表示将栈顶元素给栈中index位置的表格中的第key参数,同时栈顶元素出栈。

posted on 2019-03-05 17:29  bestan  阅读(618)  评论(0)    收藏  举报