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 */
| 266 | * ratio: 0: always allow sparse; 1: never allow sparse; >1: use ratio |
| 267 | * safe: Always use an array when the max index <= safe */ |
| 268 | static int json_cfg_encode_sparse_array(lua_State *l) |
| 269 | { |
| 270 | json_config_t *cfg = json_arg_init(l, 3); |
| 271 | |
| 272 | json_enum_option(l, 1, &cfg->encode_sparse_convert, NULL, 1); |
| 273 | json_integer_option(l, 2, &cfg->encode_sparse_ratio, 0, INT_MAX); |
| 274 | json_integer_option(l, 3, &cfg->encode_sparse_safe, 0, INT_MAX); |
| 275 | |
| 276 | return 3; |
| 277 | } |
| 278 | |
| 279 | /* Configures the maximum number of nested arrays/objects allowed when |
| 280 | * encoding */ |
nothing calls this directly
no test coverage detected