Branch Coverage

CSV_XS.xs
Criterion Covered Total %
branch 1570 2808 55.9


line true false branch
431 77350 1001 while (xs_errors[i].xs_errno && xs_errors[i].xs_errno != xse) i++;
74528 2822 while (xs_errors[i].xs_errno && xs_errors[i].xs_errno != xse) i++;
432 3823 0 if ((err = newSVpv (xs_errors[i].xs_errstr, 0))) {
433 3823 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);
499 1772 33 if (val == NULL) {
504 0 33 unless (hv_store (hv, key, klen, val, 0))
521 22589 767 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
0 22589 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
527 16789 5800 if (SvPOK (val))
529 5788 16801 if (SvIOK (val))
531 0 16801 else if (SvNOK (val)) /* Needed for 5.6.x but safe for 5.8.x+ */
584 0 3223 if (len > MAX_ATTR_LEN) croak ("INI - SEP too long"); /* 1006 */
586 3223 0 csv->sep_len = len == 1 ? 0 : len;
590 0 3377 if (len > MAX_ATTR_LEN) croak ("INI - QUOTE too long"); /* 1007 */
592 3377 0 csv->quo_len = len == 1 ? 0 : len;
596 0 218 if (len > MAX_ATTR_LEN) croak ("INI - EOL too long"); /* 1005 */
599 87 131 csv->eol_type = len == 0 ? EOL_TYPE_UNDEF
600 81 6 : len == 1 && *cp == CH_NL ? EOL_TYPE_NL
77 4 : len == 1 && *cp == CH_NL ? EOL_TYPE_NL
601 77 6 : len == 1 && *cp == CH_CR ? EOL_TYPE_CR
2 75 : len == 1 && *cp == CH_CR ? EOL_TYPE_CR
602 4 4 : len == 2 && *cp == CH_CR
4 0 : len == 2 && *cp == CH_CR
603 4 0 && cp[1] == CH_NL ? EOL_TYPE_CRNL
614 8 3 if (*cp) {
617 1 7 if (SvUTF8 (val))
628 1 1 if (*cp) {
639 1 0 if (cp && len) {
0 1 if (cp && len) {
705 1 0 if (csv->sep_len > 1)
708 1 0 if (csv->quo_len > 1)
710 0 1 if (csv->types_len)
715 1 0 if (csv->bptr)
717 1 0 if (csv->tmp && SvPOK (csv->tmp)) {
0 1 if (csv->tmp && SvPOK (csv->tmp)) {
721 1 0 if (csv->cache)
734 1 1 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp) {
0 1 unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp) {
767 26838 898 if ((svp = hv_fetchs (self, "_CACHE", FALSE)) && *svp) {
26838 0 if ((svp = hv_fetchs (self, "_CACHE", FALSE)) && *svp) {
780 898 0 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
898 0 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
898 0 if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
782 225 673 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
225 0 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
225 0 if ((svp = hv_fetchs (self, "sep", FALSE)) && *svp && SvOK (*svp)) {
784 1 224 if (len > MAX_ATTR_LEN) croak ("INI - SEP too long"); /* 1006 */
786 5 219 if (len > 1)
791 897 0 if ((svp = hv_fetchs (self, "quote_char", FALSE)) && *svp) {
897 0 if ((svp = hv_fetchs (self, "quote_char", FALSE)) && *svp) {
792 894 3 if (SvOK (*svp)) {
794 894 0 CH_QUOTE = len ? *ptr : (char)0;
799 7 890 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
7 0 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
6 1 if ((svp = hv_fetchs (self, "quote", FALSE)) && *svp && SvOK (*svp)) {
801 1 5 if (len > MAX_ATTR_LEN) croak ("INI - QUOTE too long"); /* 1007 */
803 4 1 if (len > 1)
808 896 0 if ((svp = hv_fetchs (self, "escape_char", FALSE)) && *svp) {
896 0 if ((svp = hv_fetchs (self, "escape_char", FALSE)) && *svp) {
809 890 6 if (SvOK (*svp)) {
811 888 2 csv->escape_char = len ? *ptr : (char)0;
817 896 0 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
896 0 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
891 5 if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
819 1 890 if (len > MAX_ATTR_LEN) croak ("INI - EOL too long"); /* 1005 */
822 100 790 if (len == 1 && *eol == CH_CR) {
42 58 if (len == 1 && *eol == CH_CR) {
826 58 790 else if (len == 1 && *eol == CH_NL)
54 4 else if (len == 1 && *eol == CH_NL)
828 55 739 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)
833 895 0 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
895 0 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
2 893 if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
838 0 2 if (SvUTF8 (*svp))
846 895 0 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp)) {
895 0 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp)) {
21 874 if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp)) {
855 1 894 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)) {
861 12 883 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))
863 895 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
895 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
0 895 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
0 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
325 570 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
325 0 if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
865 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))
867 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))
871 895 0 csv->binary = bool_opt ("binary");
895 0 csv->binary = bool_opt ("binary");
872 895 0 csv->decode_utf8 = bool_opt ("decode_utf8");
895 0 csv->decode_utf8 = bool_opt ("decode_utf8");
873 895 0 csv->always_quote = bool_opt ("always_quote");
895 0 csv->always_quote = bool_opt ("always_quote");
874 895 0 csv->strict = bool_opt ("strict");
895 0 csv->strict = bool_opt ("strict");
875 895 0 csv->strict_eol = num_opt ("strict_eol");
895 0 csv->strict_eol = num_opt ("strict_eol");
876 895 0 csv->quote_empty = bool_opt ("quote_empty");
895 0 csv->quote_empty = bool_opt ("quote_empty");
877 895 0 csv->quote_space = bool_opt_def ("quote_space", 1);
895 0 csv->quote_space = bool_opt_def ("quote_space", 1);
878 895 0 csv->escape_null = bool_opt_def ("escape_null", 1);
895 0 csv->escape_null = bool_opt_def ("escape_null", 1);
879 895 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
895 0 csv->quote_binary = bool_opt_def ("quote_binary", 1);
880 895 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
895 0 csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
881 895 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
895 0 csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
882 895 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
895 0 csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
883 895 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
895 0 csv->allow_whitespace = bool_opt ("allow_whitespace");
884 895 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
895 0 csv->blank_is_undef = bool_opt ("blank_is_undef");
885 895 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
895 0 csv->empty_is_undef = bool_opt ("empty_is_undef");
886 895 0 csv->verbatim = bool_opt ("verbatim");
895 0 csv->verbatim = bool_opt ("verbatim");
888 895 0 csv->auto_diag = num_opt ("auto_diag");
895 0 csv->auto_diag = num_opt ("auto_diag");
889 895 0 csv->diag_verbose = num_opt ("diag_verbose");
895 0 csv->diag_verbose = num_opt ("diag_verbose");
890 895 0 csv->keep_meta_info = num_opt ("keep_meta_info");
895 0 csv->keep_meta_info = num_opt ("keep_meta_info");
891 895 0 csv->skip_empty_rows = num_opt ("skip_empty_rows");
895 0 csv->skip_empty_rows = num_opt ("skip_empty_rows");
892 895 0 csv->formula = num_opt ("formula");
895 0 csv->formula = num_opt ("formula");
894 8 887 unless (csv->escape_char) csv->escape_null = 0;
910 27669 64 csv->first_safe_char = csv->quote_space ? 0x21 : 0x20;
912 112 27621 if (csv->is_bound) {
913 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))
921 894 452 ? csv->verbatim || csv->eol_len >= 2
923 362 532 : csv->eol[0] == CH_CR || csv->eol[0] == CH_NL
925 52 310 : 1
926 1353 26380 : 0;
1346 7 : 0;
927 3030 24703 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)
933 51 27682 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))
935 27 27706 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))
938 67 27666 if (csv->strict
939 27 40 && !csv->strict_n
940 27 0 && (svp = hv_fetchs (self, "_COLUMN_NAMES", FALSE))
941 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))
950 939903 1399 if (csv->useIO) {
953 0 939903 PUSHMARK (sp);
954 0 939903 EXTEND (sp, 2);
956 939649 254 if (csv->utf8) {
962 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) {
967 750862 939649 for (j = 0; j < keep; j++)
975 939903 0 if (result) {
977 1 939902 unless (result)
986 939674 1628 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
987 25 0 && SvROK (dst) && is_utf8_sv (SvRV (dst)))
24 1 && SvROK (dst) && is_utf8_sv (SvRV (dst)))
1007 3 163 if (i >= csv->is_bound) {
1012 163 0 if (sv && SvROK (sv)) {
163 0 if (sv && SvROK (sv)) {
1016 163 0 if (sv && SvROK (sv)) {
163 0 if (sv && SvROK (sv)) {
1018 14 149 if (keep)
1021 148 1 unless (SvREADONLY (sv)) {
1034 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);
1042 3 34 if (fa == 1) die ("Formulas are forbidden\n");
1043 3 31 if (fa == 2) croak ("Formulas are forbidden\n");
1045 6 25 if (fa == 3) {
1051 3 3 if (csv->recno) (void)sprintf (rec, " in record %lu", csv->recno + 1);
1055 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)) {
1057 1 0 if (avp && av_len (avp) >= (f - 1)) {
1 0 if (avp && av_len (avp) >= (f - 1)) {
1059 1 0 if (fnm && *fnm && SvOK (*fnm))
1 0 if (fnm && *fnm && SvOK (*fnm))
1 0 if (fnm && *fnm && SvOK (*fnm))
1068 4 21 if (len) *len = 0;
1070 5 20 if (fa == 4) {
1071 3 2 unless (SvREADONLY (sv)) SvSetEmpty (sv);
1075 5 15 if (fa == 5) {
1076 3 2 unless (SvREADONLY (sv)) SvSetUndef (sv);
1080 15 0 if (fa == 6) {
1083 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)) {
1087 15 0 DEFSV = sv;
1088 0 15 PUSHMARK (SP);
1092 15 0 if (result)
1097 0 15 return len ? SvPV (sv, *len) : SvPV_nolen (sv);
1187 6 21669 if (n < 0 && csv->is_bound) {
5 1 if (n < 0 && csv->is_bound) {
1192 2 21673 if (kmi >= 10) {
1194 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)) {
1196 2 0 if (avp && av_len (avp) >= n)
2 0 if (avp && av_len (avp) >= n)
1201 53953 21664 for (i = 0; i <= n; i++) {
1206 32279 21674 if (i > 0) {
1207 0 32279 CSV_PUT (csv, dst, CH_SEP);
0 0 CSV_PUT (csv, dst, CH_SEP);
1208 10 32269 if (csv->sep_len) {
1210 20 10 for (x = 1; x < (int)csv->sep_len; x++)
1211 0 20 CSV_PUT (csv, dst, csv->sep[x]);
0 0 CSV_PUT (csv, dst, csv->sep[x]);
1215 14 53939 if (bound)
1219 53939 0 sv = svp && *svp ? *svp : NULL;
53939 0 sv = svp && *svp ? *svp : NULL;
1222 53953 0 if (sv && (SvOK (sv) || (
55 53898 if (sv && (SvOK (sv) || (
1223 0 55 (SvGMAGICAL (sv) && (mg_get (sv), 1) && SvOK (sv))))) {
0 0 (SvGMAGICAL (sv) && (mg_get (sv), 1) && SvOK (sv))))) {
1229 16 53882 if (*ptr == '=' && csv->formula) {
10 6 if (*ptr == '=' && csv->formula) {
1230 2 4 unless (ptr = _formula (csv, sv, &len, i))
1233 1412 52480 if (len == 0)
1234 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;
1237 20041 32439 if (SvUTF8 (sv)) {
1242 46857 5623 quoteMe = aq ? 1 : qm ? was_quoted (qm, i) : 0;
12 46845 quoteMe = aq ? 1 : qm ? was_quoted (qm, i) : 0;
1248 46852 5628 if (!quoteMe &&
1249 25887 20965 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
25272 615 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
25269 3 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
25269 21583 ( quoteMe = (!SvIOK (sv) && !SvNOK (sv) && CH_QUOTE))) {
1261 83960 2137 for (ptr2 = ptr, l = len; l; ++ptr2, --l) {
1272 83960 0 if ((CH_QUOTE && c == CH_QUOTE) ||
83652 308 if ((CH_QUOTE && c == CH_QUOTE) ||
1273 81649 2003 (CH_SEP && c == CH_SEP) ||
81498 151 (CH_SEP && c == CH_SEP) ||
1274 83497 4 (csv->escape_char && c == csv->escape_char) ||
83273 224 (csv->escape_char && c == csv->escape_char) ||
60820 22447 (csv->escape_char && c == csv->escape_char) ||
8 2 (csv->escape_char && c == csv->escape_char) ||
1275 83267 10 (csv->quote_binary ? (x >= 0x7f && x <= 0xa0) ||
40061 43206 (csv->quote_binary ? (x >= 0x7f && x <= 0xa0) ||
20040 20021 (csv->quote_binary ? (x >= 0x7f && x <= 0xa0) ||
1276 2426 60820 x < csv->first_safe_char
1277 10 0 : c == CH_NL || c == CH_CR ||
10 0 : c == CH_NL || c == CH_CR ||
1278 5 5 (csv->quote_space && (
3 2 (csv->quote_space && (
1279 0 3 c == CH_SPACE || c == CH_TAB)))) {
1290 29414 24478 if (quoteMe) {
1291 0 29414 CSV_PUT (csv, dst, CH_QUOTE);
0 0 CSV_PUT (csv, dst, CH_QUOTE);
1292 17 29397 if (csv->quo_len) {
1294 34 17 for (x = 1; x < (int)csv->quo_len; x++)
1295 0 34 CSV_PUT (csv, dst, csv->quo[x]);
0 0 CSV_PUT (csv, dst, csv->quo[x]);
1298 950361658 53885 while (len-- > 0) {
1302 786 950360872 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)) {
1305 0 7 unless (hv_store (csv->self, "_ERROR_INPUT", 12, sv, 0))
1310 950361642 9 if (CH_QUOTE && (byte)c == CH_QUOTE && (csv->quo_len == 0 ||
3225 950358417 if (CH_QUOTE && (byte)c == CH_QUOTE && (csv->quo_len == 0 ||
9 3216 if (CH_QUOTE && (byte)c == CH_QUOTE && (csv->quo_len == 0 ||
1311 1 8 memcmp (ptr, csv->quo +1, csv->quo_len - 1) == 0))
1314 2165 950356269 if (c == csv->escape_char && csv->escape_char)
2163 2 if (c == csv->escape_char && csv->escape_char)
1317 56 950356215 if (c == (char)0 && csv->escape_null) {
29 27 if (c == (char)0 && csv->escape_null) {
1321 5409 950356242 if (e && csv->escape_char)
5409 0 if (e && csv->escape_char)
1322 0 5409 CSV_PUT (csv, dst, csv->escape_char);
0 0 CSV_PUT (csv, dst, csv->escape_char);
1323 919632 949442019 CSV_PUT (csv, dst, c);
0 919632 CSV_PUT (csv, dst, c);
1325 29407 24478 if (quoteMe) {
1326 0 29407 CSV_PUT (csv, dst, CH_QUOTE);
0 0 CSV_PUT (csv, dst, CH_QUOTE);
1327 17 29390 if (csv->quo_len) {
1329 34 17 for (x = 1; x < (int)csv->quo_len; x++)
1330 0 34 CSV_PUT (csv, dst, csv->quo[x]);
0 0 CSV_PUT (csv, dst, csv->quo[x]);
1335 10 45 if (csv->undef_str) {
1339 3 7 if (csv->undef_flg) {
1344 8214 10 while (len--)
1345 8 8206 CSV_PUT (csv, dst, *ptr++);
0 8 CSV_PUT (csv, dst, *ptr++);
1349 241 21423 if (csv->eol_len) {
1353 439 241 while (len--)
1354 0 439 CSV_PUT (csv, dst, *ptr++);
0 0 CSV_PUT (csv, dst, *ptr++);
1356 21662 2 if (csv->used)
1386 326 0 if (csv->tmp) {
1388 326 0 if (hv_store (csv->self, "_ERROR_INPUT", 12, csv->tmp, 0))
1398 1525 3759 unless (csv->useIO)
1401 950 2809 if (csv->tmp && csv->eol_pos >= 0) {
348 602 if (csv->tmp && csv->eol_pos >= 0) {
1412 0 3411 PUSHMARK (sp);
1413 0 3411 EXTEND (sp, 1);
1419 3411 0 csv->tmp = result ? POPs : NULL;
1431 3411 0 if (csv->tmp && SvOK (csv->tmp)) {
2812 599 if (csv->tmp && SvOK (csv->tmp)) {
1436 358 2454 if (csv->eolx && csv->size >= csv->eol_len) {
358 0 if (csv->eolx && csv->size >= csv->eol_len) {
1438 1463 354 for (i = 1; i <= (int)csv->eol_len; i++) {
1439 4 1459 unless (csv->bptr[csv->size - i] == csv->eol[csv->eol_len - i]) {
1444 354 4 if (match) {
1449 351 3 unless (csv->verbatim)
1453 351 3 unless (csv->verbatim || csv->size)
6 345 unless (csv->verbatim || csv->size)
1457 70 2736 if (SvUTF8 (csv->tmp)) csv->utf8 = 1;
1458 2806 0 if (tmp_len)
1588 1745 0 unless (s && len) return;
0 1745 unless (s && len) return;
1589 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)
1638 187636 3837 while ((c = CSV_GET) != EOF) {
190689 784 while ((c = CSV_GET) != EOF) {
1640 23924 166765 NewField;
151 23773 NewField;
4 23920 NewField;
1652 12579 189682 if (is_SEP (c)) {
88 12491 if (is_SEP (c)) {
88 0 if (is_SEP (c)) {
30 58 if (is_SEP (c)) {
30 0 if (is_SEP (c)) {
1658 1307 11214 if (waitingForField) {
1662 1281 26 if (csv->blank_is_undef || csv->empty_is_undef)
24 1257 if (csv->blank_is_undef || csv->empty_is_undef)
1666 1307 0 unless (csv->is_bound)
1669 8 1299 if (csv->keep_meta_info && fflags)
8 0 if (csv->keep_meta_info && fflags)
1673 2194 9020 if (f & CSV_FLAGS_QUO) {
1677 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)
1683 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;
1687 188709 1031 if (is_QUOTE (c)) {
23076 165633 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)) {
1693 11021 12039 if (waitingForField) {
1702 11971 68 if (f & CSV_FLAGS_QUO) {
1709 10648 1323 int c2 = CSV_GET;
1711 4240 7731 if (csv->allow_whitespace) {
1715 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)) {
1716 1 89 if (csv->allow_loose_quotes &&
1717 0 1 !(csv->escape_char && c2 == csv->escape_char)) {
0 0 !(csv->escape_char && c2 == csv->escape_char)) {
1723 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);
1726 87 3 c2 = CSV_GET;
1730 9024 2947 if (is_SEP (c2)) {
15 9009 if (is_SEP (c2)) {
15 0 if (is_SEP (c2)) {
15 0 if (is_SEP (c2)) {
15 0 if (is_SEP (c2)) {
1734 8324 700 AV_PUSH;
0 8324 AV_PUSH;
0 0 AV_PUSH;
700 8324 AV_PUSH;
688 12 AV_PUSH;
0 688 AV_PUSH;
0 0 AV_PUSH;
3400 5612 AV_PUSH;
0 3400 AV_PUSH;
2161 6851 AV_PUSH;
2161 0 AV_PUSH;
2142 19 AV_PUSH;
906 1236 AV_PUSH;
0 9024 AV_PUSH;
9020 4 AV_PUSH;
45 8979 AV_PUSH;
45 0 AV_PUSH;
1738 2753 194 if (c2 == CH_NL || c2 == CH_EOLX) {
20 2733 if (c2 == CH_NL || c2 == CH_EOLX) {
1739 20 194 unsigned short eolt = EOL_TYPE (c2);
0 20 unsigned short eolt = EOL_TYPE (c2);
1747 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)
1748 4 2 ERROR_EOL;
2 4 ERROR_EOL;
2 0 ERROR_EOL;
1749 60 152 SET_EOL_TYPE (csv, eolt);
1751 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;
1762 2716 17 if (csv->escape_char && c == csv->escape_char) {
1636 1080 if (csv->escape_char && c == csv->escape_char) {
1765 25 1611 if (c2 == '0') {
1769 25 0 CSV_PUT_SV (0)
0 25 CSV_PUT_SV (0)
1773 1611 0 if (is_QUOTE (c2)) {
1060 551 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)) {
1777 1 1059 if (csv->utf8)
1779 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)
1783 3 548 if (csv->allow_loose_escapes && c2 != CH_CR) {
2 1 if (csv->allow_loose_escapes && c2 != CH_CR) {
1787 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);
1793 283 1363 if (c2 == CH_CR) {
1796 109 174 if (csv->eol_is_cr) {
1804 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;
1808 169 5 c3 = CSV_GET;
1810 142 32 if (c3 == CH_NL) { /* \r is not optional before EOLX! */
1818 85 57 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
40 45 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
0 40 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
1819 0 0 ERROR_EOL;
0 0 ERROR_EOL;
0 0 ERROR_EOL;
1820 68 74 SET_EOL_TYPE (csv, EOL_TYPE_CRNL);
1822 140 2 AV_PUSH;
0 140 AV_PUSH;
0 0 AV_PUSH;
2 140 AV_PUSH;
2 0 AV_PUSH;
0 2 AV_PUSH;
0 0 AV_PUSH;
5 137 AV_PUSH;
0 5 AV_PUSH;
70 72 AV_PUSH;
70 0 AV_PUSH;
40 30 AV_PUSH;
40 0 AV_PUSH;
0 142 AV_PUSH;
142 0 AV_PUSH;
0 142 AV_PUSH;
0 0 AV_PUSH;
1826 19 13 if (csv->useIO && csv->eol_len == 0) {
19 0 if (csv->useIO && csv->eol_len == 0) {
1827 8 11 if (c3 == CH_CR) { /* \r followed by an empty line */
1835 6 2 if (csv->strict_eol && csv->eol_type) {
2 4 if (csv->strict_eol && csv->eol_type) {
1836 2 0 unless (csv->eol_type == EOL_TYPE_CR)
1837 0 2 ERROR_EOL;
0 2 ERROR_EOL;
0 0 ERROR_EOL;
1840 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;
1845 6 0 if (f & CSV_FLAGS_QUO) f ^= CSV_FLAGS_QUO;
1850 11 0 if (!is_csv_binary (c3)) {
0 11 if (!is_csv_binary (c3)) {
0 0 if (!is_csv_binary (c3)) {
1859 6 5 if (csv->strict_eol && csv->eol_type) {
2 4 if (csv->strict_eol && csv->eol_type) {
1860 2 0 unless (csv->eol_type == EOL_TYPE_CR)
1861 0 2 ERROR_EOL;
0 2 ERROR_EOL;
0 0 ERROR_EOL;
1868 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;
1873 12 1 ParseError (csv, quoesc ? 2023 : 2010, csv->used - 2);
1877 1306 57 if (c2 == EOF) {
1881 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;
1885 12 45 if (csv->allow_loose_quotes && !quoesc) {
10 2 if (csv->allow_loose_quotes && !quoesc) {
1889 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);
1897 39 8 if (quoesc) {
1899 39 0 ERROR_INSIDE_QUOTES (2023);
1902 8 0 ERROR_INSIDE_QUOTES (2011);
1906 16 52 if (csv->allow_loose_quotes) { /* 1,foo "boo" d'uh,1 */
1908 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);
1911 51 1 ERROR_INSIDE_FIELD (2034);
1914 4653 162027 if (c == csv->escape_char && csv->escape_char) {
4651 2 if (c == csv->escape_char && csv->escape_char) {
1921 33 4618 if (waitingForField) {
1923 3 30 if (csv->allow_unquoted_escape) {
1927 2 1 int c2 = CSV_GET;
1931 1 2 if (c2 == EOF) {
1933 1 0 ERROR_INSIDE_FIELD (2035);
1936 1 1 if (c2 == '0')
1937 1 0 CSV_PUT_SV (0)
0 1 CSV_PUT_SV (0)
1939 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) ||
1940 0 0 c2 == csv->escape_char || csv->allow_loose_escapes) {
0 0 c2 == csv->escape_char || csv->allow_loose_escapes) {
1941 0 1 if (csv->utf8)
1943 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)
1947 0 0 ERROR_INSIDE_QUOTES (2025);
1952 4610 8 if (f & CSV_FLAGS_QUO) {
1953 4607 3 int c2 = CSV_GET;
1955 3 4607 if (c2 == EOF) {
1957 3 0 ERROR_INSIDE_QUOTES (2024);
1960 2 4605 if (c2 == '0')
1961 2 0 CSV_PUT_SV (0)
0 2 CSV_PUT_SV (0)
1963 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) ||
1964 28 2165 c2 == csv->escape_char || csv->allow_loose_escapes) {
2 26 c2 == csv->escape_char || csv->allow_loose_escapes) {
1965 1 4578 if (csv->utf8)
1967 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)
1971 26 0 ERROR_INSIDE_QUOTES (2025);
1975 8 0 if (sv) {
1976 4 4 int c2 = CSV_GET;
1978 4 4 if (c2 == EOF) {
1980 4 0 ERROR_INSIDE_FIELD (2035);
1983 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);
1986 0 0 ERROR_INSIDE_FIELD (2036); /* uncoverable statement I think there's no way to get here */
1989 1949 160080 if (c == CH_NL || is_EOL (c)) {
334 159746 if (c == CH_NL || is_EOL (c)) {
1992 833 2089 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 847 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);
1999 2172 750 unless (f & CSV_FLAGS_QUO) {
2000 686 1486 if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
540 146 if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
37 503 if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
2001 12 25 ERROR_EOL;
5 32 ERROR_EOL;
5 0 ERROR_EOL;
2002 265 1902 SET_EOL_TYPE (csv, eolt);
2005 350 2567 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) {
2006 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;
2010 260 2566 if (waitingForField) {
2014 252 8 if (csv->blank_is_undef || csv->empty_is_undef)
8 244 if (csv->blank_is_undef || csv->empty_is_undef)
2018 260 0 unless (csv->is_bound)
2020 14 246 if (csv->keep_meta_info && fflags)
14 0 if (csv->keep_meta_info && fflags)
2025 750 1816 if (f & CSV_FLAGS_QUO) {
2030 19 731 unless (csv->binary)
2031 19 0 ERROR_INSIDE_QUOTES (2021);
2033 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);
2036 9 1807 if (csv->verbatim) {
2041 1 8 unless (csv->binary)
2042 1 0 ERROR_INSIDE_FIELD (2030);
2044 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);
2050 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 &&
2051 24 5 (csv->bptr[0] == 's' || csv->bptr[0] == 'S') &&
0 24 (csv->bptr[0] == 's' || csv->bptr[0] == 'S') &&
2052 0 5 (csv->bptr[1] == 'e' || csv->bptr[1] == 'E') &&
0 0 (csv->bptr[1] == 'e' || csv->bptr[1] == 'E') &&
2053 0 5 (csv->bptr[2] == 'p' || csv->bptr[2] == 'P') &&
0 0 (csv->bptr[2] == 'p' || csv->bptr[2] == 'P') &&
2054 5 0 csv->bptr[3] == '=') {
2057 4 1 if (lnu <= MAX_ATTR_LEN) {
2060 1 3 csv->sep_len = lnu == 1 ? 0 : lnu;
2068 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;
2073 1329 158417 if (c == CH_CR && !(csv->verbatim)) {
1326 3 if (c == CH_CR && !(csv->verbatim)) {
2080 166 1160 if (waitingForField) {
2083 46 120 if (csv->eol_is_cr) {
2091 115 5 c2 = CSV_GET;
2093 5 115 if (c2 == EOF) {
2103 0 5 unless (seenSomething)
2108 94 21 if (c2 == CH_NL) { /* \r is not optional before EOLX! */
2112 19 75 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
11 8 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
0 11 if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
2113 0 0 ERROR_EOL;
0 0 ERROR_EOL;
0 0 ERROR_EOL;
2114 15 79 SET_EOL_TYPE (csv, EOL_TYPE_CRNL);
2125 16 5 if (csv->useIO && csv->eol_len == 0) {
16 0 if (csv->useIO && csv->eol_len == 0) {
2126 0 16 if (c2 == CH_CR) { /* \r followed by an empty line */
2130 0 0 if (csv->strict_eol && csv->eol_type) {
0 0 if (csv->strict_eol && csv->eol_type) {
2131 0 0 unless (csv->eol_type == EOL_TYPE_CR)
2132 0 0 ERROR_EOL;
0 0 ERROR_EOL;
0 0 ERROR_EOL;
2142 13 3 if (!is_csv_binary (c2)) {
0 13 if (!is_csv_binary (c2)) {
0 3 if (!is_csv_binary (c2)) {
2147 9 4 if (csv->strict_eol && csv->eol_type) {
4 5 if (csv->strict_eol && csv->eol_type) {
2148 4 0 unless (csv->eol_type == EOL_TYPE_CR)
2149 0 4 ERROR_EOL;
0 4 ERROR_EOL;
0 0 ERROR_EOL;
2155 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) {
2156 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;
2159 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;
2168 8 0 ERROR_INSIDE_FIELD (2031);
2171 641 519 if (f & CSV_FLAGS_QUO) {
2176 70 571 unless (csv->binary)
2177 70 0 ERROR_INSIDE_QUOTES (2022);
2179 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);
2184 192 327 if (csv->eol_is_cr) {
2191 322 5 c2 = CSV_GET;
2193 293 34 if (c2 == CH_NL) { /* \r is not optional before EOLX! */
2197 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)
2198 1 9 ERROR_EOL;
0 10 ERROR_EOL;
0 0 ERROR_EOL;
2199 103 190 SET_EOL_TYPE (csv, EOL_TYPE_CRNL);
2209 29 5 if (csv->useIO && csv->eol_len == 0) {
29 0 if (csv->useIO && csv->eol_len == 0) {
2210 14 15 if (!is_csv_binary (c2)
0 14 if (!is_csv_binary (c2)
15 0 if (!is_csv_binary (c2)
2215 9 6 || c2 == CH_CR) {
2223 12 11 if (csv->strict_eol && csv->eol_type) {
4 8 if (csv->strict_eol && csv->eol_type) {
2224 4 0 unless (csv->eol_type == EOL_TYPE_CR)
2225 0 4 ERROR_EOL;
0 4 ERROR_EOL;
0 0 ERROR_EOL;
2231 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) {
2232 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;
2235 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;
2243 11 0 ERROR_INSIDE_FIELD (2032);
2253 3646 154774 if (csv->eolx && c == CH_EOL &&
8 3638 if (csv->eolx && c == CH_EOL &&
2254 8 0 csv->size - csv->used >= (STRLEN)csv->eol_len - 1 &&
2255 8 0 !memcmp (csv->bptr + csv->used, csv->eol + 1, csv->eol_len - 1) &&
2256 8 0 (csv->used += csv->eol_len - 1)) {
2264 11493 146919 if (waitingForField) {
2265 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) {
2273 18 17 if (cl == 1 || (
2274 18 0 (csv->size - csv->used >= cl - 1 &&
2275 18 0 !memcmp (csv->bptr + csv->used, csv->comment_str + 1, cl - 1) &&
2276 18 0 (csv->used += cl - 1)))) {
2278 6 29 csv->fld_idx = csv->strict_n ? csv->strict_n - 1 : 0;
2279 0 35 c = CSV_GET;
2284 1 34 unless (csv->useIO)
2286 4 31 if (c == EOF)
2292 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)) {
2294 320 1 c = CSV_GET;
2298 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));
2299 1 210 if (c == EOF)
2313 111602 35317 if (f & CSV_FLAGS_QUO) {
2314 111154 448 if (is_csv_binary (c)) {
3021 108133 if (is_csv_binary (c)) {
3454 15 if (is_csv_binary (c)) {
2316 31 3423 unless (csv->binary || csv->utf8)
5 26 unless (csv->binary || csv->utf8)
2317 5 0 ERROR_INSIDE_QUOTES (2026);
2319 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);
2322 35279 38 if (is_csv_binary (c)) {
427 34852 if (is_csv_binary (c)) {
453 12 if (is_csv_binary (c)) {
2323 413 40 if (csv->useIO && c == EOF)
3 410 if (csv->useIO && c == EOF)
2326 9 441 unless (csv->binary || csv->utf8)
9 0 unless (csv->binary || csv->utf8)
2327 9 0 ERROR_INSIDE_FIELD (2037);
2329 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);
2334 119 165245 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)
2338 418 383 if (waitingForField) {
2339 27 391 unless (csv->useIO) {
2340 1 26 if (csv->has_ahead == 214)
2344 35 382 if (seenSomething) {
2345 34 1 NewField;
1 33 NewField;
0 34 NewField;
2346 31 4 if (csv->blank_is_undef || csv->empty_is_undef)
4 27 if (csv->blank_is_undef || csv->empty_is_undef)
2350 34 1 unless (csv->is_bound)
2352 3 32 if (csv->keep_meta_info && fflags)
3 0 if (csv->keep_meta_info && fflags)
2361 24 359 if (f & CSV_FLAGS_QUO)
2362 24 0 ERROR_INSIDE_QUOTES (2027);
2364 359 0 if (sv) {
2365 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;
2367 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)
2380 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))
2385 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))
2391 0 154 PUSHMARK (SP);
2392 0 154 mXPUSHs (newRV_inc ((SV *)hv));
2393 0 154 mXPUSHs (newRV_inc ((SV *)av));
2397 154 0 if (res) {
2399 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)) {
2400 65 0 if (strcmp (SvPV_nolen (rv), "skip") == 0)
2405 154 0 FREETMPS;
2417 4573 405 if (csv.eolx || csv.eol_is_cr) {
489 4084 if (csv.eolx || csv.eol_is_cr) {
2427 3041 1937 if ((csv.useIO = useIO)) {
2430 232 2809 if ((ahead = csv.has_ahead)) {
2432 232 0 if ((svp = hv_fetchs (hv, "_AHEAD", FALSE)) && *svp) {
232 0 if ((svp = hv_fetchs (hv, "_AHEAD", FALSE)) && *svp) {
2435 0 232 if (pos && SvIV (pos) > (IV)csv.size)
0 0 if (pos && SvIV (pos) > (IV)csv.size)
2445 227 4751 if (csv.has_error_input) {
2454 60 4907 if (csv.strict) {
2455 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);
2461 56 4 if (nf && !csv.strict_n) csv.strict_n = (short)nf;
20 36 if (nf && !csv.strict_n) csv.strict_n = (short)nf;
2462 60 0 if (csv.strict_n > 0 && nf != (STRLEN)csv.strict_n) {
25 35 if (csv.strict_n > 0 && nf != (STRLEN)csv.strict_n) {
2463 18 7 unless (csv.useIO & useIO_EOF) {
2467 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))
2470 20 5 if (last_error) /* an error callback can reset and accept */
2475 3033 1934 if (csv.useIO) {
2476 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) {
2482 599 2340 if (csv.useIO & useIO_EOF)
2488 1918 1115 if (avf) {
2489 11 1907 if (csv.keep_meta_info)
2500 1934 0 if (svp && *svp)
1934 0 if (svp && *svp)
2505 4266 701 if (result && csv.types) {
2 4264 if (result && csv.types) {
2510 6 2 for (i = 0; i <= len && i <= csv.types_len; i++) {
6 0 for (i = 0; i <= len && i <= csv.types_len; i++) {
2511 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)) {
2553 3470 382 if (state && csv.has_hooks & HOOK_AFTER_PARSE)
5 3465 if (state && csv.has_hooks & HOOK_AFTER_PARSE)
2555 382 3470 return (state || !last_error);
2 380 return (state || !last_error);
2561 253 84 while (av_len (av) >= 0)
2574 56 301 if (SvOK (off)) {
2576 12 44 if (skip < 0) {
2581 44 313 if (SvOK (len))
2584 796 319 while (c_xsParse (csv, hv, row, NULL, io, 1)) {
2588 20 776 if (skip > 0) {
2594 12 764 if (n++ >= tail) {
2599 140 636 if (csv.has_hooks & HOOK_AFTER_PARSE) {
2600 64 76 unless (hook (aTHX_ hv, "after_parse", row)) {
2607 52 660 if (n >= length && skip >= 0)
32 20 if (n >= length && skip >= 0)
2612 8 351 while (n > length) {
2631 251 21424 if (*csv.eol)
2634 20277 1398 if (useIO && csv.has_hooks & HOOK_BEFORE_PRINT)
9 20268 if (useIO && csv.has_hooks & HOOK_BEFORE_PRINT)
2640 21663 8 if (result && !useIO && csv.utf8)
1393 20270 if (result && !useIO && csv.utf8)
25 1368 if (result && !useIO && csv.utf8)
2661 3095 0 if (SvOK (self) && SvROK (self)) {
1048 2047 if (SvOK (self) && SvROK (self)) {
2662 1048 0 CSV_XS_SELF;
1048 0 CSV_XS_SELF;
1048 0 CSV_XS_SELF;
0 1048 CSV_XS_SELF;
2671 2094 1001 if (xse && SvPOK (line)) {
1016 1078 if (xse && SvPOK (line)) {
2683 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) {
2686 3 1 if (SvOK (*sv))
2704 1398 0 CSV_XS_SELF;
1398 0 CSV_XS_SELF;
1398 0 CSV_XS_SELF;
0 1398 CSV_XS_SELF;
2706 1393 1 ST (0) = xsCombine (self, hv, av, dst, useIO) ? &PL_sv_yes : &PL_sv_undef;
2719 1937 0 CSV_XS_SELF;
1937 0 CSV_XS_SELF;
1937 0 CSV_XS_SELF;
0 1937 CSV_XS_SELF;
2724 1729 205 PUT_RETURN (r ? &PL_sv_yes : &PL_sv_no);
2735 20282 0 CSV_XS_SELF;
20282 0 CSV_XS_SELF;
20282 0 CSV_XS_SELF;
0 20282 CSV_XS_SELF;
2736 5 20277 if (fields == &PL_sv_undef)
2739 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))
2746 20270 7 PUT_RETURN (r ? &PL_sv_yes : &PL_sv_no);
2758 1923 0 CSV_XS_SELF;
1923 0 CSV_XS_SELF;
1923 0 CSV_XS_SELF;
0 1923 CSV_XS_SELF;
2762 1743 175 PUT_RETURN (r ? sv_2mortal (newRV_noinc ((SV *)av)) : undef);
2772 357 0 CSV_XS_SELF;
357 0 CSV_XS_SELF;
357 0 CSV_XS_SELF;
0 357 CSV_XS_SELF;
2786 32 0 CSV_XS_SELF;
32 0 CSV_XS_SELF;
32 0 CSV_XS_SELF;
0 32 CSV_XS_SELF;
2789 21 11 if (eol)
2803 23356 0 CSV_XS_SELF;
23356 0 CSV_XS_SELF;
23356 0 CSV_XS_SELF;
0 23356 CSV_XS_SELF;
2814 2 0 CSV_XS_SELF;
2 0 CSV_XS_SELF;
2 0 CSV_XS_SELF;
0 2 CSV_XS_SELF;