MCPcopy Create free account
hub / github.com/axmolengine/axmol / json_append_array

Function json_append_array

3rdparty/lua/lua-cjson/lua_cjson.c:577–597  ·  view source on GitHub ↗

json_append_array args: * - lua_State * - JSON strbuf * - Size of passwd Lua array (top of stack) */

Source from the content-addressed store, hash-verified

575 * - JSON strbuf
576 * - Size of passwd Lua array (top of stack) */
577static void json_append_array(lua_State *l, json_config_t *cfg, int current_depth,
578 strbuf_t *json, int array_length)
579{
580 int comma, i;
581
582 strbuf_append_char(json, '[');
583
584 comma = 0;
585 for (i = 1; i <= array_length; i++) {
586 if (comma)
587 strbuf_append_char(json, ',');
588 else
589 comma = 1;
590
591 lua_rawgeti(l, -1, i);
592 json_append_data(l, cfg, current_depth, json);
593 lua_pop(l, 1);
594 }
595
596 strbuf_append_char(json, ']');
597}
598
599static void json_append_number(lua_State *l, json_config_t *cfg,
600 strbuf_t *json, int lindex)

Callers 1

json_append_dataFunction · 0.85

Calls 3

strbuf_append_charFunction · 0.85
lua_rawgetiFunction · 0.85
json_append_dataFunction · 0.85

Tested by

no test coverage detected