http://timothyqiu.com/archives/lua-note-table-traversal-using-c-api/ C API 遍历 Table lua_getglobal(L, t); int index = lua_gettop(L); lua_pushnil(L); while (lua_next(L, index)) { /* 此时栈上 -1 处为 value, -2 处为 key */ lua_pop(L, ); } lua_next 函数针对 -2 处(参数指定…