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

Function json_cfg_encode_keep_buffer

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

Configures JSON encoding buffer persistence */

Source from the content-addressed store, hash-verified

315
316/* Configures JSON encoding buffer persistence */
317static int json_cfg_encode_keep_buffer(lua_State *l)
318{
319 json_config_t *cfg = json_arg_init(l, 1);
320 int old_value;
321
322 old_value = cfg->encode_keep_buffer;
323
324 json_enum_option(l, 1, &cfg->encode_keep_buffer, NULL, 1);
325
326 /* Init / free the buffer if the setting has changed */
327 if (old_value ^ cfg->encode_keep_buffer) {
328 if (cfg->encode_keep_buffer)
329 strbuf_init(&cfg->encode_buf, 0);
330 else
331 strbuf_free(&cfg->encode_buf);
332 }
333
334 return 1;
335}
336
337#if defined(DISABLE_INVALID_NUMBERS) && !defined(USE_INTERNAL_FPCONV)
338void json_verify_invalid_number_setting(lua_State *l, int *setting)

Callers

nothing calls this directly

Calls 4

json_arg_initFunction · 0.85
json_enum_optionFunction · 0.85
strbuf_initFunction · 0.85
strbuf_freeFunction · 0.85

Tested by

no test coverage detected