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 */
| 317 | * ratio: 0: always allow sparse; 1: never allow sparse; >1: use ratio |
| 318 | * safe: Always use an array when the max index <= safe */ |
| 319 | static int json_cfg_encode_sparse_array(lua_State *l) |
| 320 | { |
| 321 | json_config_t *cfg = json_arg_init(l, 3); |
| 322 | |
| 323 | json_enum_option(l, 1, &cfg->encode_sparse_convert, NULL, 1); |
| 324 | json_integer_option(l, 2, &cfg->encode_sparse_ratio, 0, INT_MAX); |
| 325 | json_integer_option(l, 3, &cfg->encode_sparse_safe, 0, INT_MAX); |
| 326 | |
| 327 | return 3; |
| 328 | } |
| 329 | |
| 330 | /* Configures the maximum number of nested arrays/objects allowed when |
| 331 | * encoding */ |
nothing calls this directly
no test coverage detected