MCPcopy Create free account
hub / github.com/MariaDB/server / json_get_array_item

Function json_get_array_item

strings/json_lib.c:2120–2138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2118}
2119
2120enum json_types json_get_array_item(const char *js, const char *js_end, int n_item,
2121 const char **value, int *value_len)
2122{
2123 json_engine_t je;
2124 enum json_types return_value;
2125 MEM_ROOT current_mem_root;
2126
2127 init_alloc_root(PSI_INSTRUMENT_MEM, &current_mem_root,
2128 BLOCK_SIZE_JSON_DYN_ARRAY, 0, MYF(0));
2129
2130 mem_root_dynamic_array_init(&current_mem_root, PSI_INSTRUMENT_MEM,
2131 &je.stack, sizeof(int), NULL,
2132 JSON_DEPTH_DEFAULT, JSON_DEPTH_INC, MYF(0));
2133 return_value= json_get_array_item_int(&je, js, js_end, n_item, value, value_len);
2134
2135 free_root(&current_mem_root, MYF(0));
2136
2137 return return_value;
2138}
2139
2140
2141/** Simple json lookup for a value by the key.

Callers 2

get_authMethod · 0.85
do_json_arFunction · 0.85

Calls 4

init_alloc_rootFunction · 0.85
json_get_array_item_intFunction · 0.85
free_rootFunction · 0.85

Tested by

no test coverage detected