Branch Coverage

lib/Params/Validate/XS.xs
Criterion Covered Total %
branch 786 1452 54.1


line true false branch
85 0 0 if (NULL == module) {
95 0 0 PUSHMARK(SP);
96 0 0 XPUSHs(thing);
104 0 0 FREETMPS;
114 0 6918 if (! no_v)
117 6918 0 return SvTRUE(no_v);
0 6918 return SvTRUE(no_v);
0 0 return SvTRUE(no_v);
6684 234 return SvTRUE(no_v);
6684 0 return SvTRUE(no_v);
0 6684 return SvTRUE(no_v);
233 1 return SvTRUE(no_v);
233 0 return SvTRUE(no_v);
233 0 return SvTRUE(no_v);
233 0 return SvTRUE(no_v);
0 233 return SvTRUE(no_v);
233 0 return SvTRUE(no_v);
1 0 return SvTRUE(no_v);
1 0 return SvTRUE(no_v);
0 1 return SvTRUE(no_v);
0 0 return SvTRUE(no_v);
0 0 return SvTRUE(no_v);
1 0 return SvTRUE(no_v);
0 0 return SvTRUE(no_v);
128 12 44 if (mask & SCALAR) {
132 16 40 if (mask & ARRAYREF) {
133 0 16 sv_catpv(buffer, empty ? "arrayref" : " arrayref");
136 6 50 if (mask & HASHREF) {
137 2 4 sv_catpv(buffer, empty ? "hashref" : " hashref");
140 2 54 if (mask & CODEREF) {
141 0 2 sv_catpv(buffer, empty ? "coderef" : " coderef");
144 6 50 if (mask & GLOB) {
145 0 6 sv_catpv(buffer, empty ? "glob" : " glob");
148 8 48 if (mask & GLOBREF) {
149 2 6 sv_catpv(buffer, empty ? "globref" : " globref");
152 2 54 if (mask & SCALARREF) {
153 0 2 sv_catpv(buffer, empty ? "scalarref" : " scalarref");
156 2 54 if (mask & UNDEF) {
157 0 2 sv_catpv(buffer, empty ? "undef" : " undef");
160 6 50 if (mask & OBJECT) {
161 0 6 sv_catpv(buffer, empty ? "object" : " object");
164 0 56 if (mask & UNKNOWN) {
165 0 0 sv_catpv(buffer, empty ? "unknown" : " unknown");
177 2115 11 if (SvTYPE(sv) == SVt_PVGV) {
180 6 2109 if (!SvOK(sv)) {
6 0 if (!SvOK(sv)) {
0 6 if (!SvOK(sv)) {
183 56 2053 if (!SvROK(sv)) {
187 0 56 switch (SvTYPE(SvRV(sv))) {
225 56 0 if (type) {
226 7 49 if (sv_isobject(sv)) return type | OBJECT;
240 50 12 rawstr = SvPV(string, len);
241 62 0 if (len) {
242 28 34 switch(rawstr[0]) {
16 12 switch(rawstr[0]) {
257 7 80 if(SvOK(value)) {
7 0 if(SvOK(value)) {
0 7 if(SvOK(value)) {
258 16 64 return (void *)form("\"%s\"", SvPV_nolen(value));
272 13 142 if ((temp = hv_fetch(options, "on_fail", 7, 0))) {
273 0 13 SvGETMAGIC(*temp);
284 0 155 PUSHMARK(SP);
285 0 155 mXPUSHs(message);
289 13 142 if (on_fail) {
301 0 0 FREETMPS;
313 1 147 if ((temp = hv_fetch(options, "called", 6, 0))) {
314 0 1 SvGETMAGIC(*temp);
328 13 134 if ((temp = hv_fetch(options, "stack_skip", 10, 0))) {
329 0 13 SvGETMAGIC(*temp);
330 13 0 frame = SvIV(*temp);
337 147 0 if (frame > 0) {
343 147 0 if (cx) {
351 110 0 if (cvgv && isGV(cvgv)) {
110 0 if (cvgv && isGV(cvgv)) {
386 44 0 if (! value) {
390 0 44 SvGETMAGIC(value);
391 2 42 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
2 0 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
0 2 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
8 34 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
6 2 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
6 0 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
400 0 40 PUSHMARK(SP);
401 0 40 EXTEND(SP, 2);
408 0 40 if (! count)
414 0 40 SvGETMAGIC(ret);
416 40 0 ok = SvTRUE(ret);
0 40 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
0 40 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
37 3 ok = SvTRUE(ret);
37 0 ok = SvTRUE(ret);
37 0 ok = SvTRUE(ret);
23 14 ok = SvTRUE(ret);
0 23 ok = SvTRUE(ret);
23 14 ok = SvTRUE(ret);
3 0 ok = SvTRUE(ret);
3 0 ok = SvTRUE(ret);
0 3 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
3 0 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
419 40 0 FREETMPS;
426 18 26 if (! ok) {
437 2 16 if ( SvOK(value) ) {
2 0 if ( SvOK(value) ) {
0 2 if ( SvOK(value) ) {
456 40 0 if (! value) {
460 0 40 SvGETMAGIC(value);
461 2 38 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
2 0 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
0 2 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
7 31 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
5 2 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
5 0 if (SvOK(value) && (sv_isobject(value) || (SvPOK(value) && ! looks_like_number(value)))) {
470 0 36 PUSHMARK(SP);
471 0 36 EXTEND(SP, 2);
478 0 36 if (! count)
484 0 36 SvGETMAGIC(ret);
486 36 0 ok = SvTRUE(ret);
0 36 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
9 27 ok = SvTRUE(ret);
9 0 ok = SvTRUE(ret);
0 9 ok = SvTRUE(ret);
0 27 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
8 19 ok = SvTRUE(ret);
8 0 ok = SvTRUE(ret);
4 4 ok = SvTRUE(ret);
0 4 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
4 4 ok = SvTRUE(ret);
19 0 ok = SvTRUE(ret);
489 36 0 FREETMPS;
496 17 23 if (! ok) {
543 2128 1136 if ((temp = hv_fetch(spec, "type", 4, 0))) {
546 1 2127 if ( ! ( SvOK(*temp)
1 0 if ( ! ( SvOK(*temp)
0 1 if ( ! ( SvOK(*temp)
2126 0 if ( ! ( SvOK(*temp)
0 2126 if ( ! ( SvOK(*temp)
547 2126 1 && looks_like_number(*temp)
548 0 0 && SvIV(*temp) > 0 ) ) {
552 1 1 if ( SvOK(*temp) ) {
1 0 if ( SvOK(*temp) ) {
0 1 if ( SvOK(*temp) ) {
564 0 2126 SvGETMAGIC(*temp);
566 2126 0 if (! (type & SvIV(*temp))) {
28 2098 if (! (type & SvIV(*temp))) {
577 28 0 allowed = typemask_to_string(SvIV(*temp));
590 40 3194 if ((temp = hv_fetch(spec, "isa", 3, 0))) {
591 0 40 SvGETMAGIC(*temp);
593 4 36 if (SvROK(*temp) && SvTYPE(SvRV(*temp)) == SVt_PVAV) {
4 0 if (SvROK(*temp) && SvTYPE(SvRV(*temp)) == SVt_PVAV) {
596 8 2 for(i = 0; i <= av_len(array); i++) {
600 8 0 if (! package) {
604 0 8 SvGETMAGIC(package);
605 6 0 if (! validate_isa(value, package, id, options)) {
611 20 0 if (! validate_isa(value, *temp, id, options)) {
618 30 3186 if ((temp = hv_fetch(spec, "can", 3, 0))) {
619 0 30 SvGETMAGIC(*temp);
620 12 18 if (SvROK(*temp) && SvTYPE(SvRV(*temp)) == SVt_PVAV) {
12 0 if (SvROK(*temp) && SvTYPE(SvRV(*temp)) == SVt_PVAV) {
623 22 4 for (i = 0; i <= av_len(array); i++) {
627 22 0 if (! method) {
631 0 22 SvGETMAGIC(method);
633 14 0 if (! validate_can(value, method, id, options)) {
639 9 0 if (! validate_can(value, *temp, id, options)) {
646 3039 160 if ((temp = hv_fetch(spec, "callbacks", 9, 0))) {
649 0 3039 SvGETMAGIC(*temp);
650 3039 0 if (!(SvROK(*temp) && SvTYPE(SvRV(*temp)) == SVt_PVHV)) {
0 3039 if (!(SvROK(*temp) && SvTYPE(SvRV(*temp)) == SVt_PVHV)) {
661 3043 3020 while ((he = hv_iternext((HV*) SvRV(*temp)))) {
667 3043 0 if (!(SvROK(HeVAL(he)) && SvTYPE(SvRV(HeVAL(he))) == SVt_PVCV)) {
0 3043 if (!(SvROK(HeVAL(he)) && SvTYPE(SvRV(HeVAL(he))) == SVt_PVCV)) {
671 0 0 sv_catsv(buffer, HeSVKEY_force(he));
0 0 sv_catsv(buffer, HeSVKEY_force(he));
0 0 sv_catsv(buffer, HeSVKEY_force(he));
684 0 3043 PUSHMARK(SP);
685 0 3043 EXTEND(SP, 2);
692 3043 0 sv_setpv(ERRSV, "");
698 0 3043 if (!count) {
703 0 3043 SvGETMAGIC(ret);
704 3043 0 ok = SvTRUE(ret);
0 3043 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
6 3037 ok = SvTRUE(ret);
6 0 ok = SvTRUE(ret);
0 6 ok = SvTRUE(ret);
3032 5 ok = SvTRUE(ret);
3032 0 ok = SvTRUE(ret);
3031 1 ok = SvTRUE(ret);
3018 13 ok = SvTRUE(ret);
0 3018 ok = SvTRUE(ret);
3019 13 ok = SvTRUE(ret);
5 0 ok = SvTRUE(ret);
5 0 ok = SvTRUE(ret);
0 5 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
5 0 ok = SvTRUE(ret);
0 0 ok = SvTRUE(ret);
707 3043 0 SvSetSV_nosteal(err, ERRSV);
3043 0 SvSetSV_nosteal(err, ERRSV);
3043 0 SvSetSV_nosteal(err, ERRSV);
710 3043 0 FREETMPS;
713 19 3024 if (! ok) {
714 1 18 if (SvROK(err)) {
725 18 0 sv_catsv(buffer, HeSVKEY_force(he));
0 18 sv_catsv(buffer, HeSVKEY_force(he));
18 0 sv_catsv(buffer, HeSVKEY_force(he));
727 4 14 if (SvCUR(err) > 0) {
742 9 3171 if ((temp = hv_fetch(spec, "regex", 5, 0))) {
748 0 9 SvGETMAGIC(*temp);
749 6 3 if (SvPOK(*temp)) {
752 6 0 else if (SvROK(*temp)) {
762 6 0 if (SvTYPE(svp) == SVt_REGEXP) {
768 0 9 if (!has_regex) {
778 0 9 PUSHMARK(SP);
779 0 9 EXTEND(SP, 2);
785 9 0 ok = POPi;
788 4 5 if (! ok) {
800 0 3176 if ((temp = hv_fetch(spec, "untaint", 7, 0))) {
801 0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
0 0 if (SvTRUE(*temp)) {
815 121 42 while ((he = hv_iternext(in))) {
816 121 0 if (!hv_store_ent(out, HeSVKEY_force(he),
0 121 if (!hv_store_ent(out, HeSVKEY_force(he),
121 0 if (!hv_store_ent(out, HeSVKEY_force(he),
0 121 if (!hv_store_ent(out, HeSVKEY_force(he),
831 3314 20 if (len > -1 && len % 2 != 1) {
3 3311 if (len > -1 && len % 2 != 1) {
842 3460 3331 for (i = 0; i <= av_len(in); i += 2) {
847 0 3460 if (! key) {
851 1 3459 SvGETMAGIC(key);
859 3460 0 if (value) {
860 0 3460 SvGETMAGIC(value);
863 0 3460 if (! hv_store_ent(out, key, SvREFCNT_inc(value), 0)) {
886 3427 0 pkg = sv_2mortal(newSVpv(HvNAME(stash), 0));
3427 0 pkg = sv_2mortal(newSVpv(HvNAME(stash), 0));
0 3427 pkg = sv_2mortal(newSVpv(HvNAME(stash), 0));
0 0 pkg = sv_2mortal(newSVpv(HvNAME(stash), 0));
3427 0 pkg = sv_2mortal(newSVpv(HvNAME(stash), 0));
0 3427 pkg = sv_2mortal(newSVpv(HvNAME(stash), 0));
889 40 3387 if ((he = hv_fetch_ent(OPTIONS, pkg, 0, 0))) {
891 0 40 SvGETMAGIC(pkg_options);
892 40 0 if (SvROK(pkg_options) && SvTYPE(SvRV(pkg_options)) == SVt_PVHV) {
40 0 if (SvROK(pkg_options) && SvTYPE(SvRV(pkg_options)) == SVt_PVHV) {
893 2 38 if (options) {
901 40 3349 if (options) {
919 9 99 if (normalize_func) {
924 0 9 PUSHMARK(SP);
925 0 9 XPUSHs(copy);
927 0 9 if (! call_sv(SvRV(normalize_func), G_SCALAR)) {
934 1 8 if (! SvOK(normalized)) {
1 0 if (! SvOK(normalized)) {
1 0 if (! SvOK(normalized)) {
935 1 0 croak("The normalize_keys callback did not return a defined value when normalizing the key '%s'", SvPV_nolen(copy));
940 99 0 else if (ignore_case || strip_leading) {
941 42 57 if (ignore_case) {
944 42 0 rawstr = SvPV(copy, len);
945 126 42 for (i = 0; i < len; i++) {
947 69 57 *(rawstr + i) = toLOWER(*(rawstr + i));
951 81 18 if (strip_leading) {
952 48 33 rawstr_sl = SvPV(strip_leading, len_sl);
953 81 0 rawstr = SvPV(copy, len);
955 71 10 if (len > len_sl && strnEQ(rawstr_sl, rawstr, len_sl)) {
3 68 if (len > len_sl && strnEQ(rawstr_sl, rawstr, len_sl)) {
970 50 50 if (!normalize_func && !ignore_case && !strip_leading) {
50 0 if (!normalize_func && !ignore_case && !strip_leading) {
976 108 98 while ((he = hv_iternext(p))) {
978 108 0 normalize_one_key(HeSVKEY_force(he), normalize_func, strip_leading, ignore_case);
0 108 normalize_one_key(HeSVKEY_force(he), normalize_func, strip_leading, ignore_case);
108 0 normalize_one_key(HeSVKEY_force(he), normalize_func, strip_leading, ignore_case);
980 1 106 if (hv_fetch_ent(norm_p, normalized, 0, 0)) {
981 1 0 croak("The normalize_keys callback returned a key that already exists, '%s', when normalizing the key '%s'",
1 0 croak("The normalize_keys callback returned a key that already exists, '%s', when normalizing the key '%s'",
982 1 0 SvPV_nolen(normalized), SvPV_nolen(HeSVKEY_force(he)));
0 1 SvPV_nolen(normalized), SvPV_nolen(HeSVKEY_force(he)));
1 0 SvPV_nolen(normalized), SvPV_nolen(HeSVKEY_force(he)));
1 0 SvPV_nolen(normalized), SvPV_nolen(HeSVKEY_force(he)));
0 1 SvPV_nolen(normalized), SvPV_nolen(HeSVKEY_force(he)));
1 0 SvPV_nolen(normalized), SvPV_nolen(HeSVKEY_force(he)));
0 0 SvPV_nolen(normalized), SvPV_nolen(HeSVKEY_force(he)));
0 0 SvPV_nolen(normalized), SvPV_nolen(HeSVKEY_force(he)));
0 0 SvPV_nolen(normalized), SvPV_nolen(HeSVKEY_force(he)));
985 0 106 if (! hv_store_ent(norm_p, normalized, SvREFCNT_inc(HeVAL(he)), 0)) {
999 44 17 for (p_idx = 0; p_idx <= av_len(p); p_idx++) {
1002 38 6 if (p_spec != NULL && SvROK(*p_spec) &&
19 19 if (p_spec != NULL && SvROK(*p_spec) &&
19 0 if (p_spec != NULL && SvROK(*p_spec) &&
1007 3 16 if (! depends) {
1011 1 2 if (SvROK(*depends)) {
1015 2 0 if (av_len(p) < SvIV(*depends) -1) {
1 1 if (av_len(p) < SvIV(*depends) -1) {
1017 1 0 newSVpvf("Parameter #%d depends on parameter #%d, which was not given",
1047 3186 3153 while ((he = hv_iternext(p))) {
1048 3186 0 he1 = hv_fetch_ent(specs, HeSVKEY_force(he), 0, HeHASH(he));
0 3186 he1 = hv_fetch_ent(specs, HeSVKEY_force(he), 0, HeHASH(he));
3186 0 he1 = hv_fetch_ent(specs, HeSVKEY_force(he), 0, HeHASH(he));
1050 3181 5 if (he1 && SvROK(HeVAL(he1)) &&
3117 64 if (he1 && SvROK(HeVAL(he1)) &&
3117 0 if (he1 && SvROK(HeVAL(he1)) &&
1053 6 3111 if (hv_exists((HV*) SvRV(HeVAL(he1)), "depends", 7)) {
1057 6 0 if (! depends_value) {
1061 2 4 if (! SvROK(*depends_value)) {
1066 1 3 else if (SvTYPE(SvRV(*depends_value)) == SVt_PVAV) {
1073 7 2 for (d_idx =0; d_idx <= av_len(depends_list); d_idx++) {
1080 7 0 if (!hv_exists(p, SvPV_nolen(depend_name),
3 4 if (!hv_exists(p, SvPV_nolen(depend_name),
1087 3 0 if (!hv_exists(specs, SvPV_nolen(depend_name),
0 3 if (!hv_exists(specs, SvPV_nolen(depend_name),
1093 0 0 sv_catsv(buffer, HeSVKEY_force(he1));
0 0 sv_catsv(buffer, HeSVKEY_force(he1));
0 0 sv_catsv(buffer, HeSVKEY_force(he1));
1097 0 0 croak("%s", SvPV_nolen(buffer));
1103 3 0 sv_catsv(buffer, HeSVKEY_force(he1));
0 3 sv_catsv(buffer, HeSVKEY_force(he1));
3 0 sv_catsv(buffer, HeSVKEY_force(he1));
1122 3355 3229 while ((he = hv_iternext(specs))) {
1129 3355 0 if (val && SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVHV) {
3249 106 if (val && SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVHV) {
3249 0 if (val && SvROK(val) && SvTYPE(SvRV(val)) == SVt_PVHV) {
1137 3355 0 if (hv_exists_ent(p, HeSVKEY_force(he), HeHASH(he))) {
0 3355 if (hv_exists_ent(p, HeSVKEY_force(he), HeHASH(he))) {
3355 0 if (hv_exists_ent(p, HeSVKEY_force(he), HeHASH(he))) {
3284 71 if (hv_exists_ent(p, HeSVKEY_force(he), HeHASH(he))) {
1142 50 21 if (spec && (temp = hv_fetch(spec, "default", 7, 0))) {
17 33 if (spec && (temp = hv_fetch(spec, "default", 7, 0))) {
1145 0 17 SvGETMAGIC(*temp);
1149 9 8 if (GIMME_V != G_VOID) {
16 1 if (GIMME_V != G_VOID) {
1150 16 0 if (!hv_store_ent(ret, HeSVKEY_force(he),
0 16 if (!hv_store_ent(ret, HeSVKEY_force(he),
16 0 if (!hv_store_ent(ret, HeSVKEY_force(he),
0 16 if (!hv_store_ent(ret, HeSVKEY_force(he),
1161 38 16 if (! no_validation()) {
1164 25 13 if (spec) {
1165 13 12 if ((temp = hv_fetch(spec, "optional", 8, 0))) {
1166 0 13 SvGETMAGIC(*temp);
1168 13 0 if (SvTRUE(*temp)) continue;
0 13 if (SvTRUE(*temp)) continue;
0 13 if (SvTRUE(*temp)) continue;
0 0 if (SvTRUE(*temp)) continue;
0 0 if (SvTRUE(*temp)) continue;
0 13 if (SvTRUE(*temp)) continue;
0 0 if (SvTRUE(*temp)) continue;
0 0 if (SvTRUE(*temp)) continue;
0 0 if (SvTRUE(*temp)) continue;
0 0 if (SvTRUE(*temp)) continue;
13 0 if (SvTRUE(*temp)) continue;
13 0 if (SvTRUE(*temp)) continue;
0 13 if (SvTRUE(*temp)) continue;
0 0 if (SvTRUE(*temp)) continue;
0 0 if (SvTRUE(*temp)) continue;
13 0 if (SvTRUE(*temp)) continue;
1171 13 0 else if (!SvTRUE(HeVAL(he))) {
0 13 else if (!SvTRUE(HeVAL(he))) {
0 0 else if (!SvTRUE(HeVAL(he))) {
0 13 else if (!SvTRUE(HeVAL(he))) {
0 0 else if (!SvTRUE(HeVAL(he))) {
0 0 else if (!SvTRUE(HeVAL(he))) {
0 13 else if (!SvTRUE(HeVAL(he))) {
0 0 else if (!SvTRUE(HeVAL(he))) {
0 0 else if (!SvTRUE(HeVAL(he))) {
0 0 else if (!SvTRUE(HeVAL(he))) {
0 0 else if (!SvTRUE(HeVAL(he))) {
0 0 else if (!SvTRUE(HeVAL(he))) {
13 0 else if (!SvTRUE(HeVAL(he))) {
13 0 else if (!SvTRUE(HeVAL(he))) {
2 11 else if (!SvTRUE(HeVAL(he))) {
0 2 else if (!SvTRUE(HeVAL(he))) {
0 0 else if (!SvTRUE(HeVAL(he))) {
2 11 else if (!SvTRUE(HeVAL(he))) {
0 0 else if (!SvTRUE(HeVAL(he))) {
1174 23 0 av_push(missing, SvREFCNT_inc(HeSVKEY_force(he)));
0 23 av_push(missing, SvREFCNT_inc(HeSVKEY_force(he)));
23 0 av_push(missing, SvREFCNT_inc(HeSVKEY_force(he)));
1195 56 3286 if ((temp = hv_fetch(options, "ignore_case", 11, 0))) {
1196 0 56 SvGETMAGIC(*temp);
1197 56 0 ignore_case = SvTRUE(*temp);
0 56 ignore_case = SvTRUE(*temp);
0 0 ignore_case = SvTRUE(*temp);
0 56 ignore_case = SvTRUE(*temp);
0 0 ignore_case = SvTRUE(*temp);
0 0 ignore_case = SvTRUE(*temp);
36 20 ignore_case = SvTRUE(*temp);
36 0 ignore_case = SvTRUE(*temp);
36 0 ignore_case = SvTRUE(*temp);
36 0 ignore_case = SvTRUE(*temp);
18 18 ignore_case = SvTRUE(*temp);
18 18 ignore_case = SvTRUE(*temp);
20 0 ignore_case = SvTRUE(*temp);
20 0 ignore_case = SvTRUE(*temp);
16 4 ignore_case = SvTRUE(*temp);
0 16 ignore_case = SvTRUE(*temp);
0 0 ignore_case = SvTRUE(*temp);
4 16 ignore_case = SvTRUE(*temp);
0 0 ignore_case = SvTRUE(*temp);
1200 38 3304 if ((temp = hv_fetch(options, "strip_leading", 13, 0))) {
1201 0 38 SvGETMAGIC(*temp);
1202 0 38 if (SvOK(*temp)) strip_leading = *temp;
0 0 if (SvOK(*temp)) strip_leading = *temp;
0 0 if (SvOK(*temp)) strip_leading = *temp;
1205 42 3300 if ((temp = hv_fetch(options, "normalize_keys", 14, 0))) {
1206 0 42 SvGETMAGIC(*temp);
1207 5 37 if(SvROK(*temp) && SvTYPE(SvRV(*temp)) == SVt_PVCV) {
5 0 if(SvROK(*temp) && SvTYPE(SvRV(*temp)) == SVt_PVCV) {
1212 3316 26 if (normalize_func || ignore_case || strip_leading) {
25 3291 if (normalize_func || ignore_case || strip_leading) {
1218 76 3264 if (no_validation()) {
1219 5 71 if (GIMME_V != G_VOID) {
76 0 if (GIMME_V != G_VOID) {
1220 115 76 while ((he = hv_iternext(p))) {
1222 0 115 if (! hv) {
1226 0 115 SvGETMAGIC(hv);
1229 115 0 if (!hv_store_ent(ret, HeSVKEY_force(he), SvREFCNT_inc(hv),
0 115 if (!hv_store_ent(ret, HeSVKEY_force(he), SvREFCNT_inc(hv),
115 0 if (!hv_store_ent(ret, HeSVKEY_force(he), SvREFCNT_inc(hv),
0 115 if (!hv_store_ent(ret, HeSVKEY_force(he), SvREFCNT_inc(hv),
1241 34 3230 if ((temp = hv_fetch(options, "allow_extra", 11, 0))) {
1242 0 34 SvGETMAGIC(*temp);
1243 34 0 allow_extra = SvTRUE(*temp);
0 34 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 34 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 34 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
34 0 allow_extra = SvTRUE(*temp);
34 0 allow_extra = SvTRUE(*temp);
29 5 allow_extra = SvTRUE(*temp);
0 29 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
5 29 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
1250 3318 3157 while ((he = hv_iternext(p))) {
1252 0 3318 if (! hv) {
1256 0 3318 SvGETMAGIC(hv);
1259 3123 195 if (GIMME_V != G_VOID) {
3236 82 if (GIMME_V != G_VOID) {
1260 3236 0 if (!hv_store_ent(ret, HeSVKEY_force(he), SvREFCNT_inc(hv),
0 3236 if (!hv_store_ent(ret, HeSVKEY_force(he), SvREFCNT_inc(hv),
3236 0 if (!hv_store_ent(ret, HeSVKEY_force(he), SvREFCNT_inc(hv),
0 3236 if (!hv_store_ent(ret, HeSVKEY_force(he), SvREFCNT_inc(hv),
1269 3318 0 he1 = hv_fetch_ent(specs, HeSVKEY_force(he), 0, HeHASH(he));
0 3318 he1 = hv_fetch_ent(specs, HeSVKEY_force(he), 0, HeHASH(he));
3318 0 he1 = hv_fetch_ent(specs, HeSVKEY_force(he), 0, HeHASH(he));
1270 3287 31 if(he1) {
1272 3215 72 if (SvROK(hv1) && SvTYPE(SvRV(hv1)) == SVt_PVHV) {
3215 0 if (SvROK(hv1) && SvTYPE(SvRV(hv1)) == SVt_PVHV) {
1278 0 3215 buffer = form("The '%s' parameter (%%s)", HePV(he, PL_na));
0 0 buffer = form("The '%s' parameter (%%s)", HePV(he, PL_na));
1280 0 3134 if (! validate_one_param(hv, (SV*) p, spec, buffer, options, &untaint))
1285 0 3134 if (untaint) {
1286 0 0 av_push(untaint_keys, SvREFCNT_inc(HeSVKEY_force(he1)));
0 0 av_push(untaint_keys, SvREFCNT_inc(HeSVKEY_force(he1)));
0 0 av_push(untaint_keys, SvREFCNT_inc(HeSVKEY_force(he1)));
1290 26 5 else if (! allow_extra) {
1291 26 0 av_push(unmentioned, SvREFCNT_inc(HeSVKEY_force(he)));
0 26 av_push(unmentioned, SvREFCNT_inc(HeSVKEY_force(he)));
26 0 av_push(unmentioned, SvREFCNT_inc(HeSVKEY_force(he)));
1294 26 3211 if (av_len(unmentioned) > -1) {
1298 0 26 if (av_len(unmentioned) != 0) {
1308 0 26 if (av_len(unmentioned) != 0) {
1315 26 26 for(i = 0; i <= av_len(unmentioned); i++) {
1317 0 26 if (i < av_len(unmentioned)) {
1334 13 3140 if (av_len(missing) > -1) {
1342 4 9 if (av_len(missing) > 0) {
1349 23 13 for(i = 0; i <= av_len(missing); i++) {
1350 23 0 sv_catpvf(buffer, "'%s'",
1352 10 13 if (i < av_len(missing)) {
1364 3068 72 if (GIMME_V != G_VOID) {
3108 32 if (GIMME_V != G_VOID) {
1365 0 3108 for (i = 0; i <= av_len(untaint_keys); i++) {
1366 0 0 SvTAINTED_off(HeVAL(hv_fetch_ent(p, *av_fetch(untaint_keys, i, 0), 0, 0)));
1379 0 21 if ((temp = hv_fetch(options, "allow_extra", 11, 0))) {
1380 0 0 SvGETMAGIC(*temp);
1381 0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
1388 19 2 if (pnum != 0) {
1396 21 0 if (!allow_extra) {
1397 16 5 if (min != max) {
1407 0 21 if ((allow_extra ? min : max) != 0) {
18 3 if ((allow_extra ? min : max) != 0) {
1424 78 47 if (complex_spec) {
1425 29 49 if ((temp = hv_fetch((HV*) SvRV(spec), "optional", 8, 0))) {
1426 0 29 SvGETMAGIC(*temp);
1427 29 0 if (!SvTRUE(*temp))
0 29 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
0 29 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
0 29 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
29 0 if (!SvTRUE(*temp))
29 0 if (!SvTRUE(*temp))
0 29 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
0 29 if (!SvTRUE(*temp))
0 0 if (!SvTRUE(*temp))
1435 47 0 if (SvTRUE(spec)) {
0 47 if (SvTRUE(spec)) {
0 47 if (SvTRUE(spec)) {
0 0 if (SvTRUE(spec)) {
0 0 if (SvTRUE(spec)) {
0 47 if (SvTRUE(spec)) {
0 0 if (SvTRUE(spec)) {
0 0 if (SvTRUE(spec)) {
0 0 if (SvTRUE(spec)) {
0 0 if (SvTRUE(spec)) {
47 0 if (SvTRUE(spec)) {
47 0 if (SvTRUE(spec)) {
13 34 if (SvTRUE(spec)) {
0 13 if (SvTRUE(spec)) {
0 0 if (SvTRUE(spec)) {
13 34 if (SvTRUE(spec)) {
1456 57 25 if (no_validation()) {
1461 1 24 if (GIMME_V == G_VOID) {
25 0 if (GIMME_V == G_VOID) {
1465 62 25 for (i = 0; i <= max; i++) {
1466 58 4 if (i <= spec_count) {
1468 58 0 if (spec) {
1469 0 58 SvGETMAGIC(spec);
1471 35 23 complex_spec = (SvROK(spec) && SvTYPE(SvRV(spec)) == SVt_PVHV);
0 35 complex_spec = (SvROK(spec) && SvTYPE(SvRV(spec)) == SVt_PVHV);
1474 36 26 if (i <= av_len(p)) {
1476 0 36 SvGETMAGIC(value);
1478 15 11 } else if (complex_spec &&
6 9 } else if (complex_spec &&
1480 0 6 SvGETMAGIC(*temp);
1488 105 35 for (i = 0; i <= av_len(specs); i++) {
1490 0 105 if (! spec) {
1493 0 105 SvGETMAGIC(spec);
1494 70 35 complex_spec = (SvROK(spec) && SvTYPE(SvRV(spec)) == SVt_PVHV);
0 70 complex_spec = (SvROK(spec) && SvTYPE(SvRV(spec)) == SVt_PVHV);
1499 75 30 if (! spec_says_optional(spec, complex_spec) ) {
1503 72 33 if (i <= av_len(p)) {
1505 1 71 SvGETMAGIC(value);
1507 49 23 if (complex_spec) {
1512 0 42 if (! validate_one_param(value, (SV*) p, (HV*) SvRV(spec), buffer, options, &untaint)) {
1516 0 42 if (untaint) {
1521 11 54 if (GIMME_V != G_VOID) {
54 11 if (GIMME_V != G_VOID) {
1525 21 12 } else if (complex_spec &&
7 14 } else if (complex_spec &&
1527 0 7 SvGETMAGIC(*temp);
1529 3 4 if (GIMME_V != G_VOID) {
7 0 if (GIMME_V != G_VOID) {
1535 15 11 if (i == min) {
1542 20 3 for (i++ ; i <= av_len(specs); i++) {
1544 0 20 if (! spec) {
1548 0 20 SvGETMAGIC(spec);
1549 8 12 complex_spec = (SvROK(spec) && SvTYPE(SvRV(spec)) == SVt_PVHV);
0 8 complex_spec = (SvROK(spec) && SvTYPE(SvRV(spec)) == SVt_PVHV);
1550 8 12 if (! spec_says_optional(spec, complex_spec)) {
1553 8 12 if (min != i)
1567 8 25 if (av_len(p) > av_len(specs)) {
1568 2 6 if ((temp = hv_fetch(options, "allow_extra", 11, 0))) {
1569 0 2 SvGETMAGIC(*temp);
1570 2 0 allow_extra = SvTRUE(*temp);
0 2 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 2 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 2 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
2 0 allow_extra = SvTRUE(*temp);
2 0 allow_extra = SvTRUE(*temp);
0 2 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
2 0 allow_extra = SvTRUE(*temp);
0 0 allow_extra = SvTRUE(*temp);
1575 2 6 if (allow_extra) {
1577 0 2 if (GIMME_V != G_VOID) {
2 0 if (GIMME_V != G_VOID) {
1578 2 2 for(i = av_len(specs) + 1; i <= av_len(p); i++) {
1580 2 0 if (value) {
1581 0 2 SvGETMAGIC(value);
1596 7 20 if (GIMME_V != G_VOID) {
22 5 if (GIMME_V != G_VOID) {
1597 0 22 for (i = 0; i <= av_len(untaint_indexes); i++) {
1598 0 0 SvTAINTED_off(*av_fetch(p, SvIV(*av_fetch(untaint_indexes, i, 0)), 0));
0 0 SvTAINTED_off(*av_fetch(p, SvIV(*av_fetch(untaint_indexes, i, 0)), 0));
1622 82 3237 if (no_validation() && GIMME_V == G_VOID) {
9 73 if (no_validation() && GIMME_V == G_VOID) {
10 72 if (no_validation() && GIMME_V == G_VOID) {
1626 0 3309 SvGETMAGIC(p);
1627 3309 0 if (! (SvROK(p) && SvTYPE(SvRV(p)) == SVt_PVAV)) {
0 3309 if (! (SvROK(p) && SvTYPE(SvRV(p)) == SVt_PVAV)) {
1631 0 3309 SvGETMAGIC(specs);
1632 3309 0 if (! (SvROK(specs) && SvTYPE(SvRV(specs)) == SVt_PVHV)) {
0 3309 if (! (SvROK(specs) && SvTYPE(SvRV(specs)) == SVt_PVHV)) {
1638 11 3298 if (av_len(pa) == 0) {
1644 11 0 if (value) {
1645 0 11 SvGETMAGIC(value);
1646 8 3 if (SvROK(value) && SvTYPE(SvRV(value)) == SVt_PVHV) {
8 0 if (SvROK(value) && SvTYPE(SvRV(value)) == SVt_PVHV) {
1654 3301 8 if (! ph) {
1661 0 3298 if (!ok) {
1665 3085 221 if (GIMME_V != G_VOID) {
3239 67 if (GIMME_V != G_VOID) {
1673 0 3189 if (! ok) {
1677 3046 143 RETURN_HASH(ret);
3155 0 RETURN_HASH(ret);
0 3155 RETURN_HASH(ret);
3227 0 RETURN_HASH(ret);
0 3227 RETURN_HASH(ret);
3227 0 RETURN_HASH(ret);
3227 3155 RETURN_HASH(ret);
0 4 RETURN_HASH(ret);
1692 24 54 if (no_validation() && GIMME_V == G_VOID) {
0 24 if (no_validation() && GIMME_V == G_VOID) {
0 24 if (no_validation() && GIMME_V == G_VOID) {
1696 0 78 SvGETMAGIC(p);
1697 78 0 if (!SvROK(p) || !(SvTYPE(SvRV(p)) == SVt_PVAV)) {
0 78 if (!SvROK(p) || !(SvTYPE(SvRV(p)) == SVt_PVAV)) {
1703 179 78 for(i = 1; i < items; i++) {
1704 0 179 if (!av_store(specs, i - 1, SvREFCNT_inc(ST(i)))) {
1710 8 70 if (GIMME_V != G_VOID) {
71 7 if (GIMME_V != G_VOID) {
1718 0 49 if (! ok) {
1722 5 44 RETURN_ARRAY(ret);
43 0 RETURN_ARRAY(ret);
0 43 RETURN_ARRAY(ret);
68 43 RETURN_ARRAY(ret);
0 2 RETURN_ARRAY(ret);
1735 11 34 if (no_validation() && GIMME_V == G_VOID) XSRETURN(0);
11 0 if (no_validation() && GIMME_V == G_VOID) XSRETURN(0);
5 6 if (no_validation() && GIMME_V == G_VOID) XSRETURN(0);
1739 109 40 for(i = 0; i < items; i += 2) {
1744 109 0 if (i + 1 < items) {
1750 0 109 if (! hv_store_ent(p, key, SvREFCNT_inc(value), 0)) {
1757 0 40 SvGETMAGIC(params);
1759 0 40 SvGETMAGIC(spec);
1761 40 0 if (SvROK(spec) && SvTYPE(SvRV(spec)) == SVt_PVAV) {
4 36 if (SvROK(spec) && SvTYPE(SvRV(spec)) == SVt_PVAV) {
1762 4 0 if (SvROK(params) && SvTYPE(SvRV(params)) == SVt_PVAV) {
4 0 if (SvROK(params) && SvTYPE(SvRV(params)) == SVt_PVAV) {
1765 4 0 if (GIMME_V != G_VOID) {
2 2 if (GIMME_V != G_VOID) {
1773 0 3 if (! ok) {
1777 3 0 RETURN_ARRAY(ret);
2 0 RETURN_ARRAY(ret);
0 2 RETURN_ARRAY(ret);
4 2 RETURN_ARRAY(ret);
0 0 RETURN_ARRAY(ret);
1783 36 0 else if (SvROK(spec) && SvTYPE(SvRV(spec)) == SVt_PVHV) {
36 0 else if (SvROK(spec) && SvTYPE(SvRV(spec)) == SVt_PVHV) {
1790 36 0 if (SvROK(params) && SvTYPE(SvRV(params)) == SVt_PVHV) {
35 1 if (SvROK(params) && SvTYPE(SvRV(params)) == SVt_PVHV) {
1793 35 0 else if (SvROK(params) && SvTYPE(SvRV(params)) == SVt_PVAV) {
35 0 else if (SvROK(params) && SvTYPE(SvRV(params)) == SVt_PVAV) {
1798 2 33 if (av_len((AV*) SvRV(params)) == 0) {
1803 2 0 if (first_elem && SvROK(*first_elem) &&
2 0 if (first_elem && SvROK(*first_elem) &&
2 0 if (first_elem && SvROK(*first_elem) &&
1811 33 2 if (! hv_set) {
1818 0 33 if (!ok) {
1827 36 0 if (GIMME_V != G_VOID) {
33 3 if (GIMME_V != G_VOID) {
1835 0 27 if (! ok) {
1839 27 0 RETURN_HASH(ret);
21 0 RETURN_HASH(ret);
0 21 RETURN_HASH(ret);
25 0 RETURN_HASH(ret);
0 25 RETURN_HASH(ret);
25 0 RETURN_HASH(ret);
25 21 RETURN_HASH(ret);
0 4 RETURN_HASH(ret);