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

Function smart_read_value

strings/json_lib.c:2016–2046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2014
2015
2016static enum json_types smart_read_value(json_engine_t *je,
2017 const char **value, int *value_len)
2018{
2019 if (json_read_value(je))
2020 goto err_return;
2021
2022 *value= (char *) je->value;
2023
2024 if (json_value_scalar(je))
2025 *value_len= je->value_len;
2026 else
2027 {
2028 if (json_skip_level(je))
2029 goto err_return;
2030
2031 *value_len= (int) ((char *) je->s.c_str - *value);
2032 }
2033
2034 compile_time_assert((enum json_types)JSON_VALUE_OBJECT == JSV_OBJECT);
2035 compile_time_assert((enum json_types)JSON_VALUE_ARRAY == JSV_ARRAY);
2036 compile_time_assert((enum json_types)JSON_VALUE_STRING == JSV_STRING);
2037 compile_time_assert((enum json_types)JSON_VALUE_NUMBER == JSV_NUMBER);
2038 compile_time_assert((enum json_types)JSON_VALUE_TRUE == JSV_TRUE);
2039 compile_time_assert((enum json_types)JSON_VALUE_FALSE == JSV_FALSE);
2040 compile_time_assert((enum json_types)JSON_VALUE_NULL == JSV_NULL);
2041
2042 return (enum json_types) je->value_type;
2043
2044err_return:
2045 return JSV_BAD_JSON;
2046}
2047
2048
2049enum json_types json_type_int(json_engine_t *tmp,

Callers 4

json_type_intFunction · 0.85
json_get_array_item_intFunction · 0.85
json_get_object_key_intFunction · 0.85
json_get_object_nkeyFunction · 0.85

Calls 1

json_read_valueFunction · 0.85

Tested by

no test coverage detected