| line |
true |
false |
branch |
|
204
|
2 |
13 |
if (jc->fatal_errors) { |
|
226
|
0 |
97 |
if (jc->length == 0) { |
|
227
|
0 |
0 |
if (jc->output == 0) { |
|
234
|
97 |
0 |
if (! jc->output) { |
|
255
|
0 |
2471 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
292
|
0 |
158 |
if (slen < MARGIN || slen < BUFSIZE - jc->length) { |
|
|
0 |
0 |
if (slen < MARGIN || slen < BUFSIZE - jc->length) { |
|
293
|
625 |
158 |
for (i = 0; i < slen; i++) { |
|
297
|
0 |
158 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
302
|
0 |
0 |
for (i = 0; i < slen; i++) { |
|
303
|
0 |
0 |
CALL (add_char (jc, (unsigned char) s[i])); |
|
|
0 |
0 |
CALL (add_char (jc, (unsigned char) s[i])); |
|
|
0 |
0 |
CALL (add_char (jc, (unsigned char) s[i])); |
|
314
|
0 |
117 |
CALL (add_char (jc, '\n')); |
|
|
0 |
0 |
CALL (add_char (jc, '\n')); |
|
|
0 |
0 |
CALL (add_char (jc, '\n')); |
|
315
|
188 |
117 |
for (d = 0; d < jc->depth; d++) { |
|
316
|
0 |
188 |
CALL (add_char (jc, '\t')); \ |
|
|
0 |
0 |
CALL (add_char (jc, '\t')); \ |
|
|
0 |
0 |
CALL (add_char (jc, '\t')); \ |
|
326
|
0 |
0 |
for (i = 0; i < slen; i++) { |
|
329
|
0 |
0 |
if (c == '\n') { |
|
330
|
0 |
0 |
if (i < slen - 1) { |
|
331
|
0 |
0 |
CALL (newline_indent (jc)); |
|
|
0 |
0 |
CALL (newline_indent (jc)); |
|
|
0 |
0 |
CALL (newline_indent (jc)); |
|
336
|
0 |
0 |
CALL (add_char (jc, c)); |
|
|
0 |
0 |
CALL (add_char (jc, c)); |
|
|
0 |
0 |
CALL (add_char (jc, c)); |
|
359
|
6 |
36 |
if (jc->unicode_upper) { |
|
374
|
0 |
42 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
383
|
9 |
12 |
if (u > 0xffff) { |
|
387
|
0 |
9 |
if (status != UNICODE_OK) { |
|
388
|
0 |
0 |
if (JCEH) { |
|
395
|
0 |
9 |
CALL (add_one_u (jc, hi)); |
|
|
0 |
0 |
CALL (add_one_u (jc, hi)); |
|
|
0 |
0 |
CALL (add_one_u (jc, hi)); |
|
531
|
0 |
62 |
CALL (add_char (jc, '"')); |
|
|
0 |
0 |
CALL (add_char (jc, '"')); |
|
|
0 |
0 |
CALL (add_char (jc, '"')); |
|
532
|
109 |
59 |
for (i = 0; i < keylen; ) { |
|
538
|
0 |
2 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
2 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
1 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
1 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
100 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
547
|
0 |
59 |
CALL (add_char (jc, '"')); |
|
|
0 |
0 |
CALL (add_char (jc, '"')); |
|
|
0 |
0 |
CALL (add_char (jc, '"')); |
|
560
|
0 |
271 |
CALL (add_char (jc, '"')); |
|
|
0 |
0 |
CALL (add_char (jc, '"')); |
|
|
0 |
0 |
CALL (add_char (jc, '"')); |
|
561
|
859 |
270 |
for (i = 0; i < keylen; ) { |
|
567
|
0 |
2 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
2 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
1 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
1 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
704 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
4 |
8 |
ASCII; |
|
|
0 |
4 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
8 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
|
0 |
0 |
ASCII; |
|
570
|
2 |
1 |
BADUTF8; |
|
|
0 |
2 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
576
|
5 |
0 |
if (d < 0x80 || d > 0xBF) { |
|
|
0 |
5 |
if (d < 0x80 || d > 0xBF) { |
|
577
|
0 |
0 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
581
|
4 |
1 |
if (jc->unicode_escape_all) { |
|
585
|
0 |
4 |
CALL (add_u (jc, u)); |
|
|
0 |
0 |
CALL (add_u (jc, u)); |
|
|
0 |
0 |
CALL (add_u (jc, u)); |
|
588
|
0 |
1 |
CALL (add_str_len (jc, (const char *) key + i, 2)); |
|
|
0 |
0 |
CALL (add_str_len (jc, (const char *) key + i, 2)); |
|
|
0 |
0 |
CALL (add_str_len (jc, (const char *) key + i, 2)); |
|
597
|
66 |
0 |
if (d < 0x80 || d > 0xBF || |
|
|
66 |
0 |
if (d < 0x80 || d > 0xBF || |
|
598
|
66 |
0 |
e < 0x80 || e > 0xBF) { |
|
|
0 |
66 |
e < 0x80 || e > 0xBF) { |
|
599
|
0 |
0 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
603
|
64 |
2 |
if (! jc->no_javascript_safe && |
|
|
10 |
54 |
if (! jc->no_javascript_safe && |
|
604
|
8 |
2 |
c == 0xe2 && d == 0x80 && |
|
|
4 |
4 |
c == 0xe2 && d == 0x80 && |
|
605
|
4 |
0 |
(e == 0xa8 || e == 0xa9)) { |
|
606
|
0 |
8 |
CALL (add_one_u (jc, 0x2028 + e - 0xa8)); |
|
|
0 |
0 |
CALL (add_one_u (jc, 0x2028 + e - 0xa8)); |
|
|
0 |
0 |
CALL (add_one_u (jc, 0x2028 + e - 0xa8)); |
|
609
|
8 |
50 |
if (jc->unicode_escape_all) { |
|
614
|
0 |
8 |
CALL (add_u (jc, u)); |
|
|
0 |
0 |
CALL (add_u (jc, u)); |
|
|
0 |
0 |
CALL (add_u (jc, u)); |
|
617
|
0 |
50 |
CALL (add_str_len (jc, (const char *) key + i, 3)); |
|
|
0 |
0 |
CALL (add_str_len (jc, (const char *) key + i, 3)); |
|
|
0 |
0 |
CALL (add_str_len (jc, (const char *) key + i, 3)); |
|
628
|
63 |
0 |
if ( |
|
634
|
63 |
0 |
(d < 0x80 || d > 0xBF || |
|
|
63 |
0 |
(d < 0x80 || d > 0xBF || |
|
635
|
63 |
0 |
e < 0x80 || e > 0xBF || |
|
|
63 |
0 |
e < 0x80 || e > 0xBF || |
|
636
|
63 |
0 |
f < 0x80 || f > 0xBF)) |
|
|
63 |
0 |
f < 0x80 || f > 0xBF)) |
|
637
|
0 |
63 |
|| |
|
640
|
0 |
0 |
(d < 0x80 || d > 0x8F || |
|
|
0 |
0 |
(d < 0x80 || d > 0x8F || |
|
641
|
0 |
0 |
e < 0x80 || e > 0xBF || |
|
|
0 |
0 |
e < 0x80 || e > 0xBF || |
|
642
|
0 |
0 |
f < 0x80 || f > 0xBF)) |
|
|
0 |
0 |
f < 0x80 || f > 0xBF)) |
|
644
|
0 |
0 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
|
0 |
0 |
BADUTF8; |
|
648
|
9 |
54 |
if (jc->unicode_escape_all) { |
|
659
|
0 |
54 |
CALL (add_str_len (jc, (const char *) key + i, 4)); |
|
|
0 |
0 |
CALL (add_str_len (jc, (const char *) key + i, 4)); |
|
|
0 |
0 |
CALL (add_str_len (jc, (const char *) key + i, 4)); |
|
666
|
0 |
270 |
CALL (add_char (jc, '"')); |
|
|
0 |
0 |
CALL (add_char (jc, '"')); |
|
|
0 |
0 |
CALL (add_char (jc, '"')); |
|
677
|
54 |
68 |
if (SvUTF8 (input)) { |
|
684
|
17 |
51 |
else if (jc->strict) { |
|
709
|
0 |
0 |
if (uvlen >= MARGIN) { |
|
710
|
0 |
0 |
if (JCEH) { |
|
719
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
730
|
0 |
107 |
if (SvIOK_UV(sv)) { |
|
743
|
10 |
97 |
if (iv < 0) { |
|
748
|
42 |
65 |
if (iv < 10) { |
|
753
|
9 |
56 |
else if (iv < 100) { |
|
760
|
8 |
48 |
else if (iv < 1000) { |
|
770
|
8 |
40 |
else if (iv < 10000) { |
|
781
|
6 |
34 |
else if (iv < 100000) { |
|
793
|
6 |
28 |
else if (iv < 1000000) { |
|
807
|
12 |
16 |
else if (iv < 10000000) { |
|
823
|
6 |
10 |
else if (iv < 100000000) { |
|
841
|
8 |
2 |
else if (iv < 1000000000) { |
|
865
|
0 |
2 |
if (ivlen >= MARGIN) { |
|
866
|
0 |
0 |
if (JCEH) { |
|
876
|
0 |
107 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
896
|
0 |
2 |
PUSHMARK (SP); |
|
897
|
0 |
2 |
XPUSHs (sv_2mortal (newSVsv (json))); |
|
901
|
2 |
0 |
FREETMPS; |
|
904
|
0 |
2 |
if (! error) { |
|
907
|
2 |
0 |
if (SvOK (error) && SvCUR (error) > 0) { |
|
|
1 |
1 |
if (SvOK (error) && SvCUR (error) > 0) { |
|
928
|
0 |
14 |
PUSHMARK (SP); |
|
930
|
0 |
14 |
XPUSHs (sv_2mortal (newRV (r))); |
|
935
|
14 |
0 |
FREETMPS; |
|
938
|
3 |
11 |
if (! SvOK (json)) { |
|
945
|
0 |
11 |
if (SvUTF8 (json)) { |
|
951
|
2 |
9 |
if (jc->validate) { |
|
952
|
1 |
1 |
CALL (json_create_validate_user_json (jc, json)); |
|
|
1 |
0 |
CALL (json_create_validate_user_json (jc, json)); |
|
|
0 |
0 |
CALL (json_create_validate_user_json (jc, json)); |
|
959
|
0 |
10 |
if (jc->indent) { |
|
960
|
0 |
0 |
CALL (add_str_len_indent (jc, jsonc, jsonl)); |
|
|
0 |
0 |
CALL (add_str_len_indent (jc, jsonc, jsonl)); |
|
|
0 |
0 |
CALL (add_str_len_indent (jc, jsonc, jsonl)); |
|
964
|
0 |
10 |
CALL (add_str_len (jc, jsonc, jsonl)); |
|
|
0 |
0 |
CALL (add_str_len (jc, jsonc, jsonl)); |
|
|
0 |
0 |
CALL (add_str_len (jc, jsonc, jsonl)); |
|
978
|
93 |
9 |
if (isfinite (fv)) { |
|
979
|
57 |
36 |
if (jc->fformat) { |
|
986
|
0 |
93 |
if (fvlen >= MARGIN) { |
|
990
|
0 |
93 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
|
0 |
0 |
CHECKLENGTH; |
|
993
|
3 |
6 |
if (jc->non_finite_handler) { |
|
994
|
0 |
3 |
CALL (json_create_call_to_json (jc, jc->non_finite_handler, sv)); |
|
|
0 |
0 |
CALL (json_create_call_to_json (jc, jc->non_finite_handler, sv)); |
|
|
0 |
0 |
CALL (json_create_call_to_json (jc, jc->non_finite_handler, sv)); |
|
997
|
3 |
3 |
if (jc->strict) { |
|
1002
|
1 |
2 |
if (isnan (fv)) { |
|
1003
|
0 |
1 |
ADD ("\"nan\""); |
|
|
0 |
0 |
ADD ("\"nan\""); |
|
|
0 |
0 |
ADD ("\"nan\""); |
|
1005
|
2 |
0 |
else if (isinf (fv)) { |
|
1006
|
1 |
1 |
if (fv < 0.0) { |
|
1007
|
0 |
1 |
ADD ("\"-inf\""); |
|
|
0 |
0 |
ADD ("\"-inf\""); |
|
|
0 |
0 |
ADD ("\"-inf\""); |
|
1010
|
0 |
1 |
ADD ("\"inf\""); |
|
|
0 |
0 |
ADD ("\"inf\""); |
|
|
0 |
0 |
ADD ("\"inf\""); |
|
1026
|
1 |
2 |
if (SvIOK (r)) { |
|
1027
|
0 |
1 |
CALL (json_create_add_integer (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_integer (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_integer (jc, r)); |
|
1029
|
0 |
2 |
else if (SvNOK (r)) { |
|
1030
|
0 |
0 |
CALL (json_create_add_float (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_float (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_float (jc, r)); |
|
1033
|
0 |
2 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
1110
|
0 |
112 |
CALL (add_char (jc, c)); |
|
|
0 |
0 |
CALL (add_char (jc, c)); |
|
|
0 |
0 |
CALL (add_char (jc, c)); |
|
1112
|
23 |
89 |
if (jc->indent) { |
|
1113
|
23 |
0 |
DINC; |
|
1114
|
0 |
23 |
CALL (newline_indent (jc)); \ |
|
|
0 |
0 |
CALL (newline_indent (jc)); \ |
|
|
0 |
0 |
CALL (newline_indent (jc)); \ |
|
1124
|
23 |
79 |
if (jc->indent) { |
|
1125
|
23 |
0 |
DDEC; |
|
1126
|
0 |
23 |
CALL (newline_indent (jc)); \ |
|
|
0 |
0 |
CALL (newline_indent (jc)); \ |
|
|
0 |
0 |
CALL (newline_indent (jc)); \ |
|
1129
|
0 |
102 |
CALL (add_char (jc, c)); |
|
|
0 |
0 |
CALL (add_char (jc, c)); |
|
|
0 |
0 |
CALL (add_char (jc, c)); |
|
1131
|
23 |
79 |
if (jc->indent) { |
|
1134
|
6 |
17 |
if (jc->depth == 0) { |
|
1135
|
0 |
6 |
CALL (add_char (jc, '\n')); |
|
|
0 |
0 |
CALL (add_char (jc, '\n')); |
|
|
0 |
0 |
CALL (add_char (jc, '\n')); |
|
1160
|
0 |
10 |
PUSHMARK(SP); |
|
1161
|
0 |
10 |
EXTEND(SP, 2); |
|
1162
|
0 |
10 |
XPUSHs(sv_2mortal (newSVsv (sa))); |
|
1163
|
0 |
10 |
XPUSHs(sv_2mortal (newSVsv (sb))); |
|
1166
|
0 |
10 |
if (n != 1) { |
|
1173
|
10 |
0 |
FREETMPS; |
|
1186
|
0 |
17 |
if (n_keys == 0) { |
|
1187
|
0 |
0 |
CALL (add_str_len (jc, "{}", strlen ("{}"))); |
|
|
0 |
0 |
CALL (add_str_len (jc, "{}", strlen ("{}"))); |
|
|
0 |
0 |
CALL (add_str_len (jc, "{}", strlen ("{}"))); |
|
1190
|
0 |
17 |
CALL (add_open (jc, '{')); |
|
|
0 |
0 |
CALL (add_open (jc, '{')); |
|
|
0 |
0 |
CALL (add_open (jc, '{')); |
|
1193
|
70 |
17 |
for (i = 0; i < n_keys; i++) { |
|
1197
|
0 |
70 |
if (HeUTF8 (he)) { |
|
|
33 |
37 |
if (HeUTF8 (he)) { |
|
1202
|
2 |
15 |
if (jc->cmp) { |
|
1210
|
70 |
17 |
for (i = 0; i < n_keys; i++) { |
|
1216
|
53 |
17 |
COMMA; |
|
|
0 |
53 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
|
53 |
0 |
COMMA; |
|
|
0 |
53 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
1219
|
0 |
70 |
CALL (json_create_add_key_len (jc, (const unsigned char *) key, |
|
|
0 |
0 |
CALL (json_create_add_key_len (jc, (const unsigned char *) key, |
|
|
0 |
0 |
CALL (json_create_add_key_len (jc, (const unsigned char *) key, |
|
1222
|
0 |
70 |
if (! he) { |
|
1226
|
0 |
70 |
CALL (add_char (jc, ':')); |
|
|
0 |
0 |
CALL (add_char (jc, ':')); |
|
|
0 |
0 |
CALL (add_char (jc, ':')); |
|
1227
|
0 |
70 |
CALL (json_create_recursively (jc, HeVAL(he))); |
|
|
0 |
0 |
CALL (json_create_recursively (jc, HeVAL(he))); |
|
|
0 |
0 |
CALL (json_create_recursively (jc, HeVAL(he))); |
|
1232
|
0 |
17 |
CALL (add_close (jc, '}')); |
|
|
0 |
0 |
CALL (add_close (jc, '}')); |
|
|
0 |
0 |
CALL (add_close (jc, '}')); |
|
1250
|
17 |
63 |
if (jc->sort) { |
|
1255
|
1 |
62 |
if (n_keys == 0) { |
|
1256
|
0 |
1 |
CALL (add_str_len (jc, "{}", strlen ("{}"))); |
|
|
0 |
0 |
CALL (add_str_len (jc, "{}", strlen ("{}"))); |
|
|
0 |
0 |
CALL (add_str_len (jc, "{}", strlen ("{}"))); |
|
1259
|
0 |
62 |
CALL (add_open (jc, '{')); |
|
|
0 |
0 |
CALL (add_open (jc, '{')); |
|
|
0 |
0 |
CALL (add_open (jc, '{')); |
|
1260
|
141 |
53 |
for (i = 0; i < n_keys; i++) { |
|
1272
|
79 |
62 |
COMMA; |
|
|
0 |
79 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
|
2 |
77 |
COMMA; |
|
|
0 |
2 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
1273
|
0 |
141 |
if (HeUTF8 (he)) { |
|
|
4 |
137 |
if (HeUTF8 (he)) { |
|
1275
|
0 |
4 |
CALL (json_create_add_key_len (jc, (const unsigned char *) key, |
|
|
0 |
0 |
CALL (json_create_add_key_len (jc, (const unsigned char *) key, |
|
|
0 |
0 |
CALL (json_create_add_key_len (jc, (const unsigned char *) key, |
|
1278
|
45 |
92 |
else if (jc->strict) { |
|
1279
|
2 |
43 |
CALL (json_create_add_ascii_key_len (jc, (unsigned char *) key, |
|
|
2 |
0 |
CALL (json_create_add_ascii_key_len (jc, (unsigned char *) key, |
|
|
0 |
0 |
CALL (json_create_add_ascii_key_len (jc, (unsigned char *) key, |
|
1283
|
0 |
92 |
CALL (json_create_add_key_len (jc, (const unsigned char *) key, |
|
|
0 |
0 |
CALL (json_create_add_key_len (jc, (const unsigned char *) key, |
|
|
0 |
0 |
CALL (json_create_add_key_len (jc, (const unsigned char *) key, |
|
1286
|
0 |
139 |
CALL (add_char (jc, ':')); |
|
|
0 |
0 |
CALL (add_char (jc, ':')); |
|
|
0 |
0 |
CALL (add_char (jc, ':')); |
|
1288
|
7 |
132 |
CALL (json_create_recursively (jc, value)); |
|
|
7 |
0 |
CALL (json_create_recursively (jc, value)); |
|
|
0 |
0 |
CALL (json_create_recursively (jc, value)); |
|
1290
|
0 |
53 |
CALL (add_close (jc, '}')); |
|
|
0 |
0 |
CALL (add_close (jc, '}')); |
|
|
0 |
0 |
CALL (add_close (jc, '}')); |
|
1306
|
0 |
33 |
CALL (add_open (jc, '[')); |
|
|
0 |
0 |
CALL (add_open (jc, '[')); |
|
|
0 |
0 |
CALL (add_open (jc, '[')); |
|
1313
|
163 |
32 |
for (i = 0; i < n_keys; i++) { |
|
1315
|
130 |
33 |
COMMA; |
|
|
0 |
130 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
|
16 |
114 |
COMMA; |
|
|
0 |
16 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
|
0 |
0 |
COMMA; |
|
1318
|
163 |
0 |
if (avv) { |
|
1325
|
1 |
162 |
CALL (json_create_recursively (jc, value)); |
|
|
1 |
0 |
CALL (json_create_recursively (jc, value)); |
|
|
0 |
0 |
CALL (json_create_recursively (jc, value)); |
|
1328
|
0 |
32 |
CALL (add_close (jc, ']')); |
|
|
0 |
0 |
CALL (add_close (jc, ']')); |
|
|
0 |
0 |
CALL (add_close (jc, ']')); |
|
1336
|
2 |
3 |
if (jc->type_handler) { |
|
1337
|
1 |
1 |
CALL (json_create_call_to_json (jc, jc->type_handler, r)); |
|
|
1 |
0 |
CALL (json_create_call_to_json (jc, jc->type_handler, r)); |
|
|
0 |
0 |
CALL (json_create_call_to_json (jc, jc->type_handler, r)); |
|
1359
|
1 |
32 |
CALL (json_create_add_array (jc, (AV *) r)); |
|
|
1 |
0 |
CALL (json_create_add_array (jc, (AV *) r)); |
|
|
0 |
0 |
CALL (json_create_add_array (jc, (AV *) r)); |
|
1364
|
9 |
71 |
CALL (json_create_add_object (jc, (HV *) r)); |
|
|
9 |
0 |
CALL (json_create_add_object (jc, (HV *) r)); |
|
|
0 |
0 |
CALL (json_create_add_object (jc, (HV *) r)); |
|
1370
|
0 |
0 |
STRICT_NO_SCALAR; |
|
1371
|
0 |
0 |
CALL (json_create_add_float (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_float (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_float (jc, r)); |
|
1377
|
1 |
1 |
STRICT_NO_SCALAR; |
|
1378
|
0 |
1 |
CALL (json_create_add_integer (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_integer (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_integer (jc, r)); |
|
1383
|
1 |
1 |
STRICT_NO_SCALAR; |
|
1384
|
0 |
1 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
1389
|
0 |
2 |
STRICT_NO_SCALAR; |
|
1390
|
0 |
2 |
CALL (json_create_add_magic (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_magic (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_magic (jc, r)); |
|
1395
|
4 |
1 |
CALL (json_create_handle_unknown_type (jc, r)); |
|
|
4 |
0 |
CALL (json_create_handle_unknown_type (jc, r)); |
|
|
0 |
0 |
CALL (json_create_handle_unknown_type (jc, r)); |
|
1420
|
0 |
17 |
if (sv_ptr) { |
|
1427
|
9 |
8 |
if (pvlen == strlen ("bool") && |
|
1428
|
9 |
0 |
strncmp (pv, "bool", 4) == 0) { |
|
1429
|
6 |
3 |
if (SvTRUE (r)) { |
|
1430
|
0 |
6 |
ADD ("true"); |
|
|
0 |
0 |
ADD ("true"); |
|
|
0 |
0 |
ADD ("true"); |
|
1433
|
0 |
3 |
ADD ("false"); |
|
|
0 |
0 |
ADD ("false"); |
|
|
0 |
0 |
ADD ("false"); |
|
1436
|
8 |
0 |
else if (SvROK (*sv_ptr)) { |
|
1439
|
8 |
0 |
switch (SvTYPE (what)) { |
|
1441
|
2 |
6 |
CALL (json_create_call_to_json (jc, what, r)); |
|
|
2 |
0 |
CALL (json_create_call_to_json (jc, what, r)); |
|
|
0 |
0 |
CALL (json_create_call_to_json (jc, what, r)); |
|
1452
|
0 |
0 |
if (JCEH) { |
|
1480
|
0 |
0 |
if (jc->strict) { |
|
1483
|
0 |
0 |
CALL (json_create_handle_ref (jc, r)); |
|
|
0 |
0 |
CALL (json_create_handle_ref (jc, r)); |
|
|
0 |
0 |
CALL (json_create_handle_ref (jc, r)); |
|
1498
|
28 |
117 |
if (sv_isobject (input)) { |
|
1503
|
7 |
21 |
if (olen == strlen (JCBOOL) && |
|
1504
|
4 |
3 |
strncmp (objtype, JCBOOL, strlen (JCBOOL)) == 0) { |
|
1505
|
2 |
2 |
if (SvTRUE (r)) { |
|
1506
|
0 |
2 |
ADD("true"); |
|
|
0 |
0 |
ADD("true"); |
|
|
0 |
0 |
ADD("true"); |
|
1509
|
0 |
2 |
ADD("false"); |
|
|
0 |
0 |
ADD("false"); |
|
|
0 |
0 |
ADD("false"); |
|
1513
|
1 |
23 |
if (jc->obj_handler) { |
|
1514
|
1 |
0 |
CALL (json_create_call_to_json (jc, jc->obj_handler, r)); |
|
|
1 |
0 |
CALL (json_create_call_to_json (jc, jc->obj_handler, r)); |
|
|
0 |
0 |
CALL (json_create_call_to_json (jc, jc->obj_handler, r)); |
|
1517
|
17 |
6 |
if (jc->handlers) { |
|
1518
|
2 |
15 |
CALL (json_create_handle_object (jc, r, objtype, olen)); |
|
|
2 |
0 |
CALL (json_create_handle_object (jc, r, objtype, olen)); |
|
|
0 |
0 |
CALL (json_create_handle_object (jc, r, objtype, olen)); |
|
1521
|
1 |
5 |
if (jc->strict) { |
|
1529
|
14 |
108 |
CALL (json_create_handle_ref (jc, r)); |
|
|
14 |
0 |
CALL (json_create_handle_ref (jc, r)); |
|
|
0 |
0 |
CALL (json_create_handle_ref (jc, r)); |
|
1554
|
0 |
0 |
ADD ("null"); |
|
|
0 |
0 |
ADD ("null"); |
|
|
0 |
0 |
ADD ("null"); |
|
1559
|
0 |
1 |
CALL (json_create_add_magic (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_magic (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_magic (jc, r)); |
|
1564
|
0 |
117 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
1569
|
0 |
101 |
CALL (json_create_add_integer (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_integer (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_integer (jc, r)); |
|
1574
|
3 |
92 |
CALL (json_create_add_float (jc, r)); |
|
|
3 |
0 |
CALL (json_create_add_float (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_float (jc, r)); |
|
1578
|
10 |
0 |
if (SvNIOK (r)) { |
|
1579
|
7 |
3 |
if (SvNOK (r)) { |
|
1587
|
0 |
7 |
CALL (json_create_add_float (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_float (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_float (jc, r)); |
|
1589
|
3 |
0 |
else if (SvIOK (r)) { |
|
1597
|
0 |
3 |
CALL (json_create_add_integer (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_integer (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_integer (jc, r)); |
|
1602
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
1607
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
1614
|
1 |
0 |
if (SvIOK (r)) { |
|
1616
|
0 |
1 |
CALL (json_create_add_integer (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_integer (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_integer (jc, r)); |
|
1629
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
|
0 |
0 |
CALL (json_create_add_string (jc, r)); |
|
1634
|
0 |
0 |
CALL (json_create_handle_unknown_type (jc, r)); |
|
|
0 |
0 |
CALL (json_create_handle_unknown_type (jc, r)); |
|
|
0 |
0 |
CALL (json_create_handle_unknown_type (jc, r)); |
|
1636
|
77 |
245 |
TOP_NEWLINE; |
|
|
0 |
77 |
TOP_NEWLINE; |
|
|
0 |
0 |
TOP_NEWLINE; |
|
|
0 |
0 |
TOP_NEWLINE; |
|
|
0 |
0 |
TOP_NEWLINE; |
|
1650
|
8 |
476 |
if (! SvOK (input)) { |
|
1654
|
0 |
8 |
ADD ("null"); |
|
|
0 |
0 |
ADD ("null"); |
|
|
0 |
0 |
ADD ("null"); |
|
1655
|
1 |
7 |
TOP_NEWLINE; |
|
|
1 |
0 |
TOP_NEWLINE; |
|
|
0 |
1 |
TOP_NEWLINE; |
|
|
0 |
0 |
TOP_NEWLINE; |
|
|
0 |
0 |
TOP_NEWLINE; |
|
1660
|
2 |
474 |
if (input == &PL_sv_yes) { |
|
1662
|
0 |
2 |
ADD ("true"); |
|
|
0 |
0 |
ADD ("true"); |
|
|
0 |
0 |
ADD ("true"); |
|
1665
|
2 |
472 |
if (input == &PL_sv_no) { |
|
1667
|
0 |
2 |
ADD ("false"); |
|
|
0 |
0 |
ADD ("false"); |
|
|
0 |
0 |
ADD ("false"); |
|
1670
|
145 |
327 |
if (SvROK (input)) { |
|
1671
|
18 |
127 |
CALL (json_create_refobj (jc, input)); |
|
|
18 |
0 |
CALL (json_create_refobj (jc, input)); |
|
|
0 |
0 |
CALL (json_create_refobj (jc, input)); |
|
1674
|
3 |
322 |
CALL (json_create_not_ref (jc, input)); |
|
|
3 |
0 |
CALL (json_create_not_ref (jc, input)); |
|
|
0 |
0 |
CALL (json_create_not_ref (jc, input)); |
|
1716
|
13 |
97 |
FINALCALL (json_create_recursively (jc, input)); |
|
|
13 |
0 |
FINALCALL (json_create_recursively (jc, input)); |
|
|
0 |
0 |
FINALCALL (json_create_recursively (jc, input)); |
|
|
0 |
13 |
FINALCALL (json_create_recursively (jc, input)); |
|
1717
|
0 |
97 |
FINALCALL (json_create_buffer_fill (jc)); |
|
|
0 |
0 |
FINALCALL (json_create_buffer_fill (jc)); |
|
|
0 |
0 |
FINALCALL (json_create_buffer_fill (jc)); |
|
|
0 |
0 |
FINALCALL (json_create_buffer_fill (jc)); |
|
1719
|
24 |
73 |
if (jc->unicode && ! jc->downgrade_utf8) { |
|
|
23 |
1 |
if (jc->unicode && ! jc->downgrade_utf8) { |
|
1720
|
0 |
23 |
if (jc->utf8_dangerous) { |
|
1721
|
0 |
0 |
if (is_utf8_string ((U8 *) SvPV_nolen (jc->output), |
|
1766
|
2 |
26 |
if (jc->fformat) { |
|
1781
|
0 |
4 |
CALL (json_create_free_fformat (jc)); |
|
|
0 |
0 |
CALL (json_create_free_fformat (jc)); |
|
|
0 |
0 |
CALL (json_create_free_fformat (jc)); |
|
1782
|
2 |
2 |
if (! SvTRUE (fformat)) { |
|
1788
|
0 |
2 |
if (! strchr (ff, '%')) { |
|
1793
|
8 |
2 |
for (i = 0; i < fflen; i++) { |
|
1804
|
5 |
19 |
if (jc->handlers) { |
|
1815
|
2 |
24 |
if (jc->type_handler) { |
|
1826
|
1 |
24 |
if (jc->obj_handler) { |
|
1837
|
1 |
24 |
if (jc->non_finite_handler) { |
|
1848
|
1 |
24 |
if (jc->cmp) { |
|
1859
|
0 |
24 |
CALL (json_create_free_fformat (jc)); |
|
|
0 |
0 |
CALL (json_create_free_fformat (jc)); |
|
|
0 |
0 |
CALL (json_create_free_fformat (jc)); |
|
1860
|
0 |
24 |
CALL (json_create_remove_handlers (jc)); |
|
|
0 |
0 |
CALL (json_create_remove_handlers (jc)); |
|
|
0 |
0 |
CALL (json_create_remove_handlers (jc)); |
|
1861
|
0 |
24 |
CALL (json_create_remove_type_handler (jc)); |
|
|
0 |
0 |
CALL (json_create_remove_type_handler (jc)); |
|
|
0 |
0 |
CALL (json_create_remove_type_handler (jc)); |
|
1862
|
0 |
24 |
CALL (json_create_remove_obj_handler (jc)); |
|
|
0 |
0 |
CALL (json_create_remove_obj_handler (jc)); |
|
|
0 |
0 |
CALL (json_create_remove_obj_handler (jc)); |
|
1863
|
0 |
24 |
CALL (json_create_remove_non_finite_handler (jc)); |
|
|
0 |
0 |
CALL (json_create_remove_non_finite_handler (jc)); |
|
|
0 |
0 |
CALL (json_create_remove_non_finite_handler (jc)); |
|
1864
|
0 |
24 |
CALL (json_create_remove_cmp (jc)); |
|
|
0 |
0 |
CALL (json_create_remove_cmp (jc)); |
|
|
0 |
0 |
CALL (json_create_remove_cmp (jc)); |
|
1869
|
0 |
24 |
if (jc->n_mallocs != 0) { |
|
1931
|
0 |
6 |
BOOL (downgrade_utf8); |
|
|
0 |
0 |
BOOL (downgrade_utf8); |
|
1932
|
0 |
6 |
BOOL (escape_slash); |
|
|
0 |
0 |
BOOL (escape_slash); |
|
1933
|
0 |
6 |
BOOL (fatal_errors); |
|
|
0 |
0 |
BOOL (fatal_errors); |
|
1934
|
4 |
2 |
BOOL (indent); |
|
|
4 |
0 |
BOOL (indent); |
|
1935
|
0 |
2 |
BOOL (no_javascript_safe); |
|
|
0 |
0 |
BOOL (no_javascript_safe); |
|
1936
|
0 |
2 |
BOOL (replace_bad_utf8); |
|
|
0 |
0 |
BOOL (replace_bad_utf8); |
|
1937
|
2 |
0 |
BOOL (sort); |
|
|
2 |
0 |
BOOL (sort); |
|
1938
|
0 |
0 |
BOOL (strict); |
|
|
0 |
0 |
BOOL (strict); |
|
1939
|
0 |
0 |
BOOL (unicode_upper); |
|
|
0 |
0 |
BOOL (unicode_upper); |
|
1940
|
0 |
0 |
BOOL (unicode_escape_all); |
|
|
0 |
0 |
BOOL (unicode_escape_all); |
|
1941
|
0 |
0 |
BOOL (validate); |
|
|
0 |
0 |
BOOL (validate); |
|
1942
|
0 |
0 |
HANDLER (non_finite); |
|
|
0 |
0 |
HANDLER (non_finite); |
|
1943
|
0 |
0 |
HANDLER (object); |
|
|
0 |
0 |
HANDLER (object); |
|
1944
|
0 |
0 |
HANDLER (type); |
|
|
0 |
0 |
HANDLER (type); |