MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / mp_decode_to_lua_array

Function mp_decode_to_lua_array

deps/lua/src/lua_cmsgpack.c:551–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549void mp_decode_to_lua_type(lua_State *L, mp_cur *c);
550
551void mp_decode_to_lua_array(lua_State *L, mp_cur *c, size_t len) {
552 assert(len <= UINT_MAX);
553 int index = 1;
554
555 lua_newtable(L);
556 luaL_checkstack(L, 1, "in function mp_decode_to_lua_array");
557 while(len--) {
558 lua_pushnumber(L,index++);
559 mp_decode_to_lua_type(L,c);
560 if (c->err) return;
561 lua_settable(L,-3);
562 }
563}
564
565void mp_decode_to_lua_hash(lua_State *L, mp_cur *c, size_t len) {
566 assert(len <= UINT_MAX);

Callers 1

lua_cmsgpack.cFile · 0.85

Calls 3

luaL_checkstackFunction · 0.85
lua_pushnumberFunction · 0.85
lua_settableFunction · 0.85

Tested by

no test coverage detected