15 #define RZ_JSON_REPORT_ERROR(msg, p) fprintf(stderr, "RZ_JSON PARSE ERROR (%d): " msg " at %s\n", __LINE__, p)
17 #define RZ_JSON_REPORT_ERROR(msg, p) \
100 ut8 high = 0, low = 0;
106 if ((codepoint & 0xfc00) == 0xd800) {
114 if ((codepoint2 & 0xfc00) != 0xdc00) {
118 codepoint = 0x10000 + ((codepoint - 0xd800) << 10) + (codepoint2 - 0xdc00);
151 p = strchr(
p + 1,
'/');
167 p = strchr(
p + 2,
'\n');
173 }
else if (
p[1] ==
'*') {
239 const char *new_key =
NULL;
265 }
else if (*
p ==
'}') {
295 }
else if (*
p ==
']') {
327 js->
num.s_value = (
st64)strtoll(
p, &pe, 10);
329 js->
num.u_value = (
ut64)strtoull(
p, &pe, 10);
331 if (pe ==
p || errno ==
ERANGE) {
335 if (*pe ==
'.' || *pe ==
'e' || *pe ==
'E') {
338 js->
num.dbl_value = strtod(
p, &pe);
339 if (pe ==
p || errno ==
ERANGE) {
345 js->
num.dbl_value = (double)js->
num.s_value;
347 js->
num.dbl_value = (double)js->
num.u_value;
353 if (!strncmp(
p,
"true", 4)) {
361 if (!strncmp(
p,
"false", 5)) {
369 if (!strncmp(
p,
"null", 4)) {
398 if (js->
key && !strncmp(js->
key,
key, keysize)) {
446 for (keysize = 0;
key[keysize]; ++keysize) {
447 if (strchr(
".[",
key[keysize])) {
467 return (js == json) ?
NULL : js;
472 switch (json->
type) {
474 if (with_key && json->
key) {
482 if (with_key && json->
key) {
488 for (baby = json->
children.first; baby; baby = baby->
next) {
496 if (with_key && json->
key) {
502 for (baby = json->
children.first; baby; baby = baby->
next) {
510 if (with_key && json->
key) {
518 if (with_key && json->
key) {
526 if (with_key && json->
key) {
534 if (with_key && json->
key) {
537 pj_b(pj, (
bool)json->
num.u_value);
550 if (with_key && json->
key) {
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
RZ_API void Ht_() free(HtName_(Ht) *ht)
static char * parse_key(const char **key, char *p)
static RzJson * json_new(void)
static char * skip_block_comment(char *ps)
#define RZ_JSON_REPORT_ERROR(msg, p)
RZ_API const RzJson * rz_json_get_path(const RzJson *json, const char *path)
RZ_API const RzJson * rz_json_get(const RzJson *json, const char *key)
static void json_pj_recurse(const RzJson *json, PJ *pj, bool with_key)
static char * parse_value(RzJson *parent, const char *key, char *p)
RZ_API RzJson * rz_json_parse(char *text)
static RzJson * create_json(RzJsonType type, const char *key, RzJson *parent)
RZ_API void rz_json_free(RzJson *js)
static char * skip_whitespace(char *p)
static const RzJson * rz_json_get_len(const RzJson *json, const char *key, size_t keysize)
RZ_API RZ_OWN char * rz_json_as_string(const RzJson *json, bool with_key)
RZ_API const RzJson * rz_json_item(const RzJson *json, size_t idx)
static char * unescape_string(char *s, char **end)
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
RZ_API bool rz_hex_to_byte(ut8 *val, ut8 c)
enum rz_json_type_t RzJsonType
RZ_API PJ * pj_S(PJ *j, const char *k)
RZ_API PJ * pj_ko(PJ *j, const char *k)
RZ_API PJ * pj_ka(PJ *j, const char *k)
RZ_API PJ * pj_kb(PJ *j, const char *k, bool v)
RZ_API char * pj_drain(PJ *j)
RZ_API PJ * pj_b(PJ *j, bool v)
RZ_API PJ * pj_end(PJ *j)
RZ_API PJ * pj_knull(PJ *j, const char *k)
RZ_API PJ * pj_d(PJ *j, double d)
RZ_API PJ * pj_null(PJ *j)
RZ_API PJ * pj_s(PJ *j, const char *k)
RZ_API PJ * pj_ks(PJ *j, const char *k, const char *v)
RZ_API PJ * pj_N(PJ *j, st64 n)
RZ_API PJ * pj_kd(PJ *j, const char *k, double d)
RZ_API PJ * pj_kN(PJ *j, const char *k, st64 n)
RZ_API int rz_utf8_encode(ut8 *ptr, const RzRune ch)
struct rz_json_t::@304::@307 children
struct rz_json_t::@304::@306 num
ut64(WINAPI *w32_GetEnabledXStateFeatures)()