Branch Coverage

CSV_XS.xs
Criterion Covered Total %
branch 1556 2792 55.7


line true false branch
431 77081 996 while (xs_errors[i].xs_errno && xs_errors[i].xs_errno != xse) i++;
74263 2818 while (xs_errors[i].xs_errno && xs_errors[i].xs_errno != xse) i++;
432 3814 0 if ((err = newSVpv (xs_errors[i].xs_errstr, 0))) {
433 3814 0 (void)SvUPGRADE (err, SVt_PVIV);
451 6 1770 if (xse == 0) {
457 1776 0 if (line)
459 383 1393 if (xse == 2012) /* EOF */
461 344 1432 if (csv->auto_diag) {
462 344 0 unless (_is_hashref (pself))
0 344 unless (_is_hashref (pself))
0 0 unless (_is_hashref (pself))
182 162 unless (_is_hashref (pself))
0 182 unless (_is_hashref (pself))
465 0 344 PUSHMARK (SP);
466 0 344 XPUSHs (pself);
470 161 180 unless (pself == csv->pself)
481 32 0 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
0 32 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
485 0 32 if (csvs->eol_type == EOL_TYPE_NL) return "\n";
486 0 32 if (csvs->eol_type == EOL_TYPE_CR) return "\r";
487 21 11 if (csvs->eol_type == EOL_TYPE_CRNL) return "\r\n";
488 0 11 if (csvs->eol_type == EOL_TYPE_OTHER) return (char *)(csvs->eol);
505 22589 766 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
0 22589 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
511 16789 5800 if (SvPOK (val))
513 5788 16801 if (SvIOK (val))
515 0 16801 else if (SvNOK (val)) /* Needed for 5.6.x but safe for 5.8.x+ */
569 3223 0 csv->sep_len = len == 1 ? 0 : len;
574 3377 0 csv->quo_len = len == 1 ? 0 : len;
580 87 131 csv->eol_type = len == 0 ? EOL_TYPE_UNDEF
581 81 6 : len == 1 && *cp == CH_NL ? EOL_TYPE_NL
77 4 : len == 1 && *cp == CH_NL ? EOL_TYPE_NL
582 77 6 : len == 1 && *cp == CH_CR ? EOL_TYPE_CR
2 75 : len == 1 && *cp == CH_CR ? EOL_TYPE_CR
583 4 4 : len == 2 && *cp == CH_CR
4 0 : len == 2 && *cp == CH_CR
584 4 0 && cp[1] == CH_NL ? EOL_TYPE_CRNL
595 8 3 if (*cp) {
597 1 7 if (SvUTF8 (val))
607 1 1 csv->comment_str = *cp ? (byte *)cp : NULL;
611 1 0 if (cp && len) {
0 1 if (cp && len) {
675 1 0 if (csv->sep_len > 1)
678 1 0 if (csv->quo_len > 1)
680 0 1 if (csv->types_len)
685 1 0 if (csv->bptr)
687 1 0 if (csv->tmp && SvPOK (csv->tmp)) {
1 0 if (csv->tmp && SvPOK (csv->tmp)) {
691 1 0 if (csv->cache)
704 1 1 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp) {
0 1 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp) {
737 26837 894 if ((svp = hv_fetchs (self, "_CACHE", FALSE)) && *svp) {
26837 0 if ((svp = hv_fetchs (self, "_CACHE", FALSE)) && *svp) {
750 894 0 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
894 0 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
894 0 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
752 224 670 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
224 0 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
224 0 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
755 5 219 if (len > 1)
760 894 0 if ((svp = hv_fetchs (self, "quote_char", FALSE)) && *svp) {
894 0 if ((svp = hv_fetchs (self, "quote_char", FALSE)) && *svp) {
761 891 3 if (SvOK (*svp)) {
763 891 0 CH_QUOTE = len ? *ptr : (char)0;
768 6 888 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
6 0 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
5 1 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
771 4 1 if (len > 1)
776 894 0 if ((svp = hv_fetchs (self, "escape_char", FALSE)) && *svp) {
894 0 if ((svp = hv_fetchs (self, "escape_char", FALSE)) && *svp) {
777 888 6 if (SvOK (*svp)) {
779 886 2 csv->escape_char = len ? *ptr : (char)0;
785 894 0 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
894 0 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
889 5 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
789 100 789 if (len == 1 && *eol == CH_CR) {
42 58 if (len == 1 && *eol == CH_CR) {
793 58 789 else if (len == 1 && *eol == CH_NL)
54 4 else if (len == 1 && *eol == CH_NL)
795 55 738 else if (len == 2 && *eol == CH_CR && eol[1] == CH_NL)
50 5 else if (len == 2 && *eol == CH_CR && eol[1] == CH_NL)
50 0 else if (len == 2 && *eol == CH_CR && eol[1] == CH_NL)
800 894 0 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
894 0 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
1 893 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
804 0 1 if (SvUTF8 (*svp))
810 894 0 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
894 0 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
21 873 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
815 1 893 if ((svp = hv_fetchs (self, "_types", FALSE)) && *svp && SvOK (*svp)) {
1 0 if ((svp = hv_fetchs (self, "_types", FALSE)) && *svp && SvOK (*svp)) {
1 0 if ((svp = hv_fetchs (self, "_types", FALSE)) && *svp && SvOK (*svp)) {
820 12 882 if ((svp = hv_fetchs (self, "_is_bound", FALSE)) && *svp && SvOK (*svp))
12 0 if ((svp = hv_fetchs (self, "_is_bound", FALSE)) && *svp && SvOK (*svp))
12 0 if ((svp = hv_fetchs (self, "_is_bound", FALSE)) && *svp && SvOK (*svp))
822 894 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
894 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
0 894 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
0 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
325 569 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
325 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
824 16 309 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
16 0 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
0 16 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
0 0 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
16 0 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
16 0 if ((svp = hv_fetchs (cb, "after_parse", FALSE)) && _is_coderef (*svp))
826 3 322 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
3 0 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
0 3 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
0 0 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
3 0 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
3 0 if ((svp = hv_fetchs (cb, "before_print", FALSE)) && _is_coderef (*svp))
830 894 0 csv->binary = bool_opt ("binary");
894 0 csv->binary = bool_opt ("binary");
831 894 0 csv->decode_utf8 = bool_opt ("decode_utf8");
894 0 csv->decode_utf8 = bool_opt ("decode_utf8");
832 894 0 csv->always_quote = bool_opt ("always_quote");
894 0 csv->always_quote = bool_opt ("always_quote");
833 894 0 csv->strict = bool_opt ("strict");
894 0 csv->strict = bool_opt ("strict");
834 894 0 csv->strict_eol = num_opt ("strict_eol");
894 0 csv->strict_eol = num_opt ("strict_eol");
835 894 0 csv->quote_empty = bool_opt ("quote_empty");
894 0 csv->quote_empty = bool_opt ("quote_empty");
836 894 0 csv->quote_space = bool_opt_def ("quote_space", 1);
894 0 csv->quote_space = bool_opt_def ("quote_space", 1);
837 894 0 csv->escape_null = bool_opt_def ("escape_null", 1);
894 0 csv->escape_null = bool_opt_def ("escape_null", 1);
838 894 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
894 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
839 894 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
894 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
840 894 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
894 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
841 894 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
894 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
842 894 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
894 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
843 894 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
894 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
844 894 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
894 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
845 894 0 csv->verbatim = bool_opt ("verbatim");
894 0 csv->verbatim = bool_opt ("verbatim");
847 894 0 csv->auto_diag = num_opt ("auto_diag");
894 0 csv->auto_diag = num_opt ("auto_diag");
848 894 0 csv->diag_verbose = num_opt ("diag_verbose");
894 0 csv->diag_verbose = num_opt ("diag_verbose");
849 894 0 csv->keep_meta_info = num_opt ("keep_meta_info");
894 0 csv->keep_meta_info = num_opt ("keep_meta_info");
850 894 0 csv->skip_empty_rows = num_opt ("skip_empty_rows");
894 0 csv->skip_empty_rows = num_opt ("skip_empty_rows");
851 894 0 csv->formula = num_opt ("formula");
894 0 csv->formula = num_opt ("formula");
853 8 886 unless (csv->escape_char) csv->escape_null = 0;
869 27667 64 csv->first_safe_char = csv->quote_space ? 0x21 : 0x20;
871 112 27619 if (csv->is_bound) {
872 112 0 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
112 0 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
0 112 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
0 0 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
98 14 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
98 0 if ((svp = hv_fetchs (self, "_BOUND_COLUMNS", FALSE)) && _is_arrayref (*svp))
880 894 452 ? csv->verbatim || csv->eol_len >= 2
882 362 532 : csv->eol[0] == CH_CR || csv->eol[0] == CH_NL
884 52 310 : 1
885 1353 26378 : 0;
1346 7 : 0;
886 3030 24701 if (csv->eol_type > 0 && csv->strict_eol > 0 && !*csv->eol)
909 2121 if (csv->eol_type > 0 && csv->strict_eol > 0 && !*csv->eol)
750 159 if (csv->eol_type > 0 && csv->strict_eol > 0 && !*csv->eol)
892 51 27680 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))
894 27 27704 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))
897 67 27664 if (csv->strict
898 27 40 && !csv->strict_n
899 27 0 && (svp = hv_fetchs (self, "_COLUMN_NAMES", FALSE))
900 27 0 && _is_arrayref (*svp))
0 27 && _is_arrayref (*svp))
0 0 && _is_arrayref (*svp))
2 25 && _is_arrayref (*svp))
2 0 && _is_arrayref (*svp))
909 939903 1389 if (csv->useIO) {
912 0 939903 PUSHMARK (sp);
913 0 939903 EXTEND (sp, 2);
915 939649 254 if (csv->utf8) {
921 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) {
926 750862 939649 for (j = 0; j < keep; j++)
934 939903 0 if (result) {
936 1 939902 unless (result)
945 939674 1618 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
946 25 0 && SvROK (dst) && is_utf8_sv (SvRV (dst)))
24 1 && SvROK (dst) && is_utf8_sv (SvRV (dst)))
966 3 163 if (i >= csv->is_bound) {
971 163 0 if (sv && SvROK (sv)) {
163 0 if (sv && SvROK (sv)) {
975 163 0 if (sv && SvROK (sv)) {
163 0 if (sv && SvROK (sv)) {
977 14 149 if (keep)
980 148 1 unless (SvREADONLY (sv)) {
993 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);
1001 3 34 if (fa == 1) die ("Formulas are forbidden\n");
1002 3 31 if (fa == 2) croak ("Formulas are forbidden\n");
1004 6 25 if (fa == 3) {
1010 3 3 if (csv->recno) (void)sprintf (rec, " in record %lu", csv->recno + 1);
1014 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)) {
1016 1 0 if (avp && av_len (avp) >= (f - 1)) {
1 0 if (avp && av_len (avp) >= (f - 1)) {
1018 1 0 if (fnm && *fnm && SvOK (*fnm))
1 0 if (fnm && *fnm && SvOK (*fnm))
1 0 if (fnm && *fnm && SvOK (*fnm))
1027 4 21 if (len) *len = 0;
1029 5 20 if (fa == 4) {
1030 3 2 unless (SvREADONLY (sv)) SvSetEmpty (sv);
1034 5 15 if (fa == 5) {
1035 3 2 unless (SvREADONLY (sv)) SvSetUndef (sv);
1039 15 0 if (fa == 6) {
1042 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)) {
1046 15 0 DEFSV = sv;
1047 0 15 PUSHMARK (SP);
1051 15 0 if (result)
1056 0 15 return len ? SvPV (sv, *len) : SvPV_nolen (sv);
1146 6 21667 if (n < 0 && csv->is_bound) {
5 1 if (n < 0 && csv->is_bound) {
1151 2 21671 if (kmi >= 10) {
1153 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)) {
1155 2 0 if (avp && av_len (avp) >= n)
2 0 if (avp && av_len (avp) >= n)
1160 53947 21662 for (i = 0; i <= n; i++) {
1165 32275 21672 if (i > 0) {
1166 0 32275 CSV_PUT (csv, dst, CH_SEP);
0 0 CSV_PUT (csv, dst, CH_SEP);
1167 10 32265 if (csv->sep_len) {
1169 20 10 for (x = 1; x < (int)csv->sep_len; x++)
1170 0 20 CSV_PUT (csv, dst, csv->sep[x]);
0 0 CSV_PUT (csv, dst, csv->sep[x]);
1174 14 53933 if (bound)
1178 53933 0 sv = svp && *svp ? *svp : NULL;
53933 0 sv = svp && *svp ? *svp : NULL;
1181 53947 0 if (sv && (SvOK (sv) || (
53 53894 if (sv && (SvOK (sv) || (
1182 0 53 (SvGMAGICAL (sv) && (mg_get (sv), 1) && SvOK (sv))))) {
0 0 (SvGMAGICAL (sv) && (mg_get (sv), 1) && SvOK (sv))))) {
1188 16 53878 if (*ptr == '=' && csv->formula) {
10 6 if (*ptr == '=' && csv->formula) {
1189 2 4 unless (ptr = _formula (csv, sv, &len, i))
1192 1412 52476 if (len == 0)
1193 763 649 quoteMe = aq ? 1 : qe ? 1 : qm ? was_quoted (qm, i) : 0;
760 3 quoteMe = aq ? 1 : qe ? 1 : qm ? was_quoted (qm, i) : 0;
5 755 quoteMe = aq ? 1 : qe ? 1 : qm ? was_quoted (qm, i) : 0;
1196 20041 32435 if (SvUTF8 (sv)) {
1201 46853 5623 quoteMe = aq ? 1 : qm ? was_quoted (qm, i) : 0;
12 46841 quoteMe = aq ? 1 : qm ? was_quoted (qm, i) : 0;
1207 46848 5628 if (!quoteMe &&
1208 25883 20965 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
25268 615 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
25265 3 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
25265 21583 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
1220 83956 2133 for (ptr2 = ptr, l = len; l; ++ptr2, --l) {
1231 83956 0 if ((CH_QUOTE && c == CH_QUOTE) ||
83648 308 if ((CH_QUOTE && c == CH_QUOTE) ||
1232 81645 2003 (CH_SEP && c == CH_SEP) ||
81494 151 (CH_SEP && c == CH_SEP) ||
1233 83493 4 (csv->escape_char && c == csv->escape_char) ||
83269 224 (csv->escape_char && c == csv->escape_char) ||
60816 22447 (csv->escape_char && c == csv->escape_char) ||
8 2 (csv->escape_char && c == csv->escape_char) ||
1234 83263 10 (csv->quote_binary ? (x >= 0x7f && x <= 0xa0) ||
40061 43202 (csv->quote_binary ? (x >= 0x7f && x <= 0xa0) ||
20040 20021 (csv->quote_binary ? (x >= 0x7f && x <= 0xa0) ||
1235 2426 60816 x < csv->first_safe_char
1236 10 0 : c == CH_NL || c == CH_CR ||
10 0 : c == CH_NL || c == CH_CR ||
1237 5 5 (csv->quote_space && (
3 2 (csv->quote_space && (
1238 0 3 c == CH_SPACE || c == CH_TAB)))) {
1249 29414 24474 if (quoteMe) {
1250 0 29414 CSV_PUT (csv, dst, CH_QUOTE);
0 0 CSV_PUT (csv, dst, CH_QUOTE);
1251 17 29397 if (csv->quo_len) {
1253 34 17 for (x = 1; x < (int)csv->quo_len; x++)
1254 0 34 CSV_PUT (csv, dst, csv->quo[x]);
0 0 CSV_PUT (csv, dst, csv->quo[x]);
1257 950361654 53881 while (len-- > 0) {
1261 786 950360868 if (!csv->binary && is_csv_binary (c)) {
769 17 if (!csv->binary && is_csv_binary (c)) {
0 769 if (!csv->binary && is_csv_binary (c)) {
7 10 if (!csv->binary && is_csv_binary (c)) {
1264 0 7 unless (hv_store (csv->self, "_ERROR_INPUT", 12, sv, 0))
1269 950361638 9 if (CH_QUOTE && (byte)c == CH_QUOTE && (csv->quo_len == 0 ||
3225 950358413 if (CH_QUOTE && (byte)c == CH_QUOTE && (csv->quo_len == 0 ||
9 3216 if (CH_QUOTE && (byte)c == CH_QUOTE && (csv->quo_len == 0 ||
1270 1 8 memcmp (ptr, csv->quo +1, csv->quo_len - 1) == 0))
1273 2165 950356265 if (c == csv->escape_char && csv->escape_char)
2163 2 if (c == csv->escape_char && csv->escape_char)
1276 56 950356211 if (c == (char)0 && csv->escape_null) {
29 27 if (c == (char)0 && csv->escape_null) {
1280 5409 950356238 if (e && csv->escape_char)
5409 0 if (e && csv->escape_char)
1281 0 5409 CSV_PUT (csv, dst, csv->escape_char);
0 0 CSV_PUT (csv, dst, csv->escape_char);
1282 919632 949442015 CSV_PUT (csv, dst, c);
0 919632 CSV_PUT (csv, dst, c);
1284 29407 24474 if (quoteMe) {
1285 0 29407 CSV_PUT (csv, dst, CH_QUOTE);
0 0 CSV_PUT (csv, dst, CH_QUOTE);
1286 17 29390 if (csv->quo_len) {
1288 34 17 for (x = 1; x < (int)csv->quo_len; x++)
1289 0 34 CSV_PUT (csv, dst, csv->quo[x]);
0 0 CSV_PUT (csv, dst, csv->quo[x]);
1294 8 45 if (csv->undef_str) {
1298 3 5 if (csv->undef_flg) {
1303 20 8 while (len--)
1304 0 20 CSV_PUT (csv, dst, *ptr++);
0 0 CSV_PUT (csv, dst, *ptr++);
1308 241 21421 if (csv->eol_len) {
1312 439 241 while (len--)
1313 0 439 CSV_PUT (csv, dst, *ptr++);
0 0 CSV_PUT (csv, dst, *ptr++);
1315 21660 2 if (csv->used)
1345 326 0 if (csv->tmp) {
1347 326 0 if (hv_store (csv->self, "_ERROR_INPUT", 12, csv->tmp, 0))
1355 1525 3759 unless (csv->useIO)
1358 950 2809 if (csv->tmp && csv->eol_pos >= 0) {
348 602 if (csv->tmp && csv->eol_pos >= 0) {
1369 0 3411 PUSHMARK (sp);
1370 0 3411 EXTEND (sp, 1);
1376 3411 0 csv->tmp = result ? POPs : NULL;
1388 3411 0 if (csv->tmp && SvOK (csv->tmp)) {
2812 599 if (csv->tmp && SvOK (csv->tmp)) {
1393 358 2454 if (csv->eolx && csv->size >= csv->eol_len) {
358 0 if (csv->eolx && csv->size >= csv->eol_len) {
1395 1463 354 for (i = 1; i <= (int)csv->eol_len; i++) {
1396 4 1459 unless (csv->bptr[csv->size - i] == csv->eol[csv->eol_len - i]) {
1401 354 4 if (match) {
1406 351 3 unless (csv->verbatim)
1410 351 3 unless (csv->verbatim || csv->size)
6 345 unless (csv->verbatim || csv->size)
1414 70 2736 if (SvUTF8 (csv->tmp)) csv->utf8 = 1;
1415 2806 0 if (tmp_len)
1545 1745 0 unless (s && len) return;
0 1745 unless (s && len) return;
1546 186 1745 while (s[len - 1] == CH_SPACE || s[len - 1] == CH_TAB)
0 1745 while (s[len - 1] == CH_SPACE || s[len - 1] == CH_TAB)
1595 187636 3837 while ((c = CSV_GET) != EOF) {
190689 784 while ((c = CSV_GET) != EOF) {
1597 23924 166765 NewField;
151 23773 NewField;
4 23920 NewField;
1609 12576 189685 if (is_SEP (c)) {
88 12488 if (is_SEP (c)) {
88 0 if (is_SEP (c)) {
30 58 if (is_SEP (c)) {
30 0 if (is_SEP (c)) {
1615 1304 11214 if (waitingForField) {
1619 1278 26 if (csv->blank_is_undef || csv->empty_is_undef)
24 1254 if (csv->blank_is_undef || csv->empty_is_undef)
1623 1304 0 unless (csv->is_bound)
1626 8 1296 if (csv->keep_meta_info && fflags)
8 0 if (csv->keep_meta_info && fflags)
1630 2194 9020 if (f & CSV_FLAGS_QUO) {
1634 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)
0 2194 CSV_PUT_SV (c)
1640 9018 2 AV_PUSH;
90 8928 AV_PUSH;
19 71 AV_PUSH;
2 9016 AV_PUSH;
2 0 AV_PUSH;
2 0 AV_PUSH;
0 2 AV_PUSH;
1645 7373 AV_PUSH;
1645 0 AV_PUSH;
34 8984 AV_PUSH;
34 0 AV_PUSH;
32 2 AV_PUSH;
22 10 AV_PUSH;
5 9013 AV_PUSH;
8931 87 AV_PUSH;
21 8997 AV_PUSH;
21 0 AV_PUSH;
1644 188712 1031 if (is_QUOTE (c)) {
23076 165636 if (is_QUOTE (c)) {
86 22990 if (is_QUOTE (c)) {
86 0 if (is_QUOTE (c)) {
70 16 if (is_QUOTE (c)) {
70 0 if (is_QUOTE (c)) {
1650 11021 12039 if (waitingForField) {
1659 11971 68 if (f & CSV_FLAGS_QUO) {
1666 10648 1323 int c2 = CSV_GET;
1668 4240 7731 if (csv->allow_whitespace) {
1672 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)) {
1673 1 89 if (csv->allow_loose_quotes &&
1674 0 1 !(csv->escape_char && c2 == csv->escape_char)) {
0 0 !(csv->escape_char && c2 == csv->escape_char)) {
1680 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);
1683 87 3 c2 = CSV_GET;
1687 9027 2944 if (is_SEP (c2)) {
15 9012 if (is_SEP (c2)) {
15 0 if (is_SEP (c2)) {
15 0 if (is_SEP (c2)) {
15 0 if (is_SEP (c2)) {
1691 8327 700 AV_PUSH;
0 8327 AV_PUSH;
0 0 AV_PUSH;
700 8327 AV_PUSH;
688 12 AV_PUSH;
0 688 AV_PUSH;
0 0 AV_PUSH;
3400 5615 AV_PUSH;
0 3400 AV_PUSH;
2161 6854 AV_PUSH;
2161 0 AV_PUSH;
2142 19 AV_PUSH;
906 1236 AV_PUSH;
0 9027 AV_PUSH;
9023 4 AV_PUSH;
45 8982 AV_PUSH;
45 0 AV_PUSH;
1695 2750 194 if (c2 == CH_NL || c2 == CH_EOLX) {
20 2730 if (c2 == CH_NL || c2 == CH_EOLX) {
1696 20 194 unsigned short eolt = EOL_TYPE (c2);
0 20 unsigned short eolt = EOL_TYPE (c2);
1704 71 143 if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
31 40 if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
6 25 if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
1705 4 2 ERROR_EOL;
2 4 ERROR_EOL;
2 0 ERROR_EOL;
1706 60 152 SET_EOL_TYPE (csv, eolt);
1708 202 10 AV_PUSH;
0 202 AV_PUSH;
0 0 AV_PUSH;
10 202 AV_PUSH;
10 0 AV_PUSH;
0 10 AV_PUSH;
0 0 AV_PUSH;
6 206 AV_PUSH;
0 6 AV_PUSH;
125 87 AV_PUSH;
125 0 AV_PUSH;
95 30 AV_PUSH;
92 3 AV_PUSH;
0 212 AV_PUSH;
210 2 AV_PUSH;
1 211 AV_PUSH;
1 0 AV_PUSH;
1719 2713 17 if (csv->escape_char && c == csv->escape_char) {
1633 1080 if (csv->escape_char && c == csv->escape_char) {
1722 25 1608 if (c2 == '0') {
1726 25 0 CSV_PUT_SV (0)
0 25 CSV_PUT_SV (0)
1730 1608 0 if (is_QUOTE (c2)) {
1060 548 if (is_QUOTE (c2)) {
0 1060 if (is_QUOTE (c2)) {
0 0 if (is_QUOTE (c2)) {
0 0 if (is_QUOTE (c2)) {
0 0 if (is_QUOTE (c2)) {
1734 1 1059 if (csv->utf8)
1736 0 1060 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 1060 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 1060 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
0 0 CSV_PUT_SV (c2)
1060 0 CSV_PUT_SV (c2)
2 1058 CSV_PUT_SV (c2)
1740 3 545 if (csv->allow_loose_escapes && c2 != CH_CR) {
2 1 if (csv->allow_loose_escapes && c2 != CH_CR) {
1744 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);
1750 280 1363 if (c2 == CH_CR) {
1753 109 171 if (csv->eol_is_cr) {
1761 105 4 AV_PUSH;
0 105 AV_PUSH;
0 0 AV_PUSH;
4 105 AV_PUSH;
4 0 AV_PUSH;
0 4 AV_PUSH;
0 0 AV_PUSH;
18 91 AV_PUSH;
0 18 AV_PUSH;
82 27 AV_PUSH;
82 0 AV_PUSH;
82 0 AV_PUSH;
82 0 AV_PUSH;
0 109 AV_PUSH;
109 0 AV_PUSH;
0 109 AV_PUSH;
0 0 AV_PUSH;
1765 166 5 c3 = CSV_GET;
1767 139 32 if (c3 == CH_NL) { /* \r is not optional before EOLX! */
1775 82 57 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
37 45 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
0 37 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
1776 0 0 ERROR_EOL;
0 0 ERROR_EOL;
0 0 ERROR_EOL;
1777 68 71 SET_EOL_TYPE (csv, EOL_TYPE_CRNL);
1779 137 2 AV_PUSH;
0 137 AV_PUSH;
0 0 AV_PUSH;
2 137 AV_PUSH;
2 0 AV_PUSH;
0 2 AV_PUSH;
0 0 AV_PUSH;
5 134 AV_PUSH;
0 5 AV_PUSH;
70 69 AV_PUSH;
70 0 AV_PUSH;
40 30 AV_PUSH;
40 0 AV_PUSH;
0 139 AV_PUSH;
139 0 AV_PUSH;
0 139 AV_PUSH;
0 0 AV_PUSH;
1783 19 13 if (csv->useIO && csv->eol_len == 0) {
19 0 if (csv->useIO && csv->eol_len == 0) {
1784 8 11 if (c3 == CH_CR) { /* \r followed by an empty line */
1792 6 2 if (csv->strict_eol && csv->eol_type) {
2 4 if (csv->strict_eol && csv->eol_type) {
1793 2 0 unless (csv->eol_type == EOL_TYPE_CR)
1794 0 2 ERROR_EOL;
0 2 ERROR_EOL;
0 0 ERROR_EOL;
1797 2 0 AV_PUSH;
0 2 AV_PUSH;
0 0 AV_PUSH;
0 2 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 2 AV_PUSH;
0 0 AV_PUSH;
0 2 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 2 AV_PUSH;
2 0 AV_PUSH;
0 2 AV_PUSH;
0 0 AV_PUSH;
1802 6 0 if (f & CSV_FLAGS_QUO) f ^= CSV_FLAGS_QUO;
1807 11 0 if (!is_csv_binary (c3)) {
0 11 if (!is_csv_binary (c3)) {
0 0 if (!is_csv_binary (c3)) {
1816 6 5 if (csv->strict_eol && csv->eol_type) {
2 4 if (csv->strict_eol && csv->eol_type) {
1817 2 0 unless (csv->eol_type == EOL_TYPE_CR)
1818 0 2 ERROR_EOL;
0 2 ERROR_EOL;
0 0 ERROR_EOL;
1825 11 0 AV_PUSH;
0 11 AV_PUSH;
0 0 AV_PUSH;
0 11 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 11 AV_PUSH;
0 0 AV_PUSH;
0 11 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 11 AV_PUSH;
11 0 AV_PUSH;
0 11 AV_PUSH;
0 0 AV_PUSH;
1830 12 1 ParseError (csv, quoesc ? 2023 : 2010, csv->used - 2);
1834 1306 57 if (c2 == EOF) {
1838 1294 12 AV_PUSH;
0 1294 AV_PUSH;
0 0 AV_PUSH;
12 1294 AV_PUSH;
12 0 AV_PUSH;
0 12 AV_PUSH;
0 0 AV_PUSH;
533 773 AV_PUSH;
0 533 AV_PUSH;
14 1292 AV_PUSH;
14 0 AV_PUSH;
9 5 AV_PUSH;
7 2 AV_PUSH;
0 1306 AV_PUSH;
1306 0 AV_PUSH;
11 1295 AV_PUSH;
11 0 AV_PUSH;
1842 12 45 if (csv->allow_loose_quotes && !quoesc) {
10 2 if (csv->allow_loose_quotes && !quoesc) {
1846 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);
0 10 CSV_PUT_SV (c);
1854 39 8 if (quoesc) {
1856 39 0 ERROR_INSIDE_QUOTES (2023);
1859 8 0 ERROR_INSIDE_QUOTES (2011);
1863 16 52 if (csv->allow_loose_quotes) { /* 1,foo "boo" d'uh,1 */
1865 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);
1868 51 1 ERROR_INSIDE_FIELD (2034);
1871 4653 162030 if (c == csv->escape_char && csv->escape_char) {
4651 2 if (c == csv->escape_char && csv->escape_char) {
1878 33 4618 if (waitingForField) {
1880 3 30 if (csv->allow_unquoted_escape) {
1884 2 1 int c2 = CSV_GET;
1888 1 2 if (c2 == EOF) {
1890 1 0 ERROR_INSIDE_FIELD (2035);
1893 1 1 if (c2 == '0')
1894 1 0 CSV_PUT_SV (0)
0 1 CSV_PUT_SV (0)
1896 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) ||
1897 0 0 c2 == csv->escape_char || csv->allow_loose_escapes) {
0 0 c2 == csv->escape_char || csv->allow_loose_escapes) {
1898 0 1 if (csv->utf8)
1900 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)
1904 0 0 ERROR_INSIDE_QUOTES (2025);
1909 4610 8 if (f & CSV_FLAGS_QUO) {
1910 4607 3 int c2 = CSV_GET;
1912 3 4607 if (c2 == EOF) {
1914 3 0 ERROR_INSIDE_QUOTES (2024);
1917 2 4605 if (c2 == '0')
1918 2 0 CSV_PUT_SV (0)
0 2 CSV_PUT_SV (0)
1920 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) ||
1921 28 2165 c2 == csv->escape_char || csv->allow_loose_escapes) {
2 26 c2 == csv->escape_char || csv->allow_loose_escapes) {
1922 1 4578 if (csv->utf8)
1924 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)
0 4578 CSV_PUT_SV (c2)
1928 26 0 ERROR_INSIDE_QUOTES (2025);
1932 8 0 if (sv) {
1933 4 4 int c2 = CSV_GET;
1935 4 4 if (c2 == EOF) {
1937 4 0 ERROR_INSIDE_FIELD (2035);
1940 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);
1943 0 0 ERROR_INSIDE_FIELD (2036); /* uncoverable statement I think there's no way to get here */
1946 1949 160083 if (c == CH_NL || is_EOL (c)) {
334 159749 if (c == CH_NL || is_EOL (c)) {
1949 833 2092 eolt = ((c == CH_NL || c == CH_CR) && c0 == CH_CR) ? EOL_TYPE_CRNL : EOL_TYPE (c);
491 342 eolt = ((c == CH_NL || c == CH_CR) && c0 == CH_CR) ? EOL_TYPE_CRNL : EOL_TYPE (c);
1733 850 eolt = ((c == CH_NL || c == CH_CR) && c0 == CH_CR) ? EOL_TYPE_CRNL : EOL_TYPE (c);
342 1733 eolt = ((c == CH_NL || c == CH_CR) && c0 == CH_CR) ? EOL_TYPE_CRNL : EOL_TYPE (c);
0 342 eolt = ((c == CH_NL || c == CH_CR) && c0 == CH_CR) ? EOL_TYPE_CRNL : EOL_TYPE (c);
1956 2175 750 unless (f & CSV_FLAGS_QUO) {
1957 689 1486 if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
543 146 if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
37 506 if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
1958 12 25 ERROR_EOL;
5 32 ERROR_EOL;
5 0 ERROR_EOL;
1959 265 1905 SET_EOL_TYPE (csv, eolt);
1962 350 2570 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
267 83 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
156 111 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
91 65 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
1963 3 88 SkipEmptyRow;
3 85 SkipEmptyRow;
2 83 SkipEmptyRow;
73 10 SkipEmptyRow;
11 62 SkipEmptyRow;
67 6 SkipEmptyRow;
2 65 SkipEmptyRow;
2 6 SkipEmptyRow;
10 65 SkipEmptyRow;
10 0 SkipEmptyRow;
10 0 SkipEmptyRow;
0 10 SkipEmptyRow;
0 0 SkipEmptyRow;
10 0 SkipEmptyRow;
0 10 SkipEmptyRow;
10 0 SkipEmptyRow;
0 10 SkipEmptyRow;
0 10 SkipEmptyRow;
10 0 SkipEmptyRow;
0 10 SkipEmptyRow;
0 0 SkipEmptyRow;
8 2 SkipEmptyRow;
0 8 SkipEmptyRow;
0 8 SkipEmptyRow;
0 8 SkipEmptyRow;
0 8 SkipEmptyRow;
0 0 SkipEmptyRow;
32 0 SkipEmptyRow;
32 0 SkipEmptyRow;
32 0 SkipEmptyRow;
32 0 SkipEmptyRow;
0 32 SkipEmptyRow;
0 0 SkipEmptyRow;
0 32 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 32 SkipEmptyRow;
0 0 SkipEmptyRow;
0 32 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 32 SkipEmptyRow;
32 0 SkipEmptyRow;
0 32 SkipEmptyRow;
0 0 SkipEmptyRow;
32 8 SkipEmptyRow;
1967 263 2566 if (waitingForField) {
1971 255 8 if (csv->blank_is_undef || csv->empty_is_undef)
8 247 if (csv->blank_is_undef || csv->empty_is_undef)
1975 263 0 unless (csv->is_bound)
1977 14 249 if (csv->keep_meta_info && fflags)
14 0 if (csv->keep_meta_info && fflags)
1982 750 1816 if (f & CSV_FLAGS_QUO) {
1987 19 731 unless (csv->binary)
1988 19 0 ERROR_INSIDE_QUOTES (2021);
1990 40 691 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 691 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 691 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
691 0 CSV_PUT_SV (c);
0 691 CSV_PUT_SV (c);
1993 9 1807 if (csv->verbatim) {
1998 1 8 unless (csv->binary)
1999 1 0 ERROR_INSIDE_FIELD (2030);
2001 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);
1 5 CSV_PUT_SV (c);
2007 332 1475 if (csv->recno == 0 && csv->fld_idx == 1 && csv->useIO &&
29 303 if (csv->recno == 0 && csv->fld_idx == 1 && csv->useIO &&
29 0 if (csv->recno == 0 && csv->fld_idx == 1 && csv->useIO &&
2008 24 5 (csv->bptr[0] == 's' || csv->bptr[0] == 'S') &&
0 24 (csv->bptr[0] == 's' || csv->bptr[0] == 'S') &&
2009 0 5 (csv->bptr[1] == 'e' || csv->bptr[1] == 'E') &&
0 0 (csv->bptr[1] == 'e' || csv->bptr[1] == 'E') &&
2010 0 5 (csv->bptr[2] == 'p' || csv->bptr[2] == 'P') &&
0 0 (csv->bptr[2] == 'p' || csv->bptr[2] == 'P') &&
2011 5 0 csv->bptr[3] == '=') {
2014 4 1 if (lnu <= MAX_ATTR_LEN) {
2017 1 3 csv->sep_len = lnu == 1 ? 0 : lnu;
2025 1796 7 AV_PUSH;
4 1792 AV_PUSH;
1 3 AV_PUSH;
7 1796 AV_PUSH;
7 0 AV_PUSH;
7 0 AV_PUSH;
0 7 AV_PUSH;
78 1725 AV_PUSH;
78 0 AV_PUSH;
82 1721 AV_PUSH;
82 0 AV_PUSH;
81 1 AV_PUSH;
37 44 AV_PUSH;
1 1802 AV_PUSH;
1760 43 AV_PUSH;
9 1794 AV_PUSH;
9 0 AV_PUSH;
2030 1332 158417 if (c == CH_CR && !(csv->verbatim)) {
1329 3 if (c == CH_CR && !(csv->verbatim)) {
2037 169 1160 if (waitingForField) {
2040 46 123 if (csv->eol_is_cr) {
2048 118 5 c2 = CSV_GET;
2050 5 118 if (c2 == EOF) {
2060 0 5 unless (seenSomething)
2065 97 21 if (c2 == CH_NL) { /* \r is not optional before EOLX! */
2069 22 75 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
14 8 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
0 14 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
2070 0 0 ERROR_EOL;
0 0 ERROR_EOL;
0 0 ERROR_EOL;
2071 15 82 SET_EOL_TYPE (csv, EOL_TYPE_CRNL);
2082 16 5 if (csv->useIO && csv->eol_len == 0) {
16 0 if (csv->useIO && csv->eol_len == 0) {
2083 0 16 if (c2 == CH_CR) { /* \r followed by an empty line */
2087 0 0 if (csv->strict_eol && csv->eol_type) {
0 0 if (csv->strict_eol && csv->eol_type) {
2088 0 0 unless (csv->eol_type == EOL_TYPE_CR)
2089 0 0 ERROR_EOL;
0 0 ERROR_EOL;
0 0 ERROR_EOL;
2099 13 3 if (!is_csv_binary (c2)) {
0 13 if (!is_csv_binary (c2)) {
0 3 if (!is_csv_binary (c2)) {
2104 9 4 if (csv->strict_eol && csv->eol_type) {
4 5 if (csv->strict_eol && csv->eol_type) {
2105 4 0 unless (csv->eol_type == EOL_TYPE_CR)
2106 0 4 ERROR_EOL;
0 4 ERROR_EOL;
0 0 ERROR_EOL;
2112 11 2 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
11 0 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
11 0 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
6 5 if (fnum == 1 && f == 0 && SvCUR (sv) == 0 && csv->skip_empty_rows) {
2113 0 6 SkipEmptyRow;
0 6 SkipEmptyRow;
0 6 SkipEmptyRow;
6 0 SkipEmptyRow;
6 0 SkipEmptyRow;
6 0 SkipEmptyRow;
0 6 SkipEmptyRow;
0 0 SkipEmptyRow;
0 6 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
2116 0 7 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
7 0 AV_PUSH;
7 0 AV_PUSH;
7 0 AV_PUSH;
0 7 AV_PUSH;
0 7 AV_PUSH;
0 0 AV_PUSH;
0 7 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 7 AV_PUSH;
7 0 AV_PUSH;
0 7 AV_PUSH;
0 0 AV_PUSH;
2125 8 0 ERROR_INSIDE_FIELD (2031);
2128 641 519 if (f & CSV_FLAGS_QUO) {
2133 70 571 unless (csv->binary)
2134 70 0 ERROR_INSIDE_QUOTES (2022);
2136 0 571 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 571 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 571 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
571 0 CSV_PUT_SV (c);
2 569 CSV_PUT_SV (c);
2141 192 327 if (csv->eol_is_cr) {
2148 322 5 c2 = CSV_GET;
2150 293 34 if (c2 == CH_NL) { /* \r is not optional before EOLX! */
2154 162 131 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
86 76 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
10 76 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
2155 1 9 ERROR_EOL;
0 10 ERROR_EOL;
0 0 ERROR_EOL;
2156 103 190 SET_EOL_TYPE (csv, EOL_TYPE_CRNL);
2166 29 5 if (csv->useIO && csv->eol_len == 0) {
29 0 if (csv->useIO && csv->eol_len == 0) {
2167 14 15 if (!is_csv_binary (c2)
0 14 if (!is_csv_binary (c2)
15 0 if (!is_csv_binary (c2)
2172 9 6 || c2 == CH_CR) {
2180 12 11 if (csv->strict_eol && csv->eol_type) {
4 8 if (csv->strict_eol && csv->eol_type) {
2181 4 0 unless (csv->eol_type == EOL_TYPE_CR)
2182 0 4 ERROR_EOL;
0 4 ERROR_EOL;
0 0 ERROR_EOL;
2188 0 23 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) {
2189 0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
0 0 SkipEmptyRow;
2192 23 0 AV_PUSH;
0 23 AV_PUSH;
0 0 AV_PUSH;
0 23 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 23 AV_PUSH;
0 0 AV_PUSH;
0 23 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 0 AV_PUSH;
0 23 AV_PUSH;
23 0 AV_PUSH;
0 23 AV_PUSH;
0 0 AV_PUSH;
2200 11 0 ERROR_INSIDE_FIELD (2032);
2210 3646 154774 if (csv->eolx && c == CH_EOL &&
8 3638 if (csv->eolx && c == CH_EOL &&
2211 8 0 csv->size - csv->used >= (STRLEN)csv->eol_len - 1 &&
2212 8 0 !memcmp (csv->bptr + csv->used, csv->eol + 1, csv->eol_len - 1) &&
2213 8 0 (csv->used += csv->eol_len - 1)) {
2221 11493 146919 if (waitingForField) {
2222 193 11300 if (csv->comment_str && !f && !spl && c == *csv->comment_str) {
193 0 if (csv->comment_str && !f && !spl && c == *csv->comment_str) {
113 80 if (csv->comment_str && !f && !spl && c == *csv->comment_str) {
35 78 if (csv->comment_str && !f && !spl && c == *csv->comment_str) {
2230 18 17 if (cl == 1 || (
2231 18 0 (csv->size - csv->used >= cl - 1 &&
2232 18 0 !memcmp (csv->bptr + csv->used, csv->comment_str + 1, cl - 1) &&
2233 18 0 (csv->used += cl - 1)))) {
2235 6 29 csv->fld_idx = csv->strict_n ? csv->strict_n - 1 : 0;
2236 0 35 c = CSV_GET;
2241 1 34 unless (csv->useIO)
2243 4 31 if (c == EOF)
2249 1956 9502 if (csv->allow_whitespace && is_whitespace (c)) {
1956 0 if (csv->allow_whitespace && is_whitespace (c)) {
1956 0 if (csv->allow_whitespace && is_whitespace (c)) {
1956 0 if (csv->allow_whitespace && is_whitespace (c)) {
1745 211 if (csv->allow_whitespace && is_whitespace (c)) {
0 1745 if (csv->allow_whitespace && is_whitespace (c)) {
2251 320 1 c = CSV_GET;
2255 283 38 } while (is_whitespace (c));
251 32 } while (is_whitespace (c));
251 0 } while (is_whitespace (c));
110 141 } while (is_whitespace (c));
0 141 } while (is_whitespace (c));
2256 1 210 if (c == EOF)
2270 111602 35317 if (f & CSV_FLAGS_QUO) {
2271 111154 448 if (is_csv_binary (c)) {
3021 108133 if (is_csv_binary (c)) {
3454 15 if (is_csv_binary (c)) {
2273 31 3423 unless (csv->binary || csv->utf8)
5 26 unless (csv->binary || csv->utf8)
2274 5 0 ERROR_INSIDE_QUOTES (2026);
2276 0 111597 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 111597 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 111597 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
111597 0 CSV_PUT_SV (c);
3759 107838 CSV_PUT_SV (c);
2279 35279 38 if (is_csv_binary (c)) {
427 34852 if (is_csv_binary (c)) {
453 12 if (is_csv_binary (c)) {
2280 413 40 if (csv->useIO && c == EOF)
3 410 if (csv->useIO && c == EOF)
2283 9 441 unless (csv->binary || csv->utf8)
9 0 unless (csv->binary || csv->utf8)
2284 9 0 ERROR_INSIDE_FIELD (2037);
2286 0 35305 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 35305 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 35305 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
0 0 CSV_PUT_SV (c);
35305 0 CSV_PUT_SV (c);
178 35127 CSV_PUT_SV (c);
2291 119 165242 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)
2295 418 383 if (waitingForField) {
2296 27 391 unless (csv->useIO) {
2297 1 26 if (csv->has_ahead == 214)
2301 35 382 if (seenSomething) {
2302 34 1 NewField;
1 33 NewField;
0 34 NewField;
2303 31 4 if (csv->blank_is_undef || csv->empty_is_undef)
4 27 if (csv->blank_is_undef || csv->empty_is_undef)
2307 34 1 unless (csv->is_bound)
2309 3 32 if (csv->keep_meta_info && fflags)
3 0 if (csv->keep_meta_info && fflags)
2318 24 359 if (f & CSV_FLAGS_QUO)
2319 24 0 ERROR_INSIDE_QUOTES (2027);
2321 359 0 if (sv) {
2322 349 10 AV_PUSH;
40 309 AV_PUSH;
7 33 AV_PUSH;
10 349 AV_PUSH;
10 0 AV_PUSH;
10 0 AV_PUSH;
0 10 AV_PUSH;
22 337 AV_PUSH;
22 0 AV_PUSH;
153 206 AV_PUSH;
153 0 AV_PUSH;
152 1 AV_PUSH;
63 89 AV_PUSH;
1 358 AV_PUSH;
349 10 AV_PUSH;
1 358 AV_PUSH;
1 0 AV_PUSH;
2324 0 0 else if (f == 0 && fnum == 1 && csv->skip_empty_rows == 1)
0 0 else if (f == 0 && fnum == 1 && csv->skip_empty_rows == 1)
0 0 else if (f == 0 && fnum == 1 && csv->skip_empty_rows == 1)
2337 154 0 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
154 0 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
0 154 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
0 0 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
154 0 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
0 154 unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
2342 154 0 unless (svp && _is_coderef (*svp))
154 0 unless (svp && _is_coderef (*svp))
0 154 unless (svp && _is_coderef (*svp))
0 0 unless (svp && _is_coderef (*svp))
154 0 unless (svp && _is_coderef (*svp))
0 154 unless (svp && _is_coderef (*svp))
2348 0 154 PUSHMARK (SP);
2349 0 154 mXPUSHs (newRV_inc ((SV *)hv));
2350 0 154 mXPUSHs (newRV_inc ((SV *)av));
2354 154 0 if (res) {
2356 65 89 if (SvROK (rv) && (rv = SvRV (rv)) && SvPOK (rv)) {
65 0 if (SvROK (rv) && (rv = SvRV (rv)) && SvPOK (rv)) {
65 0 if (SvROK (rv) && (rv = SvRV (rv)) && SvPOK (rv)) {
2357 65 0 if (strcmp (SvPV_nolen (rv), "skip") == 0)
2362 154 0 FREETMPS;
2374 4573 405 if (csv.eolx || csv.eol_is_cr) {
489 4084 if (csv.eolx || csv.eol_is_cr) {
2384 3041 1937 if ((csv.useIO = useIO)) {
2387 232 2809 if ((ahead = csv.has_ahead)) {
2389 232 0 if ((svp = hv_fetchs (hv, "_AHEAD", FALSE)) && *svp) {
232 0 if ((svp = hv_fetchs (hv, "_AHEAD", FALSE)) && *svp) {
2392 0 232 if (pos && SvIV (pos) > (IV)csv.size)
0 0 if (pos && SvIV (pos) > (IV)csv.size)
2402 227 4751 if (csv.has_error_input) {
2411 60 4907 if (csv.strict) {
2412 11 49 STRLEN nf = csv.is_bound ? csv.fld_idx ? csv.fld_idx - 1 : 0 : av_len (av);
11 0 STRLEN nf = csv.is_bound ? csv.fld_idx ? csv.fld_idx - 1 : 0 : av_len (av);
2418 56 4 if (nf && !csv.strict_n) csv.strict_n = (short)nf;
20 36 if (nf && !csv.strict_n) csv.strict_n = (short)nf;
2419 60 0 if (csv.strict_n > 0 && nf != (STRLEN)csv.strict_n) {
25 35 if (csv.strict_n > 0 && nf != (STRLEN)csv.strict_n) {
2420 18 7 unless (csv.useIO & useIO_EOF) {
2424 17 1 unless (last_error || (!csv.useIO && csv.has_ahead))
5 12 unless (last_error || (!csv.useIO && csv.has_ahead))
4 1 unless (last_error || (!csv.useIO && csv.has_ahead))
2427 20 5 if (last_error) /* an error callback can reset and accept */
2432 3033 1934 if (csv.useIO) {
2433 3033 0 if (csv.tmp && csv.used < csv.size && csv.has_ahead) {
482 2551 if (csv.tmp && csv.used < csv.size && csv.has_ahead) {
94 388 if (csv.tmp && csv.used < csv.size && csv.has_ahead) {
2439 599 2340 if (csv.useIO & useIO_EOF)
2445 1918 1115 if (avf) {
2446 11 1907 if (csv.keep_meta_info)
2457 1934 0 if (svp && *svp)
1934 0 if (svp && *svp)
2462 4266 701 if (result && csv.types) {
2 4264 if (result && csv.types) {
2467 6 2 for (i = 0; i <= len && i <= csv.types_len; i++) {
6 0 for (i = 0; i <= len && i <= csv.types_len; i++) {
2468 6 0 if ((svp = av_fetch (av, i, FALSE)) && *svp && SvOK (*svp)) {
6 0 if ((svp = av_fetch (av, i, FALSE)) && *svp && SvOK (*svp)) {
6 0 if ((svp = av_fetch (av, i, FALSE)) && *svp && SvOK (*svp)) {
2510 3470 382 if (state && csv.has_hooks & HOOK_AFTER_PARSE)
5 3465 if (state && csv.has_hooks & HOOK_AFTER_PARSE)
2512 382 3470 return (state || !last_error);
2 380 return (state || !last_error);
2518 253 84 while (av_len (av) >= 0)
2531 56 301 if (SvOK (off)) {
2533 12 44 if (skip < 0) {
2538 44 313 if (SvOK (len))
2541 796 319 while (c_xsParse (csv, hv, row, NULL, io, 1)) {
2545 20 776 if (skip > 0) {
2551 12 764 if (n++ >= tail) {
2556 140 636 if (csv.has_hooks & HOOK_AFTER_PARSE) {
2557 64 76 unless (hook (aTHX_ hv, "after_parse", row)) {
2564 52 660 if (n >= length && skip >= 0)
32 20 if (n >= length && skip >= 0)
2569 8 351 while (n > length) {
2588 251 21422 if (*csv.eol)
2591 20277 1396 if (useIO && csv.has_hooks & HOOK_BEFORE_PRINT)
9 20268 if (useIO && csv.has_hooks & HOOK_BEFORE_PRINT)
2597 21661 8 if (result && !useIO && csv.utf8)
1391 20270 if (result && !useIO && csv.utf8)
25 1366 if (result && !useIO && csv.utf8)
2618 3086 0 if (SvOK (self) && SvROK (self)) {
1048 2038 if (SvOK (self) && SvROK (self)) {
2619 1048 0 CSV_XS_SELF;
1048 0 CSV_XS_SELF;
1048 0 CSV_XS_SELF;
0 1048 CSV_XS_SELF;
2628 2090 996 if (xse && SvPOK (line)) {
1012 1078 if (xse && SvPOK (line)) {
2640 8 0 if (self && SvOK (self) && SvROK (self) && SvTYPE (SvRV (self)) == SVt_PVHV) {
7 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) {
2643 3 1 if (SvOK (*sv))
2661 1396 0 CSV_XS_SELF;
1396 0 CSV_XS_SELF;
1396 0 CSV_XS_SELF;
0 1396 CSV_XS_SELF;
2663 1391 1 ST (0) = xsCombine (self, hv, av, dst, useIO) ? &PL_sv_yes : &PL_sv_undef;
2676 1937 0 CSV_XS_SELF;
1937 0 CSV_XS_SELF;
1937 0 CSV_XS_SELF;
0 1937 CSV_XS_SELF;
2681 1729 205 PUT_RETURN (r ? &PL_sv_yes : &PL_sv_no);
2692 20282 0 CSV_XS_SELF;
20282 0 CSV_XS_SELF;
20282 0 CSV_XS_SELF;
0 20282 CSV_XS_SELF;
2693 5 20277 if (fields == &PL_sv_undef)
2696 20277 0 unless (_is_arrayref (fields))
1 20276 unless (_is_arrayref (fields))
1 0 unless (_is_arrayref (fields))
20274 3 unless (_is_arrayref (fields))
2 20272 unless (_is_arrayref (fields))
2703 20270 7 PUT_RETURN (r ? &PL_sv_yes : &PL_sv_no);
2715 1920 0 CSV_XS_SELF;
1920 0 CSV_XS_SELF;
1920 0 CSV_XS_SELF;
0 1920 CSV_XS_SELF;
2719 1743 175 PUT_RETURN (r ? sv_2mortal (newRV_noinc ((SV *)av)) : undef);
2729 357 0 CSV_XS_SELF;
357 0 CSV_XS_SELF;
357 0 CSV_XS_SELF;
0 357 CSV_XS_SELF;
2743 32 0 CSV_XS_SELF;
32 0 CSV_XS_SELF;
32 0 CSV_XS_SELF;
0 32 CSV_XS_SELF;
2746 21 11 if (eol)
2760 23355 0 CSV_XS_SELF;
23355 0 CSV_XS_SELF;
23355 0 CSV_XS_SELF;
0 23355 CSV_XS_SELF;
2771 2 0 CSV_XS_SELF;
2 0 CSV_XS_SELF;
2 0 CSV_XS_SELF;
0 2 CSV_XS_SELF;