Branch Coverage

json-create-perl.c
Criterion Covered Total %
branch 446 1752 25.4


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 ||
66 0 if (d < 0x80 || d > 0xBF ||
598 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 (
633 63 0 (c < 0xf4 &&
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))
637 0 63 ||
639 0 0 (c == 0xf4 &&
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))
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, '"'));
676 122 0 istring = SvPV (input, ilength);
677 54 68 if (SvUTF8 (input)) {
684 17 51 else if (jc->strict) {
707 107 0 iv = SvIV (sv);
717 10 97 if (iv < 0) {
722 42 65 if (iv < 10) {
727 9 56 else if (iv < 100) {
734 8 48 else if (iv < 1000) {
744 8 40 else if (iv < 10000) {
755 6 34 else if (iv < 100000) {
767 6 28 else if (iv < 1000000) {
781 12 16 else if (iv < 10000000) {
797 6 10 else if (iv < 100000000) {
815 8 2 else if (iv < 1000000000) {
839 0 2 if (ivlen >= MARGIN) {
840 0 0 if (JCEH) {
841 0 0 (*JCEH) (__FILE__, __LINE__,
850 0 107 CHECKLENGTH;
0 0 CHECKLENGTH;
0 0 CHECKLENGTH;
0 0 CHECKLENGTH;
870 0 2 PUSHMARK (SP);
871 0 2 XPUSHs (sv_2mortal (newSVsv (json)));
875 2 0 FREETMPS;
878 0 2 if (! error) {
881 0 2 if (SvOK (error) && SvCUR (error) > 0) {
0 0 if (SvOK (error) && SvCUR (error) > 0) {
0 0 if (SvOK (error) && SvCUR (error) > 0) {
1 1 if (SvOK (error) && SvCUR (error) > 0) {
882 1 0 json_create_user_message (jc, json_create_invalid_user_json,
1 0 json_create_user_message (jc, json_create_invalid_user_json,
902 0 14 PUSHMARK (SP);
904 0 14 XPUSHs (sv_2mortal (newRV (r)));
909 14 0 FREETMPS;
912 3 11 if (! SvOK (json)) {
3 0 if (! SvOK (json)) {
3 0 if (! SvOK (json)) {
919 0 11 if (SvUTF8 (json)) {
924 11 0 jsonc = SvPV (json, jsonl);
925 2 9 if (jc->validate) {
926 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));
933 0 10 if (jc->indent) {
934 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));
938 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));
951 102 0 fv = SvNV (sv);
952 93 9 if (isfinite (fv)) {
953 57 36 if (jc->fformat) {
960 0 93 if (fvlen >= MARGIN) {
964 0 93 CHECKLENGTH;
0 0 CHECKLENGTH;
0 0 CHECKLENGTH;
0 0 CHECKLENGTH;
967 3 6 if (jc->non_finite_handler) {
968 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));
971 3 3 if (jc->strict) {
976 1 2 if (isnan (fv)) {
977 0 1 ADD ("\"nan\"");
0 0 ADD ("\"nan\"");
0 0 ADD ("\"nan\"");
979 2 0 else if (isinf (fv)) {
980 1 1 if (fv < 0.0) {
981 0 1 ADD ("\"-inf\"");
0 0 ADD ("\"-inf\"");
0 0 ADD ("\"-inf\"");
984 0 1 ADD ("\"inf\"");
0 0 ADD ("\"inf\"");
0 0 ADD ("\"inf\"");
1000 1 2 if (SvIOK (r)) {
1001 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));
1003 0 2 else if (SvNOK (r)) {
1004 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));
1007 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));
1084 0 112 CALL (add_char (jc, c));
0 0 CALL (add_char (jc, c));
0 0 CALL (add_char (jc, c));
1086 23 89 if (jc->indent) {
1087 23 0 DINC;
1088 0 23 CALL (newline_indent (jc)); \
0 0 CALL (newline_indent (jc)); \
0 0 CALL (newline_indent (jc)); \
1098 23 79 if (jc->indent) {
1099 23 0 DDEC;
1100 0 23 CALL (newline_indent (jc)); \
0 0 CALL (newline_indent (jc)); \
0 0 CALL (newline_indent (jc)); \
1103 0 102 CALL (add_char (jc, c));
0 0 CALL (add_char (jc, c));
0 0 CALL (add_char (jc, c));
1105 23 79 if (jc->indent) {
1108 6 17 if (jc->depth == 0) {
1109 0 6 CALL (add_char (jc, '\n'));
0 0 CALL (add_char (jc, '\n'));
0 0 CALL (add_char (jc, '\n'));
1134 0 11 PUSHMARK(SP);
1135 0 11 EXTEND(SP, 2);
1136 0 11 XPUSHs(sv_2mortal (newSVsv (sa)));
1137 0 11 XPUSHs(sv_2mortal (newSVsv (sb)));
1140 0 11 if (n != 1) {
1145 11 0 c = POPi;
1147 11 0 FREETMPS;
1160 0 17 if (n_keys == 0) {
1161 0 0 CALL (add_str_len (jc, "{}", strlen ("{}")));
0 0 CALL (add_str_len (jc, "{}", strlen ("{}")));
0 0 CALL (add_str_len (jc, "{}", strlen ("{}")));
1164 0 17 CALL (add_open (jc, '{'));
0 0 CALL (add_open (jc, '{'));
0 0 CALL (add_open (jc, '{'));
1165 0 17 Newxz (keys, n_keys, SV *);
1167 70 17 for (i = 0; i < n_keys; i++) {
1171 0 70 if (HeUTF8 (he)) {
33 37 if (HeUTF8 (he)) {
1176 2 15 if (jc->cmp) {
1184 70 17 for (i = 0; i < n_keys; i++) {
1190 53 17 COMMA;
0 53 COMMA;
0 0 COMMA;
0 0 COMMA;
53 0 COMMA;
0 53 COMMA;
0 0 COMMA;
0 0 COMMA;
1192 70 0 key = SvPV (key_sv, keylen);
1193 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,
1196 0 70 if (! he) {
1200 0 70 CALL (add_char (jc, ':'));
0 0 CALL (add_char (jc, ':'));
0 0 CALL (add_char (jc, ':'));
1201 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)));
1206 0 17 CALL (add_close (jc, '}'));
0 0 CALL (add_close (jc, '}'));
0 0 CALL (add_close (jc, '}'));
1224 17 63 if (jc->sort) {
1229 1 62 if (n_keys == 0) {
1230 0 1 CALL (add_str_len (jc, "{}", strlen ("{}")));
0 0 CALL (add_str_len (jc, "{}", strlen ("{}")));
0 0 CALL (add_str_len (jc, "{}", strlen ("{}")));
1233 0 62 CALL (add_open (jc, '{'));
0 0 CALL (add_open (jc, '{'));
0 0 CALL (add_open (jc, '{'));
1234 141 53 for (i = 0; i < n_keys; i++) {
1246 79 62 COMMA;
0 79 COMMA;
0 0 COMMA;
0 0 COMMA;
2 77 COMMA;
0 2 COMMA;
0 0 COMMA;
0 0 COMMA;
1247 0 141 if (HeUTF8 (he)) {
4 137 if (HeUTF8 (he)) {
1249 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,
1252 45 92 else if (jc->strict) {
1253 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,
1257 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,
1260 0 139 CALL (add_char (jc, ':'));
0 0 CALL (add_char (jc, ':'));
0 0 CALL (add_char (jc, ':'));
1262 7 132 CALL (json_create_recursively (jc, value));
7 0 CALL (json_create_recursively (jc, value));
0 0 CALL (json_create_recursively (jc, value));
1264 0 53 CALL (add_close (jc, '}'));
0 0 CALL (add_close (jc, '}'));
0 0 CALL (add_close (jc, '}'));
1280 0 33 CALL (add_open (jc, '['));
0 0 CALL (add_open (jc, '['));
0 0 CALL (add_open (jc, '['));
1287 163 32 for (i = 0; i < n_keys; i++) {
1289 130 33 COMMA;
0 130 COMMA;
0 0 COMMA;
0 0 COMMA;
16 114 COMMA;
0 16 COMMA;
0 0 COMMA;
0 0 COMMA;
1292 163 0 if (avv) {
1299 1 162 CALL (json_create_recursively (jc, value));
1 0 CALL (json_create_recursively (jc, value));
0 0 CALL (json_create_recursively (jc, value));
1302 0 32 CALL (add_close (jc, ']'));
0 0 CALL (add_close (jc, ']'));
0 0 CALL (add_close (jc, ']'));
1310 2 3 if (jc->type_handler) {
1311 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));
1333 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));
1338 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));
1344 0 0 STRICT_NO_SCALAR;
1345 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));
1351 1 1 STRICT_NO_SCALAR;
1352 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));
1357 1 1 STRICT_NO_SCALAR;
1358 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));
1363 0 2 STRICT_NO_SCALAR;
1364 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));
1369 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));
1394 17 0 if (sv_ptr) {
1397 9 8 pv = SvPV (*sv_ptr, pvlen);
1401 9 8 if (pvlen == strlen ("bool") &&
9 0 if (pvlen == strlen ("bool") &&
1403 9 0 if (SvTRUE (r)) {
0 9 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
1 8 if (SvTRUE (r)) {
1 0 if (SvTRUE (r)) {
0 1 if (SvTRUE (r)) {
1 7 if (SvTRUE (r)) {
1 0 if (SvTRUE (r)) {
0 1 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
1 0 if (SvTRUE (r)) {
7 0 if (SvTRUE (r)) {
7 0 if (SvTRUE (r)) {
2 5 if (SvTRUE (r)) {
0 2 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
5 2 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
1404 0 6 ADD ("true");
0 0 ADD ("true");
0 0 ADD ("true");
1407 0 3 ADD ("false");
0 0 ADD ("false");
0 0 ADD ("false");
1410 8 0 else if (SvROK (*sv_ptr)) {
1413 8 0 switch (SvTYPE (what)) {
1415 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));
1426 0 0 if (JCEH) {
1454 0 0 if (jc->strict) {
1457 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));
1472 28 117 if (sv_isobject (input)) {
1477 7 21 if (olen == strlen (JCBOOL) &&
4 3 if (olen == strlen (JCBOOL) &&
1479 4 0 if (SvTRUE (r)) {
0 4 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
0 4 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
0 4 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
4 0 if (SvTRUE (r)) {
4 0 if (SvTRUE (r)) {
2 2 if (SvTRUE (r)) {
0 2 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
2 2 if (SvTRUE (r)) {
0 0 if (SvTRUE (r)) {
1480 0 2 ADD("true");
0 0 ADD("true");
0 0 ADD("true");
1483 0 2 ADD("false");
0 0 ADD("false");
0 0 ADD("false");
1487 1 23 if (jc->obj_handler) {
1488 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));
1491 17 6 if (jc->handlers) {
1492 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));
1495 1 5 if (jc->strict) {
1503 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));
1528 0 0 ADD ("null");
0 0 ADD ("null");
0 0 ADD ("null");
1533 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));
1538 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));
1543 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));
1548 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));
1552 10 0 if (SvNIOK (r)) {
1553 7 3 if (SvNOK (r)) {
1561 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));
1563 3 0 else if (SvIOK (r)) {
1571 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));
1576 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));
1581 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));
1588 1 0 if (SvIOK (r)) {
1590 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));
1603 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));
1608 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));
1610 77 245 TOP_NEWLINE;
0 77 TOP_NEWLINE;
0 0 TOP_NEWLINE;
0 0 TOP_NEWLINE;
0 0 TOP_NEWLINE;
1624 8 476 if (! SvOK (input)) {
8 0 if (! SvOK (input)) {
8 0 if (! SvOK (input)) {
1628 0 8 ADD ("null");
0 0 ADD ("null");
0 0 ADD ("null");
1629 1 7 TOP_NEWLINE;
1 0 TOP_NEWLINE;
0 1 TOP_NEWLINE;
0 0 TOP_NEWLINE;
0 0 TOP_NEWLINE;
1634 2 474 if (input == &PL_sv_yes) {
1636 0 2 ADD ("true");
0 0 ADD ("true");
0 0 ADD ("true");
1639 2 472 if (input == &PL_sv_no) {
1641 0 2 ADD ("false");
0 0 ADD ("false");
0 0 ADD ("false");
1644 145 327 if (SvROK (input)) {
1645 18 127 CALL (json_create_refobj (jc, input));
18 0 CALL (json_create_refobj (jc, input));
0 0 CALL (json_create_refobj (jc, input));
1648 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));
1690 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));
1691 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));
1693 24 73 if (jc->unicode && ! jc->downgrade_utf8) {
23 1 if (jc->unicode && ! jc->downgrade_utf8) {
1694 0 23 if (jc->utf8_dangerous) {
1695 0 0 if (is_utf8_string ((U8 *) SvPV_nolen (jc->output),
0 0 if (is_utf8_string ((U8 *) SvPV_nolen (jc->output),
1740 2 26 if (jc->fformat) {
1755 0 4 CALL (json_create_free_fformat (jc));
0 0 CALL (json_create_free_fformat (jc));
0 0 CALL (json_create_free_fformat (jc));
1756 4 0 if (! SvTRUE (fformat)) {
0 4 if (! SvTRUE (fformat)) {
0 0 if (! SvTRUE (fformat)) {
0 4 if (! SvTRUE (fformat)) {
0 0 if (! SvTRUE (fformat)) {
0 0 if (! SvTRUE (fformat)) {
2 2 if (! SvTRUE (fformat)) {
2 0 if (! SvTRUE (fformat)) {
0 2 if (! SvTRUE (fformat)) {
0 0 if (! SvTRUE (fformat)) {
0 0 if (! SvTRUE (fformat)) {
0 2 if (! SvTRUE (fformat)) {
2 0 if (! SvTRUE (fformat)) {
2 0 if (! SvTRUE (fformat)) {
2 0 if (! SvTRUE (fformat)) {
0 2 if (! SvTRUE (fformat)) {
0 0 if (! SvTRUE (fformat)) {
2 0 if (! SvTRUE (fformat)) {
0 0 if (! SvTRUE (fformat)) {
1761 2 0 ff = SvPV (fformat, fflen);
1762 0 2 if (! strchr (ff, '%')) {
1767 8 2 for (i = 0; i < fflen; i++) {
1778 5 19 if (jc->handlers) {
1789 2 24 if (jc->type_handler) {
1800 1 24 if (jc->obj_handler) {
1811 1 24 if (jc->non_finite_handler) {
1822 1 24 if (jc->cmp) {
1833 0 24 CALL (json_create_free_fformat (jc));
0 0 CALL (json_create_free_fformat (jc));
0 0 CALL (json_create_free_fformat (jc));
1834 0 24 CALL (json_create_remove_handlers (jc));
0 0 CALL (json_create_remove_handlers (jc));
0 0 CALL (json_create_remove_handlers (jc));
1835 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));
1836 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));
1837 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));
1838 0 24 CALL (json_create_remove_cmp (jc));
0 0 CALL (json_create_remove_cmp (jc));
0 0 CALL (json_create_remove_cmp (jc));
1843 0 24 if (jc->n_mallocs != 0) {
1903 6 0 key = SvPV (key_sv, key_len);
1905 0 6 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
0 0 BOOL (downgrade_utf8);
1906 0 6 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
0 0 BOOL (escape_slash);
1907 0 6 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
0 0 BOOL (fatal_errors);
1908 4 2 BOOL (indent);
4 0 BOOL (indent);
4 0 BOOL (indent);
0 4 BOOL (indent);
0 0 BOOL (indent);
0 4 BOOL (indent);
0 0 BOOL (indent);
0 0 BOOL (indent);
0 4 BOOL (indent);
0 0 BOOL (indent);
0 0 BOOL (indent);
0 0 BOOL (indent);
0 0 BOOL (indent);
0 0 BOOL (indent);
4 0 BOOL (indent);
4 0 BOOL (indent);
0 4 BOOL (indent);
0 0 BOOL (indent);
0 0 BOOL (indent);
4 0 BOOL (indent);
0 0 BOOL (indent);
1909 0 2 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
0 0 BOOL (no_javascript_safe);
1910 0 2 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
0 0 BOOL (replace_bad_utf8);
1911 2 0 BOOL (sort);
2 0 BOOL (sort);
2 0 BOOL (sort);
0 2 BOOL (sort);
0 0 BOOL (sort);
0 2 BOOL (sort);
0 0 BOOL (sort);
0 0 BOOL (sort);
0 2 BOOL (sort);
0 0 BOOL (sort);
0 0 BOOL (sort);
0 0 BOOL (sort);
0 0 BOOL (sort);
0 0 BOOL (sort);
2 0 BOOL (sort);
2 0 BOOL (sort);
0 2 BOOL (sort);
0 0 BOOL (sort);
0 0 BOOL (sort);
2 0 BOOL (sort);
0 0 BOOL (sort);
1912 0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
0 0 BOOL (strict);
1913 0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
0 0 BOOL (unicode_upper);
1914 0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
0 0 BOOL (unicode_escape_all);
1915 0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
0 0 BOOL (validate);
1916 0 0 HANDLER (non_finite);
0 0 HANDLER (non_finite);
1917 0 0 HANDLER (object);
0 0 HANDLER (object);
1918 0 0 HANDLER (type);
0 0 HANDLER (type);