version 1.1.2.1, 2017/11/28 00:46:53
|
version 1.1.2.3, 2017/11/28 02:05:21
|
Line 10 int
|
Line 10 int
|
run_simple(json_t *json) |
run_simple(json_t *json) |
{ |
{ |
static const char *teststr = "{\"user\": \"johndoe\", \"admin\": false, \"uid\": 1000,\n " |
static const char *teststr = "{\"user\": \"johndoe\", \"admin\": false, \"uid\": 1000,\n " |
"\"groups\": [\"users\", \"wheel\", \"audio\", \"video\"]}"; | "\"groups\": [\"users\", \"\", \"wheel\", \"audio\", \"video\"]}"; |
int i, ret; |
int i, ret; |
jtok_t *tok, toks[20]; |
jtok_t *tok, toks[20]; |
ait_val_t *v; |
ait_val_t *v; |
Line 37 run_simple(json_t *json)
|
Line 37 run_simple(json_t *json)
|
printf("Error:: #%d - %s\n", elwix_GetErrno(), elwix_GetError()); |
printf("Error:: #%d - %s\n", elwix_GetErrno(), elwix_GetError()); |
return 1; |
return 1; |
} else |
} else |
printf("We parsed %d tokens\n", ret); | printf("We parsed %d tokens next=%lu\n", ret, json->h_next); |
memset(toks, 0, sizeof toks); |
memset(toks, 0, sizeof toks); |
json_init(json, 1); |
json_init(json, 1); |
ret = json_parse(json, teststr, strlen(teststr), toks, sizeof toks/sizeof *toks); |
ret = json_parse(json, teststr, strlen(teststr), toks, sizeof toks/sizeof *toks); |
Line 45 run_simple(json_t *json)
|
Line 45 run_simple(json_t *json)
|
printf("Error:: #%d - %s\n", elwix_GetErrno(), elwix_GetError()); |
printf("Error:: #%d - %s\n", elwix_GetErrno(), elwix_GetError()); |
return 1; |
return 1; |
} else |
} else |
printf("(strict) We parsed %d tokens\n", ret); | 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", toks, ret))) |
printf("Key=\"boza s kosmi\" not found!\n"); |
printf("Key=\"boza s kosmi\" not found!\n"); |