--- libelwix/example/test_json.c 2017/11/30 13:46:27 1.2 +++ libelwix/example/test_json.c 2018/03/07 12:29:28 1.3 @@ -49,21 +49,21 @@ run_simple(json_t *json) } else printf("(strict) We parsed %d tokens next=%lu\n", ret, json->h_next); - if (!(tok = json_findbykey(teststr, "boza s kosmi", toks, ret))) + if (!(tok = json_findbykey(teststr, "boza s kosmi", J_UNDEF, toks, ret))) printf("Key=\"boza s kosmi\" not found!\n"); - tok = json_findbykey(teststr, "user", toks, ret); + tok = json_findbykey(teststr, "user", J_UNDEF, toks, ret); if (tok) { v = json_token2val(teststr, tok); printf("Key=\"user\" data parent=%ld idx=%ld size=%ld type=%d %s\n", tok->tok_parent, tok->tok_idx, tok->tok_size, tok->tok_type, AIT_GET_STR(v)); ait_freeVar(&v); } - tok = json_findbykey(teststr, "admin", toks, ret); + tok = json_findbykey(teststr, "admin", J_VALUE, toks, ret); if (tok) { str = json_token2str(teststr, tok); printf("Key=\"admin\" data parent=%ld idx=%ld size=%ld type=%d %s\n", tok->tok_parent, tok->tok_idx, tok->tok_size, tok->tok_type, str); e_free(str); } - tok = json_findbykey(teststr, "uid", toks, ret); + tok = json_findbykey(teststr, "uid", J_UNDEF, toks, ret); if (tok) { printf("Key=\"uid\" data parent=%ld idx=%ld size=%ld type=%d %ld\n", tok->tok_parent, tok->tok_idx, tok->tok_size, tok->tok_type, json_token2num(teststr, tok)); @@ -73,7 +73,7 @@ run_simple(json_t *json) ait_freeVars(&arr); } - tok = json_findbykey(teststr, "groups", toks, ret); + tok = json_findbykey(teststr, "groups", J_UNDEF, toks, ret); if (tok) { str = json_token2str(teststr, tok); arr = json_token2array(teststr, tok); @@ -84,7 +84,7 @@ run_simple(json_t *json) ait_freeVars(&arr); } - tok = json_findbykey(teststr, "objects", toks, ret); + tok = json_findbykey(teststr, "objects", J_UNDEF, toks, ret); if (tok) { str = json_token2str(teststr, tok); arr = json_token2array(teststr, tok); @@ -95,7 +95,7 @@ run_simple(json_t *json) ait_freeVars(&arr); } - tok = json_findbykey(teststr, "testend", toks, ret); + tok = json_findbykey(teststr, "testend", J_UNDEF, toks, ret); if (tok) { str = json_token2str(teststr, tok); arr = json_token2array(teststr, tok);