Branch Coverage

CSV_XS.xs
Criterion Covered Total %
branch 1574 3084 51.0


line true false branch
383 67042 894 while (xs_errors[i].xs_errno && xs_errors[i].xs_errno != xse) i++;
64417 2625 while (xs_errors[i].xs_errno && xs_errors[i].xs_errno != xse) i++;
384 3519 0 if ((err = newSVpv (xs_errors[i].xs_errstr, 0))) {
385 3519 0 (void)SvUPGRADE (err, SVt_PVIV);
402 6 1676 if (xse == 0) {
408 325 1357 if (xse == 2012) /* EOF */
410 280 1402 if (csv->auto_diag) {
411 280 0 unless (_is_hashref (pself))
0 280 unless (_is_hashref (pself))
0 0 unless (_is_hashref (pself))
120 160 unless (_is_hashref (pself))
0 120 unless (_is_hashref (pself))
414 0 280 PUSHMARK (SP);
415 0 280 XPUSHs (pself);
419 159 118 unless (pself == csv->pself)
438 22477 705 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
0 22477 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
441 22477 0 cache = (byte *)SvPV_nolen (*svp);
444 16683 5794 if (SvPOK (val))
445 16683 0 cp = SvPV (val, len);
446 5782 16695 if (SvIOK (val))
447 5782 0 iv = SvIV (val);
448 0 16695 else if (SvNOK (val)) /* Needed for 5.6.x but safe for 5.8.x+ */
449 0 0 iv = (IV)SvNV (val); /* uncoverable statement ancient perl required */
500 3223 0 csv->sep_len = len == 1 ? 0 : len;
505 3377 0 csv->quo_len = len == 1 ? 0 : len;
511 90 22 csv->eol_is_cr = len == 1 && *cp == CH_CR ? 1 : 0;
75 15 csv->eol_is_cr = len == 1 && *cp == CH_CR ? 1 : 0;
515 8 3 if (*cp) {
517 1 7 if (SvUTF8 (val))
527 1 1 csv->comment_str = *cp ? (byte *)cp : NULL;
531 1 0 if (cp && len) {
0 1 if (cp && len) {
571 1 1 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp) {
0 1 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp) {
576 1 0 cache = (byte *)SvPV_nolen (*svp);
611 1 0 if (csv->sep_len > 1)
614 1 0 if (csv->quo_len > 1)
616 0 1 if (csv->types_len)
621 1 0 if (csv->bptr)
623 1 0 if (csv->tmp && SvPOK (csv->tmp)) {
0 1 if (csv->tmp && SvPOK (csv->tmp)) {
624 0 0 char *s = SvPV_nolen (csv->tmp);
647 26357 797 if ((svp = hv_fetchs (self, "_CACHE", FALSE)) && *svp) {
26357 0 if ((svp = hv_fetchs (self, "_CACHE", FALSE)) && *svp) {
660 797 0 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
797 0 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
0 797 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
0 0 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
0 0 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
661 797 0 CH_SEP = *SvPV (*svp, len);
662 211 586 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
211 0 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
0 211 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
0 0 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
0 0 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
663 211 0 ptr = SvPV (*svp, len);
665 5 206 if (len > 1)
670 797 0 if ((svp = hv_fetchs (self, "quote_char", FALSE)) && *svp) {
797 0 if ((svp = hv_fetchs (self, "quote_char", FALSE)) && *svp) {
671 3 794 if (SvOK (*svp)) {
3 0 if (SvOK (*svp)) {
0 3 if (SvOK (*svp)) {
672 794 0 ptr = SvPV (*svp, len);
673 794 0 CH_QUOTE = len ? *ptr : (char)0;
678 6 791 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
6 0 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
1 5 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
1 0 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
0 1 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
679 5 0 ptr = SvPV (*svp, len);
681 4 1 if (len > 1)
686 797 0 if ((svp = hv_fetchs (self, "escape_char", FALSE)) && *svp) {
797 0 if ((svp = hv_fetchs (self, "escape_char", FALSE)) && *svp) {
687 6 791 if (SvOK (*svp)) {
6 0 if (SvOK (*svp)) {
0 6 if (SvOK (*svp)) {
688 791 0 ptr = SvPV (*svp, len);
689 789 2 csv->escape_char = len ? *ptr : (char)0;
695 797 0 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
797 0 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
4 793 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
4 0 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
0 4 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
696 793 0 char *eol = SvPV (*svp, len);
699 101 692 if (len == 1 && *csv->eol == CH_CR)
42 59 if (len == 1 && *csv->eol == CH_CR)
704 797 0 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
797 0 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
796 1 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
796 0 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
0 796 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
707 1 0 csv->undef_str = (byte *)SvPV_nolen (*svp);
708 0 1 if (SvUTF8 (*svp))
714 797 0 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
797 0 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
785 12 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
785 0 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
0 785 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
715 12 0 csv->comment_str = (byte *)SvPV_nolen (*svp);
719 1 796 if ((svp = hv_fetchs (self, "_types", FALSE)) && *svp && SvOK (*svp)) {
1 0 if ((svp = hv_fetchs (self, "_types", FALSE)) && *svp && SvOK (*svp)) {
0 1 if ((svp = hv_fetchs (self, "_types", FALSE)) && *svp && SvOK (*svp)) {
0 0 if ((svp = hv_fetchs (self, "_types", FALSE)) && *svp && SvOK (*svp)) {
0 0 if ((svp = hv_fetchs (self, "_types", FALSE)) && *svp && SvOK (*svp)) {
720 1 0 csv->types = SvPV (*svp, len);
724 4 793 if ((svp = hv_fetchs (self, "_is_bound", FALSE)) && *svp && SvOK (*svp))
4 0 if ((svp = hv_fetchs (self, "_is_bound", FALSE)) && *svp && SvOK (*svp))
0 4 if ((svp = hv_fetchs (self, "_is_bound", FALSE)) && *svp && SvOK (*svp))
0 0 if ((svp = hv_fetchs (self, "_is_bound", FALSE)) && *svp && SvOK (*svp))
0 0 if ((svp = hv_fetchs (self, "_is_bound", FALSE)) && *svp && SvOK (*svp))
725 4 0 csv->is_bound = SvIV (*svp);
726 797 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
797 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
0 797 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
0 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
283 514 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
283 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
728 9 274 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
9 0 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
0 9 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
0 0 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
9 0 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
9 0 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
730 1 282 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
1 0 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
0 1 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
0 0 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
1 0 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
1 0 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
734 797 0 csv->binary = bool_opt ("binary");
797 0 csv->binary = bool_opt ("binary");
797 0 csv->binary = bool_opt ("binary");
0 797 csv->binary = bool_opt ("binary");
0 0 csv->binary = bool_opt ("binary");
0 797 csv->binary = bool_opt ("binary");
0 0 csv->binary = bool_opt ("binary");
0 0 csv->binary = bool_opt ("binary");
0 797 csv->binary = bool_opt ("binary");
0 0 csv->binary = bool_opt ("binary");
0 0 csv->binary = bool_opt ("binary");
0 0 csv->binary = bool_opt ("binary");
0 0 csv->binary = bool_opt ("binary");
0 0 csv->binary = bool_opt ("binary");
797 0 csv->binary = bool_opt ("binary");
797 0 csv->binary = bool_opt ("binary");
281 516 csv->binary = bool_opt ("binary");
0 281 csv->binary = bool_opt ("binary");
0 0 csv->binary = bool_opt ("binary");
516 281 csv->binary = bool_opt ("binary");
0 0 csv->binary = bool_opt ("binary");
735 797 0 csv->decode_utf8 = bool_opt ("decode_utf8");
797 0 csv->decode_utf8 = bool_opt ("decode_utf8");
797 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 797 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 797 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 797 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
797 0 csv->decode_utf8 = bool_opt ("decode_utf8");
797 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 797 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
797 0 csv->decode_utf8 = bool_opt ("decode_utf8");
0 0 csv->decode_utf8 = bool_opt ("decode_utf8");
736 797 0 csv->always_quote = bool_opt ("always_quote");
797 0 csv->always_quote = bool_opt ("always_quote");
797 0 csv->always_quote = bool_opt ("always_quote");
0 797 csv->always_quote = bool_opt ("always_quote");
0 0 csv->always_quote = bool_opt ("always_quote");
0 797 csv->always_quote = bool_opt ("always_quote");
0 0 csv->always_quote = bool_opt ("always_quote");
0 0 csv->always_quote = bool_opt ("always_quote");
1 796 csv->always_quote = bool_opt ("always_quote");
1 0 csv->always_quote = bool_opt ("always_quote");
1 0 csv->always_quote = bool_opt ("always_quote");
1 0 csv->always_quote = bool_opt ("always_quote");
0 1 csv->always_quote = bool_opt ("always_quote");
0 1 csv->always_quote = bool_opt ("always_quote");
796 0 csv->always_quote = bool_opt ("always_quote");
796 0 csv->always_quote = bool_opt ("always_quote");
780 16 csv->always_quote = bool_opt ("always_quote");
0 780 csv->always_quote = bool_opt ("always_quote");
0 0 csv->always_quote = bool_opt ("always_quote");
16 780 csv->always_quote = bool_opt ("always_quote");
0 0 csv->always_quote = bool_opt ("always_quote");
737 797 0 csv->strict = bool_opt ("strict");
797 0 csv->strict = bool_opt ("strict");
797 0 csv->strict = bool_opt ("strict");
0 797 csv->strict = bool_opt ("strict");
0 0 csv->strict = bool_opt ("strict");
0 797 csv->strict = bool_opt ("strict");
0 0 csv->strict = bool_opt ("strict");
0 0 csv->strict = bool_opt ("strict");
0 797 csv->strict = bool_opt ("strict");
0 0 csv->strict = bool_opt ("strict");
0 0 csv->strict = bool_opt ("strict");
0 0 csv->strict = bool_opt ("strict");
0 0 csv->strict = bool_opt ("strict");
0 0 csv->strict = bool_opt ("strict");
797 0 csv->strict = bool_opt ("strict");
797 0 csv->strict = bool_opt ("strict");
789 8 csv->strict = bool_opt ("strict");
0 789 csv->strict = bool_opt ("strict");
0 0 csv->strict = bool_opt ("strict");
8 789 csv->strict = bool_opt ("strict");
0 0 csv->strict = bool_opt ("strict");
738 797 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
797 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
797 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 797 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 797 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 797 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
797 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
797 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
785 12 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 785 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
12 785 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
0 0 csv->skip_empty_rows = bool_opt ("skip_empty_rows");
739 797 0 csv->quote_empty = bool_opt ("quote_empty");
797 0 csv->quote_empty = bool_opt ("quote_empty");
797 0 csv->quote_empty = bool_opt ("quote_empty");
0 797 csv->quote_empty = bool_opt ("quote_empty");
0 0 csv->quote_empty = bool_opt ("quote_empty");
0 797 csv->quote_empty = bool_opt ("quote_empty");
0 0 csv->quote_empty = bool_opt ("quote_empty");
0 0 csv->quote_empty = bool_opt ("quote_empty");
0 797 csv->quote_empty = bool_opt ("quote_empty");
0 0 csv->quote_empty = bool_opt ("quote_empty");
0 0 csv->quote_empty = bool_opt ("quote_empty");
0 0 csv->quote_empty = bool_opt ("quote_empty");
0 0 csv->quote_empty = bool_opt ("quote_empty");
0 0 csv->quote_empty = bool_opt ("quote_empty");
797 0 csv->quote_empty = bool_opt ("quote_empty");
797 0 csv->quote_empty = bool_opt ("quote_empty");
785 12 csv->quote_empty = bool_opt ("quote_empty");
0 785 csv->quote_empty = bool_opt ("quote_empty");
0 0 csv->quote_empty = bool_opt ("quote_empty");
12 785 csv->quote_empty = bool_opt ("quote_empty");
0 0 csv->quote_empty = bool_opt ("quote_empty");
740 797 0 csv->quote_space = bool_opt_def ("quote_space", 1);
797 0 csv->quote_space = bool_opt_def ("quote_space", 1);
797 0 csv->quote_space = bool_opt_def ("quote_space", 1);
0 797 csv->quote_space = bool_opt_def ("quote_space", 1);
0 0 csv->quote_space = bool_opt_def ("quote_space", 1);
0 797 csv->quote_space = bool_opt_def ("quote_space", 1);
0 0 csv->quote_space = bool_opt_def ("quote_space", 1);
0 0 csv->quote_space = bool_opt_def ("quote_space", 1);
0 797 csv->quote_space = bool_opt_def ("quote_space", 1);
0 0 csv->quote_space = bool_opt_def ("quote_space", 1);
0 0 csv->quote_space = bool_opt_def ("quote_space", 1);
0 0 csv->quote_space = bool_opt_def ("quote_space", 1);
0 0 csv->quote_space = bool_opt_def ("quote_space", 1);
0 0 csv->quote_space = bool_opt_def ("quote_space", 1);
797 0 csv->quote_space = bool_opt_def ("quote_space", 1);
797 0 csv->quote_space = bool_opt_def ("quote_space", 1);
6 791 csv->quote_space = bool_opt_def ("quote_space", 1);
0 6 csv->quote_space = bool_opt_def ("quote_space", 1);
0 0 csv->quote_space = bool_opt_def ("quote_space", 1);
791 6 csv->quote_space = bool_opt_def ("quote_space", 1);
0 0 csv->quote_space = bool_opt_def ("quote_space", 1);
741 797 0 csv->escape_null = bool_opt_def ("escape_null", 1);
797 0 csv->escape_null = bool_opt_def ("escape_null", 1);
797 0 csv->escape_null = bool_opt_def ("escape_null", 1);
0 797 csv->escape_null = bool_opt_def ("escape_null", 1);
0 0 csv->escape_null = bool_opt_def ("escape_null", 1);
0 797 csv->escape_null = bool_opt_def ("escape_null", 1);
0 0 csv->escape_null = bool_opt_def ("escape_null", 1);
0 0 csv->escape_null = bool_opt_def ("escape_null", 1);
0 797 csv->escape_null = bool_opt_def ("escape_null", 1);
0 0 csv->escape_null = bool_opt_def ("escape_null", 1);
0 0 csv->escape_null = bool_opt_def ("escape_null", 1);
0 0 csv->escape_null = bool_opt_def ("escape_null", 1);
0 0 csv->escape_null = bool_opt_def ("escape_null", 1);
0 0 csv->escape_null = bool_opt_def ("escape_null", 1);
797 0 csv->escape_null = bool_opt_def ("escape_null", 1);
797 0 csv->escape_null = bool_opt_def ("escape_null", 1);
284 513 csv->escape_null = bool_opt_def ("escape_null", 1);
0 284 csv->escape_null = bool_opt_def ("escape_null", 1);
0 0 csv->escape_null = bool_opt_def ("escape_null", 1);
513 284 csv->escape_null = bool_opt_def ("escape_null", 1);
0 0 csv->escape_null = bool_opt_def ("escape_null", 1);
742 797 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
797 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
797 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 797 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 797 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 797 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
797 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
797 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 797 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
797 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
0 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
743 797 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
797 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
797 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 797 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 797 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 797 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
797 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
797 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
793 4 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 793 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
4 793 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
0 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
744 797 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
797 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
797 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 797 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 797 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 797 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
797 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
797 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
796 1 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 796 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
1 796 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
0 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
745 797 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
797 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
797 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 797 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 797 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 797 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
797 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
797 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
796 1 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 796 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
1 796 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
0 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
746 797 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
797 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
797 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 797 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 797 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 797 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
797 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
797 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
783 14 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 783 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
14 783 csv->allow_whitespace = bool_opt ("allow_whitespace");
0 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
747 797 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
797 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
797 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 797 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 797 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 797 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
797 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
797 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
791 6 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 791 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
6 791 csv->blank_is_undef = bool_opt ("blank_is_undef");
0 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
748 797 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
797 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
797 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 797 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 797 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 797 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
797 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
797 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
793 4 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 793 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
4 793 csv->empty_is_undef = bool_opt ("empty_is_undef");
0 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
749 797 0 csv->verbatim = bool_opt ("verbatim");
797 0 csv->verbatim = bool_opt ("verbatim");
797 0 csv->verbatim = bool_opt ("verbatim");
0 797 csv->verbatim = bool_opt ("verbatim");
0 0 csv->verbatim = bool_opt ("verbatim");
0 797 csv->verbatim = bool_opt ("verbatim");
0 0 csv->verbatim = bool_opt ("verbatim");
0 0 csv->verbatim = bool_opt ("verbatim");
0 797 csv->verbatim = bool_opt ("verbatim");
0 0 csv->verbatim = bool_opt ("verbatim");
0 0 csv->verbatim = bool_opt ("verbatim");
0 0 csv->verbatim = bool_opt ("verbatim");
0 0 csv->verbatim = bool_opt ("verbatim");
0 0 csv->verbatim = bool_opt ("verbatim");
797 0 csv->verbatim = bool_opt ("verbatim");
797 0 csv->verbatim = bool_opt ("verbatim");
796 1 csv->verbatim = bool_opt ("verbatim");
0 796 csv->verbatim = bool_opt ("verbatim");
0 0 csv->verbatim = bool_opt ("verbatim");
1 796 csv->verbatim = bool_opt ("verbatim");
0 0 csv->verbatim = bool_opt ("verbatim");
751 797 0 csv->auto_diag = num_opt ("auto_diag");
797 0 csv->auto_diag = num_opt ("auto_diag");
797 0 csv->auto_diag = num_opt ("auto_diag");
752 797 0 csv->diag_verbose = num_opt ("diag_verbose");
797 0 csv->diag_verbose = num_opt ("diag_verbose");
797 0 csv->diag_verbose = num_opt ("diag_verbose");
753 797 0 csv->keep_meta_info = num_opt ("keep_meta_info");
797 0 csv->keep_meta_info = num_opt ("keep_meta_info");
797 0 csv->keep_meta_info = num_opt ("keep_meta_info");
754 797 0 csv->formula = num_opt ("formula");
797 0 csv->formula = num_opt ("formula");
797 0 csv->formula = num_opt ("formula");
756 8 789 unless (csv->escape_char) csv->escape_null = 0;
772 27132 22 csv->first_safe_char = csv->quote_space ? 0x21 : 0x20;
774 83 27071 if (csv->is_bound) {
775 83 0 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
83 0 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
0 83 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
0 0 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
69 14 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
69 0 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
783 853 452 ? csv->verbatim || csv->eol_len >= 2
785 366 487 : csv->eol[0] == CH_CR || csv->eol[0] == CH_NL
787 52 314 : 1
788 1312 25842 : 0;
1305 7 : 0;
789 51 27103 if (csv->sep_len > 1 && is_utf8_string ((U8 *)(csv->sep), csv->sep_len))
51 0 if (csv->sep_len > 1 && is_utf8_string ((U8 *)(csv->sep), csv->sep_len))
791 27 27127 if (csv->quo_len > 1 && is_utf8_string ((U8 *)(csv->quo), csv->quo_len))
27 0 if (csv->quo_len > 1 && is_utf8_string ((U8 *)(csv->quo), csv->quo_len))
800 939877 1389 if (csv->useIO) {
803 0 939877 PUSHMARK (sp);
804 0 939877 EXTEND (sp, 2);
806 939649 228 if (csv->utf8) {
811 939649 0 ptr = SvPV (tmp, len);
812 1690511 0 while (len > 0 && !is_utf8_sv (tmp) && keep < 16) {
1690511 0 while (len > 0 && !is_utf8_sv (tmp) && keep < 16) {
750862 939649 while (len > 0 && !is_utf8_sv (tmp) && keep < 16) {
750862 0 while (len > 0 && !is_utf8_sv (tmp) && keep < 16) {
817 750862 939649 for (j = 0; j < keep; j++)
825 939877 0 if (result) {
826 939876 1 result = POPi;
827 1 939876 unless (result)
836 939674 1592 if (csv->utf8 && !csv->useIO && csv->decode_utf8
25 939649 if (csv->utf8 && !csv->useIO && csv->decode_utf8
25 0 if (csv->utf8 && !csv->useIO && csv->decode_utf8
837 25 0 && SvROK (dst) && is_utf8_sv (SvRV (dst)))
25 0 && SvROK (dst) && is_utf8_sv (SvRV (dst)))
24 1 && SvROK (dst) && is_utf8_sv (SvRV (dst)))
857 3 98 if (i >= csv->is_bound) {
862 98 0 if (sv && SvROK (sv)) {
98 0 if (sv && SvROK (sv)) {
866 98 0 if (sv && SvROK (sv)) {
98 0 if (sv && SvROK (sv)) {
868 14 84 if (keep)
871 83 1 unless (SvREADONLY (sv)) {
884 17 0 return (x && SvIOK (*x) && SvIV (*x) & CSV_FLAGS_QUO ? 1 : 0);
17 0 return (x && SvIOK (*x) && SvIV (*x) & CSV_FLAGS_QUO ? 1 : 0);
17 0 return (x && SvIOK (*x) && SvIV (*x) & CSV_FLAGS_QUO ? 1 : 0);
7 10 return (x && SvIOK (*x) && SvIV (*x) & CSV_FLAGS_QUO ? 1 : 0);
0 0 return (x && SvIOK (*x) && SvIV (*x) & CSV_FLAGS_QUO ? 1 : 0);
892 3 34 if (fa == 1) die ("Formulas are forbidden\n");
893 3 31 if (fa == 2) croak ("Formulas are forbidden\n");
895 6 25 if (fa == 3) {
896 6 0 char *ptr = SvPV_nolen (sv);
901 3 3 if (csv->recno) (void)sprintf (rec, " in record %lu", csv->recno + 1);
905 6 0 if ((svp = hv_fetchs (csv->self, "_COLUMN_NAMES", FALSE)) && _is_arrayref (*svp)) {
6 0 if ((svp = hv_fetchs (csv->self, "_COLUMN_NAMES", FALSE)) && _is_arrayref (*svp)) {
0 6 if ((svp = hv_fetchs (csv->self, "_COLUMN_NAMES", FALSE)) && _is_arrayref (*svp)) {
0 0 if ((svp = hv_fetchs (csv->self, "_COLUMN_NAMES", FALSE)) && _is_arrayref (*svp)) {
1 5 if ((svp = hv_fetchs (csv->self, "_COLUMN_NAMES", FALSE)) && _is_arrayref (*svp)) {
1 0 if ((svp = hv_fetchs (csv->self, "_COLUMN_NAMES", FALSE)) && _is_arrayref (*svp)) {
907 1 0 if (avp && av_len (avp) >= (f - 1)) {
1 0 if (avp && av_len (avp) >= (f - 1)) {
909 1 0 if (fnm && *fnm && SvOK (*fnm))
1 0 if (fnm && *fnm && SvOK (*fnm))
0 1 if (fnm && *fnm && SvOK (*fnm))
0 0 if (fnm && *fnm && SvOK (*fnm))
0 0 if (fnm && *fnm && SvOK (*fnm))
910 1 0 (void)sprintf (field, " (column: '%.100s')", SvPV_nolen (*fnm));
918 4 21 if (len) *len = 0;
920 5 20 if (fa == 4) {
921 3 2 unless (SvREADONLY (sv)) SvSetEmpty (sv);
925 5 15 if (fa == 5) {
926 3 2 unless (SvREADONLY (sv)) SvSetUndef (sv);
930 15 0 if (fa == 6) {
933 15 0 if (svp && _is_coderef (*svp)) {
15 0 if (svp && _is_coderef (*svp)) {
0 15 if (svp && _is_coderef (*svp)) {
0 0 if (svp && _is_coderef (*svp)) {
15 0 if (svp && _is_coderef (*svp)) {
15 0 if (svp && _is_coderef (*svp)) {
937 15 0 DEFSV = sv;
938 0 15 PUSHMARK (SP);
942 15 0 if (result)
947 0 15 return len ? SvPV (sv, *len) : SvPV_nolen (sv);
0 0 return len ? SvPV (sv, *len) : SvPV_nolen (sv);
9 6 return len ? SvPV (sv, *len) : SvPV_nolen (sv);
964 6 21641 if (n < 0 && csv->is_bound) {
5 1 if (n < 0 && csv->is_bound) {
969 2 21645 if (kmi >= 10) {
971 2 0 if ((svp = hv_fetchs (csv->self, "_FFLAGS", FALSE)) && _is_arrayref (*svp)) {
2 0 if ((svp = hv_fetchs (csv->self, "_FFLAGS", FALSE)) && _is_arrayref (*svp)) {
0 2 if ((svp = hv_fetchs (csv->self, "_FFLAGS", FALSE)) && _is_arrayref (*svp)) {
0 0 if ((svp = hv_fetchs (csv->self, "_FFLAGS", FALSE)) && _is_arrayref (*svp)) {
2 0 if ((svp = hv_fetchs (csv->self, "_FFLAGS", FALSE)) && _is_arrayref (*svp)) {
2 0 if ((svp = hv_fetchs (csv->self, "_FFLAGS", FALSE)) && _is_arrayref (*svp)) {
973 2 0 if (avp && av_len (avp) >= n)
2 0 if (avp && av_len (avp) >= n)
978 53845 21636 for (i = 0; i <= n; i++) {
983 32199 21646 if (i > 0) {
984 0 32199 CSV_PUT (csv, dst, CH_SEP);
0 0 CSV_PUT (csv, dst, CH_SEP);
985 10 32189 if (csv->sep_len) {
987 20 10 for (x = 1; x < (int)csv->sep_len; x++)
988 0 20 CSV_PUT (csv, dst, csv->sep[x]);
0 0 CSV_PUT (csv, dst, csv->sep[x]);
992 14 53831 if (bound)
996 53831 0 sv = svp && *svp ? *svp : NULL;
53831 0 sv = svp && *svp ? *svp : NULL;
999 53845 0 if (sv && (SvOK (sv) || (
53 53792 if (sv && (SvOK (sv) || (
53 0 if (sv && (SvOK (sv) || (
53 0 if (sv && (SvOK (sv) || (
0 53 if (sv && (SvOK (sv) || (
1000 0 0 (SvGMAGICAL (sv) && (mg_get (sv), 1) && SvOK (sv))))) {
0 0 (SvGMAGICAL (sv) && (mg_get (sv), 1) && SvOK (sv))))) {
0 0 (SvGMAGICAL (sv) && (mg_get (sv), 1) && SvOK (sv))))) {
1004 32244 21548 ptr = SvPV (sv, len);
1006 16 53776 if (*ptr == '=' && csv->formula) {
10 6 if (*ptr == '=' && csv->formula) {
1007 2 4 unless (ptr = _formula (csv, sv, &len, i))
1010 1404 52382 if (len == 0)
1011 755 649 quoteMe = aq ? 1 : qe ? 1 : qm ? was_quoted (qm, i) : 0;
752 3 quoteMe = aq ? 1 : qe ? 1 : qm ? was_quoted (qm, i) : 0;
5 747 quoteMe = aq ? 1 : qe ? 1 : qm ? was_quoted (qm, i) : 0;
1014 20041 32341 if (SvUTF8 (sv)) {
1019 46759 5623 quoteMe = aq ? 1 : qm ? was_quoted (qm, i) : 0;
12 46747 quoteMe = aq ? 1 : qm ? was_quoted (qm, i) : 0;
1025 46754 5628 if (!quoteMe &&
25179 21575 if (!quoteMe &&
1026 25797 20957 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
25182 615 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
25179 3 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
1034 83767 2049 for (ptr2 = ptr, l = len; l; ++ptr2, --l) {
1045 83767 0 if ((CH_QUOTE && c == CH_QUOTE) ||
83459 308 if ((CH_QUOTE && c == CH_QUOTE) ||
81456 2003 if ((CH_QUOTE && c == CH_QUOTE) ||
83074 10 if ((CH_QUOTE && c == CH_QUOTE) ||
1046 81305 151 (CH_SEP && c == CH_SEP) ||
83304 4 (CH_SEP && c == CH_SEP) ||
1047 83080 224 (csv->escape_char && c == csv->escape_char) ||
60629 22445 (csv->escape_char && c == csv->escape_char) ||
8 2 (csv->escape_char && c == csv->escape_char) ||
1048 40061 43013 (csv->quote_binary ? (x >= 0x7f && x <= 0xa0) ||
20040 20021 (csv->quote_binary ? (x >= 0x7f && x <= 0xa0) ||
2424 60629 (csv->quote_binary ? (x >= 0x7f && x <= 0xa0) ||
1050 10 0 : c == CH_NL || c == CH_CR ||
10 0 : c == CH_NL || c == CH_CR ||
5 5 : c == CH_NL || c == CH_CR ||
1051 3 2 (csv->quote_space && (
1052 0 3 c == CH_SPACE || c == CH_TAB)))) {
1063 29412 24374 if (quoteMe) {
1064 0 29412 CSV_PUT (csv, dst, CH_QUOTE);
0 0 CSV_PUT (csv, dst, CH_QUOTE);
1065 17 29395 if (csv->quo_len) {
1067 34 17 for (x = 1; x < (int)csv->quo_len; x++)
1068 0 34 CSV_PUT (csv, dst, csv->quo[x]);
0 0 CSV_PUT (csv, dst, csv->quo[x]);
1071 950361452 53779 while (len-- > 0) {
1075 755 950360697 if (!csv->binary && is_csv_binary (c)) {
738 17 if (!csv->binary && is_csv_binary (c)) {
0 738 if (!csv->binary && is_csv_binary (c)) {
7 10 if (!csv->binary && is_csv_binary (c)) {
1078 0 7 unless (hv_store (csv->self, "_ERROR_INPUT", 12, sv, 0))
1083 950361436 9 if (CH_QUOTE && (byte)c == CH_QUOTE && (csv->quo_len == 0 ||
3225 950358211 if (CH_QUOTE && (byte)c == CH_QUOTE && (csv->quo_len == 0 ||
9 3216 if (CH_QUOTE && (byte)c == CH_QUOTE && (csv->quo_len == 0 ||
1 8 if (CH_QUOTE && (byte)c == CH_QUOTE && (csv->quo_len == 0 ||
1087 2165 950356063 if (c == csv->escape_char && csv->escape_char)
2163 2 if (c == csv->escape_char && csv->escape_char)
1090 56 950356009 if (c == (char)0 && csv->escape_null) {
29 27 if (c == (char)0 && csv->escape_null) {
1094 5409 950356036 if (e && csv->escape_char)
5409 0 if (e && csv->escape_char)
1095 0 5409 CSV_PUT (csv, dst, csv->escape_char);
0 0 CSV_PUT (csv, dst, csv->escape_char);
1096 919632 949441813 CSV_PUT (csv, dst, c);
0 919632 CSV_PUT (csv, dst, c);
1098 29405 24374 if (quoteMe) {
1099 0 29405 CSV_PUT (csv, dst, CH_QUOTE);
0 0 CSV_PUT (csv, dst, CH_QUOTE);
1100 17 29388 if (csv->quo_len) {
1102 34 17 for (x = 1; x < (int)csv->quo_len; x++)
1103 0 34 CSV_PUT (csv, dst, csv->quo[x]);
0 0 CSV_PUT (csv, dst, csv->quo[x]);
1108 8 45 if (csv->undef_str) {
1112 3 5 if (csv->undef_flg) {
1117 20 8 while (len--)
1118 0 20 CSV_PUT (csv, dst, *ptr++);
0 0 CSV_PUT (csv, dst, *ptr++);
1122 249 21387 if (csv->eol_len) {
1126 447 249 while (len--)
1127 0 447 CSV_PUT (csv, dst, *ptr++);
0 0 CSV_PUT (csv, dst, *ptr++);
1129 21634 2 if (csv->used)
1138 299 0 if (csv->tmp) {
1140 299 0 if (hv_store (csv->self, "_ERROR_INPUT", 12, csv->tmp, 0))
1148 1518 3218 unless (csv->useIO)
1151 894 2324 if (csv->tmp && csv->eol_pos >= 0) {
348 546 if (csv->tmp && csv->eol_pos >= 0) {
1154 348 0 csv->bptr = SvPV (csv->tmp, csv->size);
1162 0 2870 PUSHMARK (sp);
1163 0 2870 EXTEND (sp, 1);
1169 2870 0 csv->tmp = result ? POPs : NULL;
1177 2870 0 if (csv->tmp && SvOK (csv->tmp)) {
539 2331 if (csv->tmp && SvOK (csv->tmp)) {
539 0 if (csv->tmp && SvOK (csv->tmp)) {
0 539 if (csv->tmp && SvOK (csv->tmp)) {
1179 2331 0 csv->bptr = SvPV (csv->tmp, tmp_len);
1182 358 1973 if (csv->eolx && csv->size >= csv->eol_len) {
358 0 if (csv->eolx && csv->size >= csv->eol_len) {
1184 1463 354 for (i = 1; i <= (int)csv->eol_len; i++) {
1185 4 1459 unless (csv->bptr[csv->size - i] == csv->eol[csv->eol_len - i]) {
1190 354 4 if (match) {
1195 351 3 unless (csv->verbatim)
1199 351 3 unless (csv->verbatim || csv->size)
6 345 unless (csv->verbatim || csv->size)
1203 70 2255 if (SvUTF8 (csv->tmp)) csv->utf8 = 1;
1204 2325 0 if (tmp_len)
1318 1723 0 char *s = SvPV (sv, len);
1319 1723 0 unless (s && len) return;
0 1723 unless (s && len) return;
1320 176 1723 while (s[len - 1] == CH_SPACE || s[len - 1] == CH_TAB)
0 1723 while (s[len - 1] == CH_SPACE || s[len - 1] == CH_TAB)
1369 182590 3340 while ((c = CSV_GET) != EOF) {
185201 729 while ((c = CSV_GET) != EOF) {
1371 22483 162718 NewField;
86 22397 NewField;
4 22479 NewField;
1383 11648 183965 if (is_SEP (c)) {
88 11560 if (is_SEP (c)) {
88 0 if (is_SEP (c)) {
30 58 if (is_SEP (c)) {
30 0 if (is_SEP (c)) {
1389 1173 10417 if (waitingForField) {
1393 1147 26 if (csv->blank_is_undef || csv->empty_is_undef)
24 1123 if (csv->blank_is_undef || csv->empty_is_undef)
1397 1173 0 unless (csv->is_bound)
1400 8 1165 if (csv->keep_meta_info && fflags)
8 0 if (csv->keep_meta_info && fflags)
1404 2194 8223 if (f & CSV_FLAGS_QUO) {
1408 0 2194 CSV_PUT_SV (c)
0 0 CSV_PUT_SV (c)
0 0 CSV_PUT_SV (c)
0 0 CSV_PUT_SV (c)
0 0 CSV_PUT_SV (c)
0 2194 CSV_PUT_SV (c)
0 0 CSV_PUT_SV (c)
0 0 CSV_PUT_SV (c)
0 0 CSV_PUT_SV (c)
0 2194 CSV_PUT_SV (c)
0 0 CSV_PUT_SV (c)
0 0 CSV_PUT_SV (c)
0 0 CSV_PUT_SV (c)
2194 0 CSV_PUT_SV (c)
144 2050 CSV_PUT_SV (c)
1414 90 8133 AV_PUSH;
90 0 AV_PUSH;
90 0 AV_PUSH;
19 71 AV_PUSH;
4 8217 AV_PUSH;
4 0 AV_PUSH;
4 0 AV_PUSH;
0 4 AV_PUSH;
1635 6586 AV_PUSH;
1635 0 AV_PUSH;
34 8187 AV_PUSH;
34 0 AV_PUSH;
32 2 AV_PUSH;
32 0 AV_PUSH;
22 10 AV_PUSH;
5 8216 AV_PUSH;
8174 47 AV_PUSH;
21 8200 AV_PUSH;
21 0 AV_PUSH;
1418 182992 1031 if (is_QUOTE (c)) {
22836 160156 if (is_QUOTE (c)) {
86 22750 if (is_QUOTE (c)) {
86 0 if (is_QUOTE (c)) {
70 16 if (is_QUOTE (c)) {
70 0 if (is_QUOTE (c)) {
1424 10904 11916 if (waitingForField) {
1433 11850 66 if (f & CSV_FLAGS_QUO) {
1440 10529 1321 int c2 = CSV_GET;
1442 4240 7610 if (csv->allow_whitespace) {
1446 924 3406 while (is_whitespace (c2)) {
666 258 while (is_whitespace (c2)) {
666 0 while (is_whitespace (c2)) {
69 597 while (is_whitespace (c2)) {
21 576 while (is_whitespace (c2)) {
1447 1 89 if (csv->allow_loose_quotes &&
0 1 if (csv->allow_loose_quotes &&
1448 0 0 !(csv->escape_char && c2 == csv->escape_char)) {
1454 0 1 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 1 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 1 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
1 0 CSV_PUT_SV (c);
0 1 CSV_PUT_SV (c);
1457 87 3 c2 = CSV_GET;
1461 9014 2836 if (is_SEP (c2)) {
15 8999 if (is_SEP (c2)) {
15 0 if (is_SEP (c2)) {
15 0 if (is_SEP (c2)) {
15 0 if (is_SEP (c2)) {
1465 0 9014 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
700 8314 AV_PUSH;
688 12 AV_PUSH;
0 688 AV_PUSH;
0 0 AV_PUSH;
3400 5602 AV_PUSH;
0 3400 AV_PUSH;
2150 6852 AV_PUSH;
2150 0 AV_PUSH;
2131 19 AV_PUSH;
2131 0 AV_PUSH;
895 1236 AV_PUSH;
0 9014 AV_PUSH;
9010 4 AV_PUSH;
45 8969 AV_PUSH;
45 0 AV_PUSH;
1469 2661 175 if (c2 == CH_NL || c2 == CH_EOLX) {
20 2641 if (c2 == CH_NL || c2 == CH_EOLX) {
1473 0 195 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
10 185 AV_PUSH;
10 0 AV_PUSH;
0 10 AV_PUSH;
0 0 AV_PUSH;
6 189 AV_PUSH;
0 6 AV_PUSH;
125 70 AV_PUSH;
125 0 AV_PUSH;
95 30 AV_PUSH;
95 0 AV_PUSH;
92 3 AV_PUSH;
0 195 AV_PUSH;
193 2 AV_PUSH;
1 194 AV_PUSH;
1 0 AV_PUSH;
1484 2624 17 if (csv->escape_char && c == csv->escape_char) {
1544 1080 if (csv->escape_char && c == csv->escape_char) {
1487 25 1519 if (c2 == '0') {
1491 25 0 CSV_PUT_SV (0)
0 25 CSV_PUT_SV (0)
1495 1519 0 if (is_QUOTE (c2)) {
1056 463 if (is_QUOTE (c2)) {
0 1056 if (is_QUOTE (c2)) {
0 0 if (is_QUOTE (c2)) {
0 0 if (is_QUOTE (c2)) {
0 0 if (is_QUOTE (c2)) {
1499 1 1055 if (csv->utf8)
1501 0 1056 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 1056 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 1056 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
1056 0 CSV_PUT_SV (c2)
32 1024 CSV_PUT_SV (c2)
1505 3 460 if (csv->allow_loose_escapes && c2 != CH_CR) {
2 1 if (csv->allow_loose_escapes && c2 != CH_CR) {
1509 0 2 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 2 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 2 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
2 0 CSV_PUT_SV (c);
0 2 CSV_PUT_SV (c);
1515 197 1361 if (c2 == CH_CR) {
1518 102 95 if (csv->eol_is_cr) {
1522 0 102 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
4 98 AV_PUSH;
4 0 AV_PUSH;
0 4 AV_PUSH;
0 0 AV_PUSH;
18 84 AV_PUSH;
0 18 AV_PUSH;
82 20 AV_PUSH;
82 0 AV_PUSH;
82 0 AV_PUSH;
82 0 AV_PUSH;
82 0 AV_PUSH;
0 102 AV_PUSH;
102 0 AV_PUSH;
0 102 AV_PUSH;
0 0 AV_PUSH;
1526 90 5 c3 = CSV_GET;
1528 81 14 if (c3 == CH_NL) { /* \r is not optional before EOLX! */
1532 0 81 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
2 79 AV_PUSH;
2 0 AV_PUSH;
0 2 AV_PUSH;
0 0 AV_PUSH;
5 76 AV_PUSH;
0 5 AV_PUSH;
70 11 AV_PUSH;
70 0 AV_PUSH;
40 30 AV_PUSH;
40 0 AV_PUSH;
40 0 AV_PUSH;
0 81 AV_PUSH;
81 0 AV_PUSH;
0 81 AV_PUSH;
0 0 AV_PUSH;
1536 1 13 if (csv->useIO && csv->eol_len == 0) {
1 0 if (csv->useIO && csv->eol_len == 0) {
1537 0 1 if (c3 == CH_CR) { /* \r followed by an empty line */
1545 1 0 if (!is_csv_binary (c3)) {
0 1 if (!is_csv_binary (c3)) {
0 0 if (!is_csv_binary (c3)) {
1553 0 1 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 1 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 1 AV_PUSH;
0 0 AV_PUSH;
0 1 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 1 AV_PUSH;
1 0 AV_PUSH;
0 1 AV_PUSH;
0 0 AV_PUSH;
1558 12 1 ParseError (csv, quoesc ? 2023 : 2010, csv->used - 2);
1562 1304 57 if (c2 == EOF) {
1566 0 1304 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
12 1292 AV_PUSH;
12 0 AV_PUSH;
0 12 AV_PUSH;
0 0 AV_PUSH;
533 771 AV_PUSH;
0 533 AV_PUSH;
14 1290 AV_PUSH;
14 0 AV_PUSH;
9 5 AV_PUSH;
9 0 AV_PUSH;
7 2 AV_PUSH;
0 1304 AV_PUSH;
1304 0 AV_PUSH;
11 1293 AV_PUSH;
11 0 AV_PUSH;
1570 12 45 if (csv->allow_loose_quotes && !quoesc) {
10 2 if (csv->allow_loose_quotes && !quoesc) {
1574 0 10 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 10 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 10 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
10 0 CSV_PUT_SV (c);
2 8 CSV_PUT_SV (c);
1582 39 8 if (quoesc) {
1584 39 0 ERROR_INSIDE_QUOTES (2023);
1587 8 0 ERROR_INSIDE_QUOTES (2011);
1591 16 50 if (csv->allow_loose_quotes) { /* 1,foo "boo" d'uh,1 */
1593 0 16 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 16 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 16 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
16 0 CSV_PUT_SV (c);
0 16 CSV_PUT_SV (c);
1596 49 1 ERROR_INSIDE_FIELD (2034);
1599 4653 156550 if (c == csv->escape_char && csv->escape_char) {
4651 2 if (c == csv->escape_char && csv->escape_char) {
1606 33 4618 if (waitingForField) {
1608 3 30 if (csv->allow_unquoted_escape) {
1612 2 1 int c2 = CSV_GET;
1616 1 2 if (c2 == EOF) {
1618 1 0 ERROR_INSIDE_FIELD (2035);
1621 1 1 if (c2 == '0')
1622 1 0 CSV_PUT_SV (0)
0 1 CSV_PUT_SV (0)
1624 1 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 1 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
1 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 1 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
1625 0 0 c2 == csv->escape_char || csv->allow_loose_escapes) {
1626 0 1 if (csv->utf8)
1628 0 1 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 1 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 1 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
1 0 CSV_PUT_SV (c2)
0 1 CSV_PUT_SV (c2)
1632 0 0 ERROR_INSIDE_QUOTES (2025);
1637 4610 8 if (f & CSV_FLAGS_QUO) {
1638 4607 3 int c2 = CSV_GET;
1640 3 4607 if (c2 == EOF) {
1642 3 0 ERROR_INSIDE_QUOTES (2024);
1645 2 4605 if (c2 == '0')
1646 2 0 CSV_PUT_SV (0)
0 2 CSV_PUT_SV (0)
1648 4605 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
2411 2194 if ( is_QUOTE (c2) || is_SEP (c2) ||
1 2410 if ( is_QUOTE (c2) || is_SEP (c2) ||
1 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
1 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
1 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
1 2193 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 1 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
0 0 if ( is_QUOTE (c2) || is_SEP (c2) ||
28 2165 if ( is_QUOTE (c2) || is_SEP (c2) ||
1649 2 26 c2 == csv->escape_char || csv->allow_loose_escapes) {
1650 1 4578 if (csv->utf8)
1652 0 4579 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 4579 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
1 4578 CSV_PUT_SV (c2)
3 0 CSV_PUT_SV (c2)
0 3 CSV_PUT_SV (c2)
3 1 CSV_PUT_SV (c2)
4578 0 CSV_PUT_SV (c2)
292 4286 CSV_PUT_SV (c2)
1656 26 0 ERROR_INSIDE_QUOTES (2025);
1660 8 0 if (sv) {
1661 4 4 int c2 = CSV_GET;
1663 4 4 if (c2 == EOF) {
1665 4 0 ERROR_INSIDE_FIELD (2035);
1668 0 4 CSV_PUT_SV (c2);
0 0 CSV_PUT_SV (c2);
0 0 CSV_PUT_SV (c2);
0 0 CSV_PUT_SV (c2);
0 0 CSV_PUT_SV (c2);
0 4 CSV_PUT_SV (c2);
0 0 CSV_PUT_SV (c2);
0 0 CSV_PUT_SV (c2);
0 0 CSV_PUT_SV (c2);
0 4 CSV_PUT_SV (c2);
0 0 CSV_PUT_SV (c2);
0 0 CSV_PUT_SV (c2);
0 0 CSV_PUT_SV (c2);
4 0 CSV_PUT_SV (c2);
0 4 CSV_PUT_SV (c2);
1671 0 0 ERROR_INSIDE_FIELD (2036); /* uncoverable statement I think there's no way to get here */
1674 154831 1721 if (c == CH_NL || is_EOL (c)) {
334 154497 if (c == CH_NL || is_EOL (c)) {
1681 257 2261 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
174 83 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
65 109 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
31 34 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
1683 7 24 c = CSV_GET;
1684 0 31 if (c == EOF) {
1693 215 2272 if (waitingForField) {
1697 207 8 if (csv->blank_is_undef || csv->empty_is_undef)
8 199 if (csv->blank_is_undef || csv->empty_is_undef)
1701 215 0 unless (csv->is_bound)
1703 14 201 if (csv->keep_meta_info && fflags)
14 0 if (csv->keep_meta_info && fflags)
1708 744 1528 if (f & CSV_FLAGS_QUO) {
1713 19 725 unless (csv->binary)
1714 19 0 ERROR_INSIDE_QUOTES (2021);
1716 40 685 CSV_PUT_SV (c);
35 5 CSV_PUT_SV (c);
74 0 CSV_PUT_SV (c);
0 74 CSV_PUT_SV (c);
74 40 CSV_PUT_SV (c);
0 685 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 685 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
685 0 CSV_PUT_SV (c);
0 685 CSV_PUT_SV (c);
1719 9 1519 if (csv->verbatim) {
1724 1 8 unless (csv->binary)
1725 1 0 ERROR_INSIDE_FIELD (2030);
1727 2 6 CSV_PUT_SV (c);
0 2 CSV_PUT_SV (c);
6 0 CSV_PUT_SV (c);
1 5 CSV_PUT_SV (c);
6 2 CSV_PUT_SV (c);
0 6 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 6 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
6 0 CSV_PUT_SV (c);
0 6 CSV_PUT_SV (c);
1733 257 1262 if (csv->recno == 0 && csv->fld_idx == 1 && csv->useIO &&
28 229 if (csv->recno == 0 && csv->fld_idx == 1 && csv->useIO &&
28 0 if (csv->recno == 0 && csv->fld_idx == 1 && csv->useIO &&
23 5 if (csv->recno == 0 && csv->fld_idx == 1 && csv->useIO &&
1734 0 23 (csv->bptr[0] == 's' || csv->bptr[0] == 'S') &&
0 5 (csv->bptr[0] == 's' || csv->bptr[0] == 'S') &&
1735 0 0 (csv->bptr[1] == 'e' || csv->bptr[1] == 'E') &&
0 5 (csv->bptr[1] == 'e' || csv->bptr[1] == 'E') &&
1736 0 0 (csv->bptr[2] == 'p' || csv->bptr[2] == 'P') &&
5 0 (csv->bptr[2] == 'p' || csv->bptr[2] == 'P') &&
1740 4 1 if (lnu <= MAX_ATTR_LEN) {
1743 1 3 csv->sep_len = lnu == 1 ? 0 : lnu;
1751 4 1511 AV_PUSH;
4 0 AV_PUSH;
4 0 AV_PUSH;
1 3 AV_PUSH;
7 1508 AV_PUSH;
7 0 AV_PUSH;
7 0 AV_PUSH;
0 7 AV_PUSH;
66 1449 AV_PUSH;
66 0 AV_PUSH;
82 1433 AV_PUSH;
82 0 AV_PUSH;
81 1 AV_PUSH;
81 0 AV_PUSH;
37 44 AV_PUSH;
1 1514 AV_PUSH;
1497 18 AV_PUSH;
9 1506 AV_PUSH;
9 0 AV_PUSH;
1756 1109 153388 if (c == CH_CR && !(csv->verbatim)) {
1106 3 if (c == CH_CR && !(csv->verbatim)) {
1761 114 992 if (waitingForField) {
1764 29 85 if (csv->eol_is_cr) {
1772 80 5 c2 = CSV_GET;
1774 5 80 if (c2 == EOF) {
1784 0 5 unless (seenSomething)
1789 70 10 if (c2 == CH_NL) { /* \r is not optional before EOLX! */
1797 5 5 if (csv->useIO && csv->eol_len == 0) {
5 0 if (csv->useIO && csv->eol_len == 0) {
1798 0 5 if (c2 == CH_CR) { /* \r followed by an empty line */
1808 2 3 if (!is_csv_binary (c2)) {
0 2 if (!is_csv_binary (c2)) {
0 3 if (!is_csv_binary (c2)) {
1816 1 1 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
1 0 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
1 0 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
1 0 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
1818 1 0 c = CSV_GET;
1819 0 1 if (c == EOF) {
1827 0 1 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
1 0 AV_PUSH;
1 0 AV_PUSH;
1 0 AV_PUSH;
0 1 AV_PUSH;
0 1 AV_PUSH;
0 0 AV_PUSH;
0 1 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 1 AV_PUSH;
1 0 AV_PUSH;
0 1 AV_PUSH;
0 0 AV_PUSH;
1836 8 0 ERROR_INSIDE_FIELD (2031);
1839 620 372 if (f & CSV_FLAGS_QUO) {
1844 70 550 unless (csv->binary)
1845 70 0 ERROR_INSIDE_QUOTES (2022);
1847 0 550 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 550 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 550 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
550 0 CSV_PUT_SV (c);
2 548 CSV_PUT_SV (c);
1852 181 191 if (csv->eol_is_cr) {
1859 186 5 c2 = CSV_GET;
1861 175 16 if (c2 == CH_NL) { /* \r is not optional before EOLX! */
1868 11 5 if (csv->useIO && csv->eol_len == 0) {
11 0 if (csv->useIO && csv->eol_len == 0) {
1869 4 7 if (!is_csv_binary (c2)
0 4 if (!is_csv_binary (c2)
7 0 if (!is_csv_binary (c2)
1874 1 6 || c2 == CH_CR) {
1881 0 5 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
0 0 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
0 0 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
0 0 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
1883 0 0 c = CSV_GET;
1884 0 0 if (c == EOF) {
1892 0 5 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 5 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 5 AV_PUSH;
0 0 AV_PUSH;
0 5 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 5 AV_PUSH;
5 0 AV_PUSH;
0 5 AV_PUSH;
0 0 AV_PUSH;
1900 11 0 ERROR_INSIDE_FIELD (2032);
1910 3646 149745 if (csv->eolx && c == CH_EOL &&
8 3638 if (csv->eolx && c == CH_EOL &&
8 0 if (csv->eolx && c == CH_EOL &&
1911 8 0 csv->size - csv->used >= (STRLEN)csv->eol_len - 1 &&
1912 8 0 !memcmp (csv->bptr + csv->used, csv->eol + 1, csv->eol_len - 1) &&
1921 10368 143015 if (waitingForField) {
1922 136 10232 if (csv->comment_str && !f && !spl && c == *csv->comment_str) {
136 0 if (csv->comment_str && !f && !spl && c == *csv->comment_str) {
84 52 if (csv->comment_str && !f && !spl && c == *csv->comment_str) {
24 60 if (csv->comment_str && !f && !spl && c == *csv->comment_str) {
1930 18 6 if (cl == 1 || (
18 0 if (cl == 1 || (
1931 18 0 (csv->size - csv->used >= cl - 1 &&
1932 18 0 !memcmp (csv->bptr + csv->used, csv->comment_str + 1, cl - 1) &&
1936 0 24 c = CSV_GET;
1944 1924 8420 if (csv->allow_whitespace && is_whitespace (c)) {
1924 0 if (csv->allow_whitespace && is_whitespace (c)) {
1924 0 if (csv->allow_whitespace && is_whitespace (c)) {
1924 0 if (csv->allow_whitespace && is_whitespace (c)) {
1723 201 if (csv->allow_whitespace && is_whitespace (c)) {
0 1723 if (csv->allow_whitespace && is_whitespace (c)) {
1946 310 1 c = CSV_GET;
1950 273 38 } while (is_whitespace (c));
241 32 } while (is_whitespace (c));
241 0 } while (is_whitespace (c));
110 131 } while (is_whitespace (c));
0 131 } while (is_whitespace (c));
1951 1 200 if (c == EOF)
1965 111032 31983 if (f & CSV_FLAGS_QUO) {
1966 110584 448 if (is_csv_binary (c)) {
3021 107563 if (is_csv_binary (c)) {
3454 15 if (is_csv_binary (c)) {
1968 31 3423 unless (csv->binary || csv->utf8)
5 26 unless (csv->binary || csv->utf8)
1969 5 0 ERROR_INSIDE_QUOTES (2026);
1971 0 111027 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 111027 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 111027 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
111027 0 CSV_PUT_SV (c);
4770 106257 CSV_PUT_SV (c);
1974 31945 38 if (is_csv_binary (c)) {
427 31518 if (is_csv_binary (c)) {
453 12 if (is_csv_binary (c)) {
1975 413 40 if (csv->useIO && c == EOF)
3 410 if (csv->useIO && c == EOF)
1978 9 441 unless (csv->binary || csv->utf8)
9 0 unless (csv->binary || csv->utf8)
1979 9 0 ERROR_INSIDE_FIELD (2037);
1981 0 31971 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 31971 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 31971 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
31971 0 CSV_PUT_SV (c);
269 31702 CSV_PUT_SV (c);
1986 119 160383 if (csv->verbatim && csv->useIO && csv->used == csv->size)
47 72 if (csv->verbatim && csv->useIO && csv->used == csv->size)
3 44 if (csv->verbatim && csv->useIO && csv->used == csv->size)
1990 358 378 if (waitingForField) {
1991 327 31 if (seenSomething || !csv->useIO) {
3 324 if (seenSomething || !csv->useIO) {
1992 33 1 NewField;
1 32 NewField;
0 33 NewField;
1993 30 4 if (csv->blank_is_undef || csv->empty_is_undef)
4 26 if (csv->blank_is_undef || csv->empty_is_undef)
1997 33 1 unless (csv->is_bound)
1999 3 31 if (csv->keep_meta_info && fflags)
3 0 if (csv->keep_meta_info && fflags)
2008 24 354 if (f & CSV_FLAGS_QUO)
2009 24 0 ERROR_INSIDE_QUOTES (2027);
2011 354 0 if (sv)
2012 40 314 AV_PUSH;
40 0 AV_PUSH;
40 0 AV_PUSH;
7 33 AV_PUSH;
11 343 AV_PUSH;
11 0 AV_PUSH;
11 0 AV_PUSH;
0 11 AV_PUSH;
22 332 AV_PUSH;
22 0 AV_PUSH;
153 201 AV_PUSH;
153 0 AV_PUSH;
152 1 AV_PUSH;
152 0 AV_PUSH;
63 89 AV_PUSH;
1 353 AV_PUSH;
344 10 AV_PUSH;
1 353 AV_PUSH;
1 0 AV_PUSH;
2024 125 0 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
125 0 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
0 125 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
0 0 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
125 0 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
0 125 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
2029 125 0 unless (svp && _is_coderef (*svp))
125 0 unless (svp && _is_coderef (*svp))
0 125 unless (svp && _is_coderef (*svp))
0 0 unless (svp && _is_coderef (*svp))
125 0 unless (svp && _is_coderef (*svp))
0 125 unless (svp && _is_coderef (*svp))
2035 0 125 PUSHMARK (SP);
2036 0 125 mXPUSHs (newRV_inc ((SV *)hv));
2037 0 125 mXPUSHs (newRV_inc ((SV *)av));
2041 125 0 if (res) {
2043 64 61 if (SvROK (rv) && (rv = SvRV (rv)) && SvPOK (rv)) {
64 0 if (SvROK (rv) && (rv = SvRV (rv)) && SvPOK (rv)) {
64 0 if (SvROK (rv) && (rv = SvRV (rv)) && SvPOK (rv)) {
2044 64 0 if (strcmp (SvPV_nolen (rv), "skip") == 0)
64 0 if (strcmp (SvPV_nolen (rv), "skip") == 0)
2049 125 0 FREETMPS;
2061 4023 405 if (csv.eolx || csv.eol_is_cr) {
444 3579 if (csv.eolx || csv.eol_is_cr) {
2067 2500 1928 if ((csv.useIO = useIO)) {
2070 176 2324 if ((ahead = csv.has_ahead)) {
2072 176 0 if ((svp = hv_fetchs (hv, "_AHEAD", FALSE)) && *svp) {
176 0 if ((svp = hv_fetchs (hv, "_AHEAD", FALSE)) && *svp) {
2073 175 1 csv.bptr = SvPV (csv.tmp = *svp, csv.size);
2075 0 176 if (pos && SvIV (pos) > (IV)csv.size)
0 0 if (pos && SvIV (pos) > (IV)csv.size)
0 0 if (pos && SvIV (pos) > (IV)csv.size)
2076 0 0 sv_setiv (pos, SvIV (pos) - csv.size);
2083 1928 0 csv.bptr = SvPV (src, csv.size);
2085 217 4211 if (csv.has_error_input) {
2094 27 4396 if (csv.strict) {
2095 8 19 unless (csv.strict_n) csv.strict_n = (short)csv.fld_idx;
2096 12 15 if (csv.fld_idx != csv.strict_n) {
2097 8 4 unless (csv.useIO & useIO_EOF)
2099 8 4 if (last_error) /* an error callback can reset and accept */
2104 2498 1925 if (csv.useIO) {
2105 2498 0 if (csv.tmp && csv.used < csv.size && csv.has_ahead) {
411 2087 if (csv.tmp && csv.used < csv.size && csv.has_ahead) {
37 374 if (csv.tmp && csv.used < csv.size && csv.has_ahead) {
2111 539 1922 if (csv.useIO & useIO_EOF)
2117 1557 941 if (avf) {
2118 11 1546 if (csv.keep_meta_info)
2129 3803 620 if (result && csv.types) {
2 3801 if (result && csv.types) {
2134 6 2 for (i = 0; i <= len && i <= csv.types_len; i++) {
6 0 for (i = 0; i <= len && i <= csv.types_len; i++) {
2135 6 0 if ((svp = av_fetch (av, i, FALSE)) && *svp && SvOK (*svp)) {
6 0 if ((svp = av_fetch (av, i, FALSE)) && *svp && SvOK (*svp)) {
0 6 if ((svp = av_fetch (av, i, FALSE)) && *svp && SvOK (*svp)) {
0 0 if ((svp = av_fetch (av, i, FALSE)) && *svp && SvOK (*svp)) {
0 0 if ((svp = av_fetch (av, i, FALSE)) && *svp && SvOK (*svp)) {
2139 0 2 sv_setiv (*svp, SvIV (*svp));
2150 0 2 sv_setnv (*svp, SvNV (*svp));
2177 3142 340 if (state && csv.has_hooks & HOOK_AFTER_PARSE)
5 3137 if (state && csv.has_hooks & HOOK_AFTER_PARSE)
2179 340 3142 return (state || !last_error);
2 338 return (state || !last_error);
2185 250 83 while (av_len (av) >= 0)
2198 256 56 if (SvOK (off)) {
256 0 if (SvOK (off)) {
0 256 if (SvOK (off)) {
2199 48 8 skip = SvIV (off);
2200 12 44 if (skip < 0) {
2205 268 44 if (SvOK (len))
268 0 if (SvOK (len))
0 268 if (SvOK (len))
2206 36 8 length = SvIV (len);
2208 661 280 while (c_xsParse (csv, hv, row, NULL, io, 1)) {
2212 20 641 if (skip > 0) {
2218 12 629 if (n++ >= tail) {
2223 117 524 if (csv.has_hooks & HOOK_AFTER_PARSE) {
2224 63 54 unless (hook (aTHX_ hv, "after_parse", row)) {
2231 52 526 if (n >= length && skip >= 0)
32 20 if (n >= length && skip >= 0)
2236 8 312 while (n > length) {
2255 260 21387 if (*csv.eol)
2258 20251 1396 if (useIO && csv.has_hooks & HOOK_BEFORE_PRINT)
3 20248 if (useIO && csv.has_hooks & HOOK_BEFORE_PRINT)
2264 21635 8 if (result && !useIO && csv.utf8)
1391 20244 if (result && !useIO && csv.utf8)
25 1366 if (result && !useIO && csv.utf8)
2287 0 2884 if (SvOK (self) && SvROK (self)) {
0 0 if (SvOK (self) && SvROK (self)) {
0 0 if (SvOK (self) && SvROK (self)) {
1047 1837 if (SvOK (self) && SvROK (self)) {
2288 1047 0 CSV_XS_SELF;
0 1047 CSV_XS_SELF;
0 0 CSV_XS_SELF;
0 0 CSV_XS_SELF;
1047 0 CSV_XS_SELF;
0 1047 CSV_XS_SELF;
2297 1990 894 if (xse && items > 2 && SvPOK (ST (2))) {
914 1076 if (xse && items > 2 && SvPOK (ST (2))) {
914 0 if (xse && items > 2 && SvPOK (ST (2))) {
2310 8 0 if (self && SvOK (self) && SvROK (self) && SvTYPE (SvRV (self)) == SVt_PVHV) {
1 7 if (self && SvOK (self) && SvROK (self) && SvTYPE (SvRV (self)) == SVt_PVHV) {
1 0 if (self && SvOK (self) && SvROK (self) && SvTYPE (SvRV (self)) == SVt_PVHV) {
0 1 if (self && SvOK (self) && SvROK (self) && SvTYPE (SvRV (self)) == SVt_PVHV) {
5 2 if (self && SvOK (self) && SvROK (self) && SvTYPE (SvRV (self)) == SVt_PVHV) {
4 1 if (self && SvOK (self) && SvROK (self) && SvTYPE (SvRV (self)) == SVt_PVHV) {
2313 1 3 if (SvOK (*sv))
1 0 if (SvOK (*sv))
0 1 if (SvOK (*sv))
2335 1396 0 CSV_XS_SELF;
0 1396 CSV_XS_SELF;
0 0 CSV_XS_SELF;
0 0 CSV_XS_SELF;
1396 0 CSV_XS_SELF;
0 1396 CSV_XS_SELF;
2337 1391 1 ST (0) = xsCombine (self, hv, av, dst, useIO) ? &PL_sv_yes : &PL_sv_undef;
2353 1928 0 CSV_XS_SELF;
0 1928 CSV_XS_SELF;
0 0 CSV_XS_SELF;
0 0 CSV_XS_SELF;
1928 0 CSV_XS_SELF;
0 1928 CSV_XS_SELF;
2357 1724 201 ST (0) = xsParse (self, hv, av, avf, src, 0) ? &PL_sv_yes : &PL_sv_no;
2371 20256 0 CSV_XS_SELF;
0 20256 CSV_XS_SELF;
0 0 CSV_XS_SELF;
0 0 CSV_XS_SELF;
20256 0 CSV_XS_SELF;
0 20256 CSV_XS_SELF;
2372 5 20251 if (fields == &PL_sv_undef)
2375 20251 0 unless (_is_arrayref (fields))
1 20250 unless (_is_arrayref (fields))
1 0 unless (_is_arrayref (fields))
20248 3 unless (_is_arrayref (fields))
2 20246 unless (_is_arrayref (fields))
2381 20244 7 ST (0) = xsCombine (self, hv, av, io, 1) ? &PL_sv_yes : &PL_sv_no;
2395 1559 0 CSV_XS_SELF;
0 1559 CSV_XS_SELF;
0 0 CSV_XS_SELF;
0 0 CSV_XS_SELF;
1559 0 CSV_XS_SELF;
0 1559 CSV_XS_SELF;
2400 1420 137 : &PL_sv_undef;
2413 312 0 CSV_XS_SELF;
0 312 CSV_XS_SELF;
0 0 CSV_XS_SELF;
0 0 CSV_XS_SELF;
312 0 CSV_XS_SELF;
0 312 CSV_XS_SELF;
2415 56 256 offset = items > 2 ? ST (2) : &PL_sv_undef;
2416 44 268 length = items > 3 ? ST (3) : &PL_sv_undef;
2431 23182 0 CSV_XS_SELF;
0 23182 CSV_XS_SELF;
0 0 CSV_XS_SELF;
0 0 CSV_XS_SELF;
23182 0 CSV_XS_SELF;
0 23182 CSV_XS_SELF;
2443 2 0 CSV_XS_SELF;
0 2 CSV_XS_SELF;
0 0 CSV_XS_SELF;
0 0 CSV_XS_SELF;
2 0 CSV_XS_SELF;
0 2 CSV_XS_SELF;