MCPcopy Create free account
hub / github.com/crawl/crawl / json_decode

Function json_decode

crawl-ref/source/json.cc:390–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388static bool number_is_valid(const char *num);
389
390JsonNode *json_decode(const char *json)
391{
392 const char *s = json;
393 JsonNode *ret;
394
395 skip_space(&s);
396 if (!parse_value(&s, &ret))
397 return nullptr;
398
399 skip_space(&s);
400 if (*s != 0)
401 {
402 json_delete(ret);
403 return nullptr;
404 }
405
406 return ret;
407}
408
409char *json_encode(const JsonNode *node)
410{

Callers 7

handle_inputMethod · 0.85
_on_process_outputMethod · 0.85
_on_socket_messageMethod · 0.85
collect_game_modesFunction · 0.85
update_save_infoMethod · 0.85
on_messageMethod · 0.85

Calls 3

skip_spaceFunction · 0.85
parse_valueFunction · 0.85
json_deleteFunction · 0.85

Tested by

no test coverage detected