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

Function json_cfg_encode_sparse_array

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

Configures handling of extremely sparse arrays: * convert: Convert extremely sparse arrays into objects? Otherwise error. * ratio: 0: always allow sparse; 1: never allow sparse; >1: use ratio * safe: Always use an array when the max index <= safe */

Source from the content-addressed store, hash-verified

277 * ratio: 0: always allow sparse; 1: never allow sparse; >1: use ratio
278 * safe: Always use an array when the max index <= safe */
279static int json_cfg_encode_sparse_array(lua_State *l)
280{
281 json_config_t *cfg = json_arg_init(l, 3);
282
283 json_enum_option(l, 1, &cfg->encode_sparse_convert, NULL, 1);
284 json_integer_option(l, 2, &cfg->encode_sparse_ratio, 0, INT_MAX);
285 json_integer_option(l, 3, &cfg->encode_sparse_safe, 0, INT_MAX);
286
287 return 3;
288}
289
290/* Configures the maximum number of nested arrays/objects allowed when
291 * encoding */

Callers

nothing calls this directly

Calls 3

json_arg_initFunction · 0.85
json_enum_optionFunction · 0.85
json_integer_optionFunction · 0.85

Tested by

no test coverage detected