| line |
true |
false |
branch |
|
425
|
76974 |
995 |
while (xs_errors[i].xs_errno && xs_errors[i].xs_errno != xse) i++;
|
|
|
74160 |
2814 |
while (xs_errors[i].xs_errno && xs_errors[i].xs_errno != xse) i++;
|
|
426
|
3809 |
0 |
if ((err = newSVpv (xs_errors[i].xs_errstr, 0))) {
|
|
427
|
3809 |
0 |
(void)SvUPGRADE (err, SVt_PVIV);
|
|
445
|
6 |
1768 |
if (xse == 0) {
|
|
451
|
1774 |
0 |
if (line)
|
|
453
|
382 |
1392 |
if (xse == 2012) /* EOF */
|
|
455
|
343 |
1431 |
if (csv->auto_diag) {
|
|
456
|
343 |
0 |
unless (_is_hashref (pself))
|
|
|
0 |
343 |
unless (_is_hashref (pself))
|
|
|
0 |
0 |
unless (_is_hashref (pself))
|
|
|
181 |
162 |
unless (_is_hashref (pself))
|
|
|
0 |
181 |
unless (_is_hashref (pself))
|
|
459
|
0 |
343 |
PUSHMARK (SP);
|
|
460
|
0 |
343 |
XPUSHs (pself);
|
|
464
|
161 |
179 |
unless (pself == csv->pself)
|
|
475
|
32 |
0 |
unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
|
|
|
0 |
32 |
unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
|
|
479
|
0 |
32 |
if (csvs->eol_type == EOL_TYPE_NL) return "\n";
|
|
480
|
0 |
32 |
if (csvs->eol_type == EOL_TYPE_CR) return "\r";
|
|
481
|
21 |
11 |
if (csvs->eol_type == EOL_TYPE_CRNL) return "\r\n";
|
|
482
|
0 |
11 |
if (csvs->eol_type == EOL_TYPE_OTHER) return (char *)(csvs->eol);
|
|
499
|
22585 |
769 |
unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
|
|
|
0 |
22585 |
unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp)
|
|
505
|
16789 |
5796 |
if (SvPOK (val))
|
|
507
|
5784 |
16801 |
if (SvIOK (val))
|
|
509
|
0 |
16801 |
else if (SvNOK (val)) /* Needed for 5.6.x but safe for 5.8.x+ */
|
|
563
|
3223 |
0 |
csv->sep_len = len == 1 ? 0 : len;
|
|
568
|
3377 |
0 |
csv->quo_len = len == 1 ? 0 : len;
|
|
574
|
87 |
131 |
csv->eol_type = len == 0 ? EOL_TYPE_UNDEF
|
|
575
|
81 |
6 |
: len == 1 && *cp == CH_NL ? EOL_TYPE_NL
|
|
|
77 |
4 |
: len == 1 && *cp == CH_NL ? EOL_TYPE_NL
|
|
576
|
77 |
6 |
: len == 1 && *cp == CH_CR ? EOL_TYPE_CR
|
|
|
2 |
75 |
: len == 1 && *cp == CH_CR ? EOL_TYPE_CR
|
|
577
|
4 |
4 |
: len == 2 && *cp == CH_CR
|
|
|
4 |
0 |
: len == 2 && *cp == CH_CR
|
|
578
|
4 |
0 |
&& cp[1] == CH_NL ? EOL_TYPE_CRNL
|
|
589
|
8 |
3 |
if (*cp) {
|
|
591
|
1 |
7 |
if (SvUTF8 (val))
|
|
601
|
1 |
1 |
csv->comment_str = *cp ? (byte *)cp : NULL;
|
|
605
|
1 |
0 |
if (cp && len) {
|
|
|
0 |
1 |
if (cp && len) {
|
|
669
|
1 |
0 |
if (csv->sep_len > 1)
|
|
672
|
1 |
0 |
if (csv->quo_len > 1)
|
|
674
|
0 |
1 |
if (csv->types_len)
|
|
679
|
1 |
0 |
if (csv->bptr)
|
|
681
|
1 |
0 |
if (csv->tmp && SvPOK (csv->tmp)) {
|
|
|
0 |
1 |
if (csv->tmp && SvPOK (csv->tmp)) {
|
|
685
|
1 |
0 |
if (csv->cache)
|
|
698
|
1 |
1 |
unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp) {
|
|
|
0 |
1 |
unless ((svp = hv_fetchs (hv, "_CACHE", FALSE)) && *svp) {
|
|
731
|
26834 |
892 |
if ((svp = hv_fetchs (self, "_CACHE", FALSE)) && *svp) {
|
|
|
26834 |
0 |
if ((svp = hv_fetchs (self, "_CACHE", FALSE)) && *svp) {
|
|
744
|
892 |
0 |
if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
|
|
|
892 |
0 |
if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
|
|
|
892 |
0 |
if ((svp = hv_fetchs (self, "sep_char", FALSE)) && *svp && SvOK (*svp))
|
|
746
|
224 |
668 |
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)) {
|
|
749
|
5 |
219 |
if (len > 1)
|
|
754
|
892 |
0 |
if ((svp = hv_fetchs (self, "quote_char", FALSE)) && *svp) {
|
|
|
892 |
0 |
if ((svp = hv_fetchs (self, "quote_char", FALSE)) && *svp) {
|
|
755
|
889 |
3 |
if (SvOK (*svp)) {
|
|
757
|
889 |
0 |
CH_QUOTE = len ? *ptr : (char)0;
|
|
762
|
6 |
886 |
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)) {
|
|
765
|
4 |
1 |
if (len > 1)
|
|
770
|
892 |
0 |
if ((svp = hv_fetchs (self, "escape_char", FALSE)) && *svp) {
|
|
|
892 |
0 |
if ((svp = hv_fetchs (self, "escape_char", FALSE)) && *svp) {
|
|
771
|
886 |
6 |
if (SvOK (*svp)) {
|
|
773
|
884 |
2 |
csv->escape_char = len ? *ptr : (char)0;
|
|
779
|
892 |
0 |
if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
|
|
|
892 |
0 |
if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
|
|
|
887 |
5 |
if ((svp = hv_fetchs (self, "eol", FALSE)) && *svp && SvOK (*svp)) {
|
|
783
|
100 |
787 |
if (len == 1 && *eol == CH_CR) {
|
|
|
42 |
58 |
if (len == 1 && *eol == CH_CR) {
|
|
787
|
58 |
787 |
else if (len == 1 && *eol == CH_NL)
|
|
|
54 |
4 |
else if (len == 1 && *eol == CH_NL)
|
|
789
|
55 |
736 |
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)
|
|
794
|
892 |
0 |
if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
|
|
|
892 |
0 |
if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
|
|
|
1 |
891 |
if ((svp = hv_fetchs (self, "undef_str", FALSE)) && *svp && SvOK (*svp)) {
|
|
798
|
0 |
1 |
if (SvUTF8 (*svp))
|
|
804
|
892 |
0 |
if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
|
|
|
892 |
0 |
if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
|
|
|
21 |
871 |
if ((svp = hv_fetchs (self, "comment_str", FALSE)) && *svp && SvOK (*svp))
|
|
809
|
1 |
891 |
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)) {
|
|
814
|
12 |
880 |
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))
|
|
816
|
892 |
0 |
if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
|
|
|
892 |
0 |
if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
|
|
|
0 |
892 |
if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
|
|
|
0 |
0 |
if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
|
|
|
324 |
568 |
if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
|
|
|
324 |
0 |
if ((svp = hv_fetchs (self, "callbacks", FALSE)) && _is_hashref (*svp)) {
|
|
818
|
16 |
308 |
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))
|
|
820
|
3 |
321 |
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))
|
|
824
|
892 |
0 |
csv->binary = bool_opt ("binary");
|
|
|
892 |
0 |
csv->binary = bool_opt ("binary");
|
|
825
|
892 |
0 |
csv->decode_utf8 = bool_opt ("decode_utf8");
|
|
|
892 |
0 |
csv->decode_utf8 = bool_opt ("decode_utf8");
|
|
826
|
892 |
0 |
csv->always_quote = bool_opt ("always_quote");
|
|
|
892 |
0 |
csv->always_quote = bool_opt ("always_quote");
|
|
827
|
892 |
0 |
csv->strict = bool_opt ("strict");
|
|
|
892 |
0 |
csv->strict = bool_opt ("strict");
|
|
828
|
892 |
0 |
csv->strict_eol = num_opt ("strict_eol");
|
|
|
892 |
0 |
csv->strict_eol = num_opt ("strict_eol");
|
|
829
|
892 |
0 |
csv->quote_empty = bool_opt ("quote_empty");
|
|
|
892 |
0 |
csv->quote_empty = bool_opt ("quote_empty");
|
|
830
|
892 |
0 |
csv->quote_space = bool_opt_def ("quote_space", 1);
|
|
|
892 |
0 |
csv->quote_space = bool_opt_def ("quote_space", 1);
|
|
831
|
892 |
0 |
csv->escape_null = bool_opt_def ("escape_null", 1);
|
|
|
892 |
0 |
csv->escape_null = bool_opt_def ("escape_null", 1);
|
|
832
|
892 |
0 |
csv->quote_binary = bool_opt_def ("quote_binary", 1);
|
|
|
892 |
0 |
csv->quote_binary = bool_opt_def ("quote_binary", 1);
|
|
833
|
892 |
0 |
csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
|
|
|
892 |
0 |
csv->allow_loose_quotes = bool_opt ("allow_loose_quotes");
|
|
834
|
892 |
0 |
csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
|
|
|
892 |
0 |
csv->allow_loose_escapes = bool_opt ("allow_loose_escapes");
|
|
835
|
892 |
0 |
csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
|
|
|
892 |
0 |
csv->allow_unquoted_escape = bool_opt ("allow_unquoted_escape");
|
|
836
|
892 |
0 |
csv->allow_whitespace = bool_opt ("allow_whitespace");
|
|
|
892 |
0 |
csv->allow_whitespace = bool_opt ("allow_whitespace");
|
|
837
|
892 |
0 |
csv->blank_is_undef = bool_opt ("blank_is_undef");
|
|
|
892 |
0 |
csv->blank_is_undef = bool_opt ("blank_is_undef");
|
|
838
|
892 |
0 |
csv->empty_is_undef = bool_opt ("empty_is_undef");
|
|
|
892 |
0 |
csv->empty_is_undef = bool_opt ("empty_is_undef");
|
|
839
|
892 |
0 |
csv->verbatim = bool_opt ("verbatim");
|
|
|
892 |
0 |
csv->verbatim = bool_opt ("verbatim");
|
|
841
|
892 |
0 |
csv->auto_diag = num_opt ("auto_diag");
|
|
|
892 |
0 |
csv->auto_diag = num_opt ("auto_diag");
|
|
842
|
892 |
0 |
csv->diag_verbose = num_opt ("diag_verbose");
|
|
|
892 |
0 |
csv->diag_verbose = num_opt ("diag_verbose");
|
|
843
|
892 |
0 |
csv->keep_meta_info = num_opt ("keep_meta_info");
|
|
|
892 |
0 |
csv->keep_meta_info = num_opt ("keep_meta_info");
|
|
844
|
892 |
0 |
csv->skip_empty_rows = num_opt ("skip_empty_rows");
|
|
|
892 |
0 |
csv->skip_empty_rows = num_opt ("skip_empty_rows");
|
|
845
|
892 |
0 |
csv->formula = num_opt ("formula");
|
|
|
892 |
0 |
csv->formula = num_opt ("formula");
|
|
847
|
8 |
884 |
unless (csv->escape_char) csv->escape_null = 0;
|
|
863
|
27662 |
64 |
csv->first_safe_char = csv->quote_space ? 0x21 : 0x20;
|
|
865
|
112 |
27614 |
if (csv->is_bound) {
|
|
866
|
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))
|
|
874
|
894 |
452 |
? csv->verbatim || csv->eol_len >= 2
|
|
876
|
362 |
532 |
: csv->eol[0] == CH_CR || csv->eol[0] == CH_NL
|
|
878
|
52 |
310 |
: 1
|
|
879
|
1353 |
26373 |
: 0;
|
|
|
1346 |
7 |
: 0;
|
|
880
|
3027 |
24699 |
if (csv->eol_type > 0 && csv->strict_eol > 0 && !*csv->eol)
|
|
|
906 |
2121 |
if (csv->eol_type > 0 && csv->strict_eol > 0 && !*csv->eol)
|
|
|
747 |
159 |
if (csv->eol_type > 0 && csv->strict_eol > 0 && !*csv->eol)
|
|
886
|
51 |
27675 |
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))
|
|
888
|
27 |
27699 |
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))
|
|
891
|
67 |
27659 |
if (csv->strict
|
|
892
|
27 |
40 |
&& !csv->strict_n
|
|
893
|
27 |
0 |
&& (svp = hv_fetchs (self, "_COLUMN_NAMES", FALSE))
|
|
894
|
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))
|
|
903
|
939903 |
1389 |
if (csv->useIO) {
|
|
906
|
0 |
939903 |
PUSHMARK (sp);
|
|
907
|
0 |
939903 |
EXTEND (sp, 2);
|
|
909
|
939649 |
254 |
if (csv->utf8) {
|
|
915
|
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) {
|
|
920
|
750862 |
939649 |
for (j = 0; j < keep; j++)
|
|
928
|
939903 |
0 |
if (result) {
|
|
930
|
1 |
939902 |
unless (result)
|
|
939
|
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
|
|
940
|
25 |
0 |
&& SvROK (dst) && is_utf8_sv (SvRV (dst)))
|
|
|
24 |
1 |
&& SvROK (dst) && is_utf8_sv (SvRV (dst)))
|
|
960
|
3 |
163 |
if (i >= csv->is_bound) {
|
|
965
|
163 |
0 |
if (sv && SvROK (sv)) {
|
|
|
163 |
0 |
if (sv && SvROK (sv)) {
|
|
969
|
163 |
0 |
if (sv && SvROK (sv)) {
|
|
|
163 |
0 |
if (sv && SvROK (sv)) {
|
|
971
|
14 |
149 |
if (keep)
|
|
974
|
148 |
1 |
unless (SvREADONLY (sv)) {
|
|
987
|
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);
|
|
995
|
3 |
34 |
if (fa == 1) die ("Formulas are forbidden\n");
|
|
996
|
3 |
31 |
if (fa == 2) croak ("Formulas are forbidden\n");
|
|
998
|
6 |
25 |
if (fa == 3) {
|
|
1004
|
3 |
3 |
if (csv->recno) (void)sprintf (rec, " in record %lu", csv->recno + 1);
|
|
1008
|
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)) {
|
|
1010
|
1 |
0 |
if (avp && av_len (avp) >= (f - 1)) {
|
|
|
1 |
0 |
if (avp && av_len (avp) >= (f - 1)) {
|
|
1012
|
1 |
0 |
if (fnm && *fnm && SvOK (*fnm))
|
|
|
1 |
0 |
if (fnm && *fnm && SvOK (*fnm))
|
|
|
1 |
0 |
if (fnm && *fnm && SvOK (*fnm))
|
|
1021
|
4 |
21 |
if (len) *len = 0;
|
|
1023
|
5 |
20 |
if (fa == 4) {
|
|
1024
|
3 |
2 |
unless (SvREADONLY (sv)) SvSetEmpty (sv);
|
|
1028
|
5 |
15 |
if (fa == 5) {
|
|
1029
|
3 |
2 |
unless (SvREADONLY (sv)) SvSetUndef (sv);
|
|
1033
|
15 |
0 |
if (fa == 6) {
|
|
1036
|
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)) {
|
|
1040
|
15 |
0 |
DEFSV = sv;
|
|
1041
|
0 |
15 |
PUSHMARK (SP);
|
|
1045
|
15 |
0 |
if (result)
|
|
1050
|
0 |
15 |
return len ? SvPV (sv, *len) : SvPV_nolen (sv);
|
|
1140
|
6 |
21667 |
if (n < 0 && csv->is_bound) {
|
|
|
5 |
1 |
if (n < 0 && csv->is_bound) {
|
|
1145
|
2 |
21671 |
if (kmi >= 10) {
|
|
1147
|
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)) {
|
|
1149
|
2 |
0 |
if (avp && av_len (avp) >= n)
|
|
|
2 |
0 |
if (avp && av_len (avp) >= n)
|
|
1154
|
53947 |
21662 |
for (i = 0; i <= n; i++) {
|
|
1159
|
32275 |
21672 |
if (i > 0) {
|
|
1160
|
0 |
32275 |
CSV_PUT (csv, dst, CH_SEP);
|
|
|
0 |
0 |
CSV_PUT (csv, dst, CH_SEP);
|
|
1161
|
10 |
32265 |
if (csv->sep_len) {
|
|
1163
|
20 |
10 |
for (x = 1; x < (int)csv->sep_len; x++)
|
|
1164
|
0 |
20 |
CSV_PUT (csv, dst, csv->sep[x]);
|
|
|
0 |
0 |
CSV_PUT (csv, dst, csv->sep[x]);
|
|
1168
|
14 |
53933 |
if (bound)
|
|
1172
|
53933 |
0 |
sv = svp && *svp ? *svp : NULL;
|
|
|
53933 |
0 |
sv = svp && *svp ? *svp : NULL;
|
|
1175
|
53947 |
0 |
if (sv && (SvOK (sv) || (
|
|
|
53 |
53894 |
if (sv && (SvOK (sv) || (
|
|
1176
|
0 |
53 |
(SvGMAGICAL (sv) && (mg_get (sv), 1) && SvOK (sv))))) {
|
|
|
0 |
0 |
(SvGMAGICAL (sv) && (mg_get (sv), 1) && SvOK (sv))))) {
|
|
1182
|
16 |
53878 |
if (*ptr == '=' && csv->formula) {
|
|
|
10 |
6 |
if (*ptr == '=' && csv->formula) {
|
|
1183
|
2 |
4 |
unless (ptr = _formula (csv, sv, &len, i))
|
|
1186
|
1412 |
52476 |
if (len == 0)
|
|
1187
|
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;
|
|
1190
|
20041 |
32435 |
if (SvUTF8 (sv)) {
|
|
1195
|
46853 |
5623 |
quoteMe = aq ? 1 : qm ? was_quoted (qm, i) : 0;
|
|
|
12 |
46841 |
quoteMe = aq ? 1 : qm ? was_quoted (qm, i) : 0;
|
|
1201
|
46848 |
5628 |
if (!quoteMe &&
|
|
1202
|
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))) {
|
|
1214
|
83956 |
2133 |
for (ptr2 = ptr, l = len; l; ++ptr2, --l) {
|
|
1225
|
83956 |
0 |
if ((CH_QUOTE && c == CH_QUOTE) ||
|
|
|
83648 |
308 |
if ((CH_QUOTE && c == CH_QUOTE) ||
|
|
1226
|
81645 |
2003 |
(CH_SEP && c == CH_SEP) ||
|
|
|
81494 |
151 |
(CH_SEP && c == CH_SEP) ||
|
|
1227
|
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) ||
|
|
1228
|
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) ||
|
|
1229
|
2426 |
60816 |
x < csv->first_safe_char
|
|
1230
|
10 |
0 |
: c == CH_NL || c == CH_CR ||
|
|
|
10 |
0 |
: c == CH_NL || c == CH_CR ||
|
|
1231
|
5 |
5 |
(csv->quote_space && (
|
|
|
3 |
2 |
(csv->quote_space && (
|
|
1232
|
0 |
3 |
c == CH_SPACE || c == CH_TAB)))) {
|
|
1243
|
29414 |
24474 |
if (quoteMe) {
|
|
1244
|
0 |
29414 |
CSV_PUT (csv, dst, CH_QUOTE);
|
|
|
0 |
0 |
CSV_PUT (csv, dst, CH_QUOTE);
|
|
1245
|
17 |
29397 |
if (csv->quo_len) {
|
|
1247
|
34 |
17 |
for (x = 1; x < (int)csv->quo_len; x++)
|
|
1248
|
0 |
34 |
CSV_PUT (csv, dst, csv->quo[x]);
|
|
|
0 |
0 |
CSV_PUT (csv, dst, csv->quo[x]);
|
|
1251
|
950361654 |
53881 |
while (len-- > 0) {
|
|
1255
|
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)) {
|
|
1258
|
0 |
7 |
unless (hv_store (csv->self, "_ERROR_INPUT", 12, sv, 0))
|
|
1263
|
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 ||
|
|
1264
|
1 |
8 |
memcmp (ptr, csv->quo +1, csv->quo_len - 1) == 0))
|
|
1267
|
2165 |
950356265 |
if (c == csv->escape_char && csv->escape_char)
|
|
|
2163 |
2 |
if (c == csv->escape_char && csv->escape_char)
|
|
1270
|
56 |
950356211 |
if (c == (char)0 && csv->escape_null) {
|
|
|
29 |
27 |
if (c == (char)0 && csv->escape_null) {
|
|
1274
|
5409 |
950356238 |
if (e && csv->escape_char)
|
|
|
5409 |
0 |
if (e && csv->escape_char)
|
|
1275
|
0 |
5409 |
CSV_PUT (csv, dst, csv->escape_char);
|
|
|
0 |
0 |
CSV_PUT (csv, dst, csv->escape_char);
|
|
1276
|
919632 |
949442015 |
CSV_PUT (csv, dst, c);
|
|
|
0 |
919632 |
CSV_PUT (csv, dst, c);
|
|
1278
|
29407 |
24474 |
if (quoteMe) {
|
|
1279
|
0 |
29407 |
CSV_PUT (csv, dst, CH_QUOTE);
|
|
|
0 |
0 |
CSV_PUT (csv, dst, CH_QUOTE);
|
|
1280
|
17 |
29390 |
if (csv->quo_len) {
|
|
1282
|
34 |
17 |
for (x = 1; x < (int)csv->quo_len; x++)
|
|
1283
|
0 |
34 |
CSV_PUT (csv, dst, csv->quo[x]);
|
|
|
0 |
0 |
CSV_PUT (csv, dst, csv->quo[x]);
|
|
1288
|
8 |
45 |
if (csv->undef_str) {
|
|
1292
|
3 |
5 |
if (csv->undef_flg) {
|
|
1297
|
20 |
8 |
while (len--)
|
|
1298
|
0 |
20 |
CSV_PUT (csv, dst, *ptr++);
|
|
|
0 |
0 |
CSV_PUT (csv, dst, *ptr++);
|
|
1302
|
241 |
21421 |
if (csv->eol_len) {
|
|
1306
|
439 |
241 |
while (len--)
|
|
1307
|
0 |
439 |
CSV_PUT (csv, dst, *ptr++);
|
|
|
0 |
0 |
CSV_PUT (csv, dst, *ptr++);
|
|
1309
|
21660 |
2 |
if (csv->used)
|
|
1339
|
326 |
0 |
if (csv->tmp) {
|
|
1341
|
326 |
0 |
if (hv_store (csv->self, "_ERROR_INPUT", 12, csv->tmp, 0))
|
|
1349
|
1525 |
3755 |
unless (csv->useIO)
|
|
1352
|
950 |
2805 |
if (csv->tmp && csv->eol_pos >= 0) {
|
|
|
348 |
602 |
if (csv->tmp && csv->eol_pos >= 0) {
|
|
1363
|
0 |
3407 |
PUSHMARK (sp);
|
|
1364
|
0 |
3407 |
EXTEND (sp, 1);
|
|
1370
|
3407 |
0 |
csv->tmp = result ? POPs : NULL;
|
|
1382
|
3407 |
0 |
if (csv->tmp && SvOK (csv->tmp)) {
|
|
|
2809 |
598 |
if (csv->tmp && SvOK (csv->tmp)) {
|
|
1387
|
358 |
2451 |
if (csv->eolx && csv->size >= csv->eol_len) {
|
|
|
358 |
0 |
if (csv->eolx && csv->size >= csv->eol_len) {
|
|
1389
|
1463 |
354 |
for (i = 1; i <= (int)csv->eol_len; i++) {
|
|
1390
|
4 |
1459 |
unless (csv->bptr[csv->size - i] == csv->eol[csv->eol_len - i]) {
|
|
1395
|
354 |
4 |
if (match) {
|
|
1400
|
351 |
3 |
unless (csv->verbatim)
|
|
1404
|
351 |
3 |
unless (csv->verbatim || csv->size)
|
|
|
6 |
345 |
unless (csv->verbatim || csv->size)
|
|
1408
|
70 |
2733 |
if (SvUTF8 (csv->tmp)) csv->utf8 = 1;
|
|
1409
|
2803 |
0 |
if (tmp_len)
|
|
1539
|
1745 |
0 |
unless (s && len) return;
|
|
|
0 |
1745 |
unless (s && len) return;
|
|
1540
|
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)
|
|
1589
|
187614 |
3833 |
while ((c = CSV_GET) != EOF) {
|
|
|
190664 |
783 |
while ((c = CSV_GET) != EOF) {
|
|
1591
|
23915 |
166749 |
NewField;
|
|
|
151 |
23764 |
NewField;
|
|
|
4 |
23911 |
NewField;
|
|
1603
|
12570 |
189658 |
if (is_SEP (c)) {
|
|
|
88 |
12482 |
if (is_SEP (c)) {
|
|
|
88 |
0 |
if (is_SEP (c)) {
|
|
|
30 |
58 |
if (is_SEP (c)) {
|
|
|
30 |
0 |
if (is_SEP (c)) {
|
|
1609
|
1307 |
11205 |
if (waitingForField) {
|
|
1613
|
1281 |
26 |
if (csv->blank_is_undef || csv->empty_is_undef)
|
|
|
24 |
1257 |
if (csv->blank_is_undef || csv->empty_is_undef)
|
|
1617
|
1307 |
0 |
unless (csv->is_bound)
|
|
1620
|
8 |
1299 |
if (csv->keep_meta_info && fflags)
|
|
|
8 |
0 |
if (csv->keep_meta_info && fflags)
|
|
1624
|
2194 |
9011 |
if (f & CSV_FLAGS_QUO) {
|
|
1628
|
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)
|
|
1634
|
9009 |
2 |
AV_PUSH;
|
|
|
90 |
8919 |
AV_PUSH;
|
|
|
19 |
71 |
AV_PUSH;
|
|
|
2 |
9007 |
AV_PUSH;
|
|
|
2 |
0 |
AV_PUSH;
|
|
|
2 |
0 |
AV_PUSH;
|
|
|
0 |
2 |
AV_PUSH;
|
|
|
1645 |
7364 |
AV_PUSH;
|
|
|
1645 |
0 |
AV_PUSH;
|
|
|
34 |
8975 |
AV_PUSH;
|
|
|
34 |
0 |
AV_PUSH;
|
|
|
32 |
2 |
AV_PUSH;
|
|
|
22 |
10 |
AV_PUSH;
|
|
|
5 |
9004 |
AV_PUSH;
|
|
|
8922 |
87 |
AV_PUSH;
|
|
|
21 |
8988 |
AV_PUSH;
|
|
|
21 |
0 |
AV_PUSH;
|
|
1638
|
188685 |
1031 |
if (is_QUOTE (c)) {
|
|
|
23076 |
165609 |
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)) {
|
|
1644
|
11021 |
12039 |
if (waitingForField) {
|
|
1653
|
11971 |
68 |
if (f & CSV_FLAGS_QUO) {
|
|
1660
|
10648 |
1323 |
int c2 = CSV_GET;
|
|
1662
|
4240 |
7731 |
if (csv->allow_whitespace) {
|
|
1666
|
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)) {
|
|
1667
|
1 |
89 |
if (csv->allow_loose_quotes &&
|
|
1668
|
0 |
1 |
!(csv->escape_char && c2 == csv->escape_char)) {
|
|
|
0 |
0 |
!(csv->escape_char && c2 == csv->escape_char)) {
|
|
1674
|
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);
|
|
1677
|
87 |
3 |
c2 = CSV_GET;
|
|
1681
|
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)) {
|
|
1685
|
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;
|
|
1689
|
2750 |
194 |
if (c2 == CH_NL || c2 == CH_EOLX) {
|
|
|
20 |
2730 |
if (c2 == CH_NL || c2 == CH_EOLX) {
|
|
1690
|
20 |
194 |
unsigned short eolt = EOL_TYPE (c2);
|
|
|
0 |
20 |
unsigned short eolt = EOL_TYPE (c2);
|
|
1698
|
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)
|
|
1699
|
4 |
2 |
ERROR_EOL;
|
|
|
2 |
4 |
ERROR_EOL;
|
|
|
2 |
0 |
ERROR_EOL;
|
|
1700
|
60 |
152 |
SET_EOL_TYPE (csv, eolt);
|
|
1702
|
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;
|
|
1713
|
2713 |
17 |
if (csv->escape_char && c == csv->escape_char) {
|
|
|
1633 |
1080 |
if (csv->escape_char && c == csv->escape_char) {
|
|
1716
|
25 |
1608 |
if (c2 == '0') {
|
|
1720
|
25 |
0 |
CSV_PUT_SV (0)
|
|
|
0 |
25 |
CSV_PUT_SV (0)
|
|
1724
|
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)) {
|
|
1728
|
1 |
1059 |
if (csv->utf8)
|
|
1730
|
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)
|
|
1734
|
3 |
545 |
if (csv->allow_loose_escapes && c2 != CH_CR) {
|
|
|
2 |
1 |
if (csv->allow_loose_escapes && c2 != CH_CR) {
|
|
1738
|
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);
|
|
1744
|
280 |
1363 |
if (c2 == CH_CR) {
|
|
1747
|
109 |
171 |
if (csv->eol_is_cr) {
|
|
1755
|
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;
|
|
1759
|
166 |
5 |
c3 = CSV_GET;
|
|
1761
|
139 |
32 |
if (c3 == CH_NL) { /* \r is not optional before EOLX! */
|
|
1769
|
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)
|
|
1770
|
0 |
0 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
1771
|
68 |
71 |
SET_EOL_TYPE (csv, EOL_TYPE_CRNL);
|
|
1773
|
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;
|
|
1777
|
19 |
13 |
if (csv->useIO && csv->eol_len == 0) {
|
|
|
19 |
0 |
if (csv->useIO && csv->eol_len == 0) {
|
|
1778
|
8 |
11 |
if (c3 == CH_CR) { /* \r followed by an empty line */
|
|
1786
|
6 |
2 |
if (csv->strict_eol && csv->eol_type) {
|
|
|
2 |
4 |
if (csv->strict_eol && csv->eol_type) {
|
|
1787
|
2 |
0 |
unless (csv->eol_type == EOL_TYPE_CR)
|
|
1788
|
0 |
2 |
ERROR_EOL;
|
|
|
0 |
2 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
1791
|
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;
|
|
1796
|
6 |
0 |
if (f & CSV_FLAGS_QUO) f ^= CSV_FLAGS_QUO;
|
|
1801
|
11 |
0 |
if (!is_csv_binary (c3)) {
|
|
|
0 |
11 |
if (!is_csv_binary (c3)) {
|
|
|
0 |
0 |
if (!is_csv_binary (c3)) {
|
|
1810
|
6 |
5 |
if (csv->strict_eol && csv->eol_type) {
|
|
|
2 |
4 |
if (csv->strict_eol && csv->eol_type) {
|
|
1811
|
2 |
0 |
unless (csv->eol_type == EOL_TYPE_CR)
|
|
1812
|
0 |
2 |
ERROR_EOL;
|
|
|
0 |
2 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
1819
|
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;
|
|
1824
|
12 |
1 |
ParseError (csv, quoesc ? 2023 : 2010, csv->used - 2);
|
|
1828
|
1306 |
57 |
if (c2 == EOF) {
|
|
1832
|
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;
|
|
1836
|
12 |
45 |
if (csv->allow_loose_quotes && !quoesc) {
|
|
|
10 |
2 |
if (csv->allow_loose_quotes && !quoesc) {
|
|
1840
|
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);
|
|
1848
|
39 |
8 |
if (quoesc) {
|
|
1850
|
39 |
0 |
ERROR_INSIDE_QUOTES (2023);
|
|
1853
|
8 |
0 |
ERROR_INSIDE_QUOTES (2011);
|
|
1857
|
16 |
52 |
if (csv->allow_loose_quotes) { /* 1,foo "boo" d'uh,1 */
|
|
1859
|
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);
|
|
1862
|
51 |
1 |
ERROR_INSIDE_FIELD (2034);
|
|
1865
|
4653 |
162003 |
if (c == csv->escape_char && csv->escape_char) {
|
|
|
4651 |
2 |
if (c == csv->escape_char && csv->escape_char) {
|
|
1872
|
33 |
4618 |
if (waitingForField) {
|
|
1874
|
3 |
30 |
if (csv->allow_unquoted_escape) {
|
|
1878
|
2 |
1 |
int c2 = CSV_GET;
|
|
1882
|
1 |
2 |
if (c2 == EOF) {
|
|
1884
|
1 |
0 |
ERROR_INSIDE_FIELD (2035);
|
|
1887
|
1 |
1 |
if (c2 == '0')
|
|
1888
|
1 |
0 |
CSV_PUT_SV (0)
|
|
|
0 |
1 |
CSV_PUT_SV (0)
|
|
1890
|
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) ||
|
|
1891
|
0 |
0 |
c2 == csv->escape_char || csv->allow_loose_escapes) {
|
|
|
0 |
0 |
c2 == csv->escape_char || csv->allow_loose_escapes) {
|
|
1892
|
0 |
1 |
if (csv->utf8)
|
|
1894
|
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)
|
|
1898
|
0 |
0 |
ERROR_INSIDE_QUOTES (2025);
|
|
1903
|
4610 |
8 |
if (f & CSV_FLAGS_QUO) {
|
|
1904
|
4607 |
3 |
int c2 = CSV_GET;
|
|
1906
|
3 |
4607 |
if (c2 == EOF) {
|
|
1908
|
3 |
0 |
ERROR_INSIDE_QUOTES (2024);
|
|
1911
|
2 |
4605 |
if (c2 == '0')
|
|
1912
|
2 |
0 |
CSV_PUT_SV (0)
|
|
|
0 |
2 |
CSV_PUT_SV (0)
|
|
1914
|
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) ||
|
|
1915
|
28 |
2165 |
c2 == csv->escape_char || csv->allow_loose_escapes) {
|
|
|
2 |
26 |
c2 == csv->escape_char || csv->allow_loose_escapes) {
|
|
1916
|
1 |
4578 |
if (csv->utf8)
|
|
1918
|
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)
|
|
1922
|
26 |
0 |
ERROR_INSIDE_QUOTES (2025);
|
|
1926
|
8 |
0 |
if (sv) {
|
|
1927
|
4 |
4 |
int c2 = CSV_GET;
|
|
1929
|
4 |
4 |
if (c2 == EOF) {
|
|
1931
|
4 |
0 |
ERROR_INSIDE_FIELD (2035);
|
|
1934
|
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);
|
|
1937
|
0 |
0 |
ERROR_INSIDE_FIELD (2036); /* uncoverable statement I think there's no way to get here */
|
|
1940
|
1946 |
160059 |
if (c == CH_NL || is_EOL (c)) {
|
|
|
334 |
159725 |
if (c == CH_NL || is_EOL (c)) {
|
|
1943
|
836 |
2086 |
eolt = ((c == CH_NL || c == CH_CR) && c0 == CH_CR) ? EOL_TYPE_CRNL : EOL_TYPE (c);
|
|
|
494 |
342 |
eolt = ((c == CH_NL || c == CH_CR) && c0 == CH_CR) ? EOL_TYPE_CRNL : EOL_TYPE (c);
|
|
|
1730 |
850 |
eolt = ((c == CH_NL || c == CH_CR) && c0 == CH_CR) ? EOL_TYPE_CRNL : EOL_TYPE (c);
|
|
|
342 |
1730 |
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);
|
|
1950
|
2172 |
750 |
unless (f & CSV_FLAGS_QUO) {
|
|
1951
|
686 |
1486 |
if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
|
|
|
541 |
145 |
if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
|
|
|
37 |
504 |
if (csv->strict_eol && csv->eol_type && csv->eol_type != eolt)
|
|
1952
|
12 |
25 |
ERROR_EOL;
|
|
|
5 |
32 |
ERROR_EOL;
|
|
|
5 |
0 |
ERROR_EOL;
|
|
1953
|
264 |
1903 |
SET_EOL_TYPE (csv, eolt);
|
|
1956
|
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) {
|
|
1957
|
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;
|
|
1961
|
259 |
2567 |
if (waitingForField) {
|
|
1965
|
251 |
8 |
if (csv->blank_is_undef || csv->empty_is_undef)
|
|
|
8 |
243 |
if (csv->blank_is_undef || csv->empty_is_undef)
|
|
1969
|
259 |
0 |
unless (csv->is_bound)
|
|
1971
|
14 |
245 |
if (csv->keep_meta_info && fflags)
|
|
|
14 |
0 |
if (csv->keep_meta_info && fflags)
|
|
1976
|
750 |
1817 |
if (f & CSV_FLAGS_QUO) {
|
|
1981
|
19 |
731 |
unless (csv->binary)
|
|
1982
|
19 |
0 |
ERROR_INSIDE_QUOTES (2021);
|
|
1984
|
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);
|
|
1987
|
9 |
1808 |
if (csv->verbatim) {
|
|
1992
|
1 |
8 |
unless (csv->binary)
|
|
1993
|
1 |
0 |
ERROR_INSIDE_FIELD (2030);
|
|
1995
|
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);
|
|
2001
|
331 |
1477 |
if (csv->recno == 0 && csv->fld_idx == 1 && csv->useIO &&
|
|
|
29 |
302 |
if (csv->recno == 0 && csv->fld_idx == 1 && csv->useIO &&
|
|
|
29 |
0 |
if (csv->recno == 0 && csv->fld_idx == 1 && csv->useIO &&
|
|
2002
|
24 |
5 |
(csv->bptr[0] == 's' || csv->bptr[0] == 'S') &&
|
|
|
0 |
24 |
(csv->bptr[0] == 's' || csv->bptr[0] == 'S') &&
|
|
2003
|
0 |
5 |
(csv->bptr[1] == 'e' || csv->bptr[1] == 'E') &&
|
|
|
0 |
0 |
(csv->bptr[1] == 'e' || csv->bptr[1] == 'E') &&
|
|
2004
|
0 |
5 |
(csv->bptr[2] == 'p' || csv->bptr[2] == 'P') &&
|
|
|
0 |
0 |
(csv->bptr[2] == 'p' || csv->bptr[2] == 'P') &&
|
|
2005
|
5 |
0 |
csv->bptr[3] == '=') {
|
|
2008
|
4 |
1 |
if (lnu <= MAX_ATTR_LEN) {
|
|
2011
|
1 |
3 |
csv->sep_len = lnu == 1 ? 0 : lnu;
|
|
2019
|
1797 |
7 |
AV_PUSH;
|
|
|
4 |
1793 |
AV_PUSH;
|
|
|
1 |
3 |
AV_PUSH;
|
|
|
7 |
1797 |
AV_PUSH;
|
|
|
7 |
0 |
AV_PUSH;
|
|
|
7 |
0 |
AV_PUSH;
|
|
|
0 |
7 |
AV_PUSH;
|
|
|
78 |
1726 |
AV_PUSH;
|
|
|
78 |
0 |
AV_PUSH;
|
|
|
82 |
1722 |
AV_PUSH;
|
|
|
82 |
0 |
AV_PUSH;
|
|
|
81 |
1 |
AV_PUSH;
|
|
|
37 |
44 |
AV_PUSH;
|
|
|
1 |
1803 |
AV_PUSH;
|
|
|
1761 |
43 |
AV_PUSH;
|
|
|
9 |
1795 |
AV_PUSH;
|
|
|
9 |
0 |
AV_PUSH;
|
|
2024
|
1332 |
158393 |
if (c == CH_CR && !(csv->verbatim)) {
|
|
|
1329 |
3 |
if (c == CH_CR && !(csv->verbatim)) {
|
|
2031
|
166 |
1163 |
if (waitingForField) {
|
|
2034
|
46 |
120 |
if (csv->eol_is_cr) {
|
|
2042
|
115 |
5 |
c2 = CSV_GET;
|
|
2044
|
5 |
115 |
if (c2 == EOF) {
|
|
2054
|
0 |
5 |
unless (seenSomething)
|
|
2059
|
94 |
21 |
if (c2 == CH_NL) { /* \r is not optional before EOLX! */
|
|
2063
|
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)
|
|
2064
|
0 |
0 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
2065
|
15 |
79 |
SET_EOL_TYPE (csv, EOL_TYPE_CRNL);
|
|
2076
|
16 |
5 |
if (csv->useIO && csv->eol_len == 0) {
|
|
|
16 |
0 |
if (csv->useIO && csv->eol_len == 0) {
|
|
2077
|
0 |
16 |
if (c2 == CH_CR) { /* \r followed by an empty line */
|
|
2081
|
0 |
0 |
if (csv->strict_eol && csv->eol_type) {
|
|
|
0 |
0 |
if (csv->strict_eol && csv->eol_type) {
|
|
2082
|
0 |
0 |
unless (csv->eol_type == EOL_TYPE_CR)
|
|
2083
|
0 |
0 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
2093
|
13 |
3 |
if (!is_csv_binary (c2)) {
|
|
|
0 |
13 |
if (!is_csv_binary (c2)) {
|
|
|
0 |
3 |
if (!is_csv_binary (c2)) {
|
|
2098
|
9 |
4 |
if (csv->strict_eol && csv->eol_type) {
|
|
|
4 |
5 |
if (csv->strict_eol && csv->eol_type) {
|
|
2099
|
4 |
0 |
unless (csv->eol_type == EOL_TYPE_CR)
|
|
2100
|
0 |
4 |
ERROR_EOL;
|
|
|
0 |
4 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
2106
|
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) {
|
|
2107
|
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;
|
|
2110
|
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;
|
|
2119
|
8 |
0 |
ERROR_INSIDE_FIELD (2031);
|
|
2122
|
641 |
522 |
if (f & CSV_FLAGS_QUO) {
|
|
2127
|
70 |
571 |
unless (csv->binary)
|
|
2128
|
70 |
0 |
ERROR_INSIDE_QUOTES (2022);
|
|
2130
|
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);
|
|
2135
|
192 |
330 |
if (csv->eol_is_cr) {
|
|
2142
|
325 |
5 |
c2 = CSV_GET;
|
|
2144
|
296 |
34 |
if (c2 == CH_NL) { /* \r is not optional before EOLX! */
|
|
2148
|
165 |
131 |
if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
|
|
|
89 |
76 |
if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
|
|
|
10 |
79 |
if (csv->strict_eol && csv->eol_type && csv->eol_type != EOL_TYPE_CRNL)
|
|
2149
|
1 |
9 |
ERROR_EOL;
|
|
|
0 |
10 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
2150
|
103 |
193 |
SET_EOL_TYPE (csv, EOL_TYPE_CRNL);
|
|
2160
|
29 |
5 |
if (csv->useIO && csv->eol_len == 0) {
|
|
|
29 |
0 |
if (csv->useIO && csv->eol_len == 0) {
|
|
2161
|
14 |
15 |
if (!is_csv_binary (c2)
|
|
|
0 |
14 |
if (!is_csv_binary (c2)
|
|
|
15 |
0 |
if (!is_csv_binary (c2)
|
|
2166
|
9 |
6 |
|| c2 == CH_CR) {
|
|
2174
|
12 |
11 |
if (csv->strict_eol && csv->eol_type) {
|
|
|
4 |
8 |
if (csv->strict_eol && csv->eol_type) {
|
|
2175
|
4 |
0 |
unless (csv->eol_type == EOL_TYPE_CR)
|
|
2176
|
0 |
4 |
ERROR_EOL;
|
|
|
0 |
4 |
ERROR_EOL;
|
|
|
0 |
0 |
ERROR_EOL;
|
|
2182
|
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) {
|
|
2183
|
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;
|
|
2186
|
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;
|
|
2194
|
11 |
0 |
ERROR_INSIDE_FIELD (2032);
|
|
2204
|
3646 |
154750 |
if (csv->eolx && c == CH_EOL &&
|
|
|
8 |
3638 |
if (csv->eolx && c == CH_EOL &&
|
|
2205
|
8 |
0 |
csv->size - csv->used >= (STRLEN)csv->eol_len - 1 &&
|
|
2206
|
8 |
0 |
!memcmp (csv->bptr + csv->used, csv->eol + 1, csv->eol_len - 1) &&
|
|
2207
|
8 |
0 |
(csv->used += csv->eol_len - 1)) {
|
|
2215
|
11485 |
146903 |
if (waitingForField) {
|
|
2216
|
193 |
11292 |
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) {
|
|
2224
|
18 |
17 |
if (cl == 1 || (
|
|
2225
|
18 |
0 |
(csv->size - csv->used >= cl - 1 &&
|
|
2226
|
18 |
0 |
!memcmp (csv->bptr + csv->used, csv->comment_str + 1, cl - 1) &&
|
|
2227
|
18 |
0 |
(csv->used += cl - 1)))) {
|
|
2229
|
6 |
29 |
csv->fld_idx = csv->strict_n ? csv->strict_n - 1 : 0;
|
|
2230
|
0 |
35 |
c = CSV_GET;
|
|
2235
|
1 |
34 |
unless (csv->useIO)
|
|
2237
|
4 |
31 |
if (c == EOF)
|
|
2243
|
1956 |
9494 |
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)) {
|
|
2245
|
320 |
1 |
c = CSV_GET;
|
|
2249
|
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));
|
|
2250
|
1 |
210 |
if (c == EOF)
|
|
2264
|
111602 |
35301 |
if (f & CSV_FLAGS_QUO) {
|
|
2265
|
111154 |
448 |
if (is_csv_binary (c)) {
|
|
|
3021 |
108133 |
if (is_csv_binary (c)) {
|
|
|
3454 |
15 |
if (is_csv_binary (c)) {
|
|
2267
|
31 |
3423 |
unless (csv->binary || csv->utf8)
|
|
|
5 |
26 |
unless (csv->binary || csv->utf8)
|
|
2268
|
5 |
0 |
ERROR_INSIDE_QUOTES (2026);
|
|
2270
|
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);
|
|
2273
|
35263 |
38 |
if (is_csv_binary (c)) {
|
|
|
427 |
34836 |
if (is_csv_binary (c)) {
|
|
|
453 |
12 |
if (is_csv_binary (c)) {
|
|
2274
|
413 |
40 |
if (csv->useIO && c == EOF)
|
|
|
3 |
410 |
if (csv->useIO && c == EOF)
|
|
2277
|
9 |
441 |
unless (csv->binary || csv->utf8)
|
|
|
9 |
0 |
unless (csv->binary || csv->utf8)
|
|
2278
|
9 |
0 |
ERROR_INSIDE_FIELD (2037);
|
|
2280
|
0 |
35289 |
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 |
35289 |
CSV_PUT_SV (c);
|
|
|
0 |
0 |
CSV_PUT_SV (c);
|
|
|
0 |
0 |
CSV_PUT_SV (c);
|
|
|
0 |
0 |
CSV_PUT_SV (c);
|
|
|
0 |
35289 |
CSV_PUT_SV (c);
|
|
|
0 |
0 |
CSV_PUT_SV (c);
|
|
|
0 |
0 |
CSV_PUT_SV (c);
|
|
|
0 |
0 |
CSV_PUT_SV (c);
|
|
|
35289 |
0 |
CSV_PUT_SV (c);
|
|
|
178 |
35111 |
CSV_PUT_SV (c);
|
|
2285
|
119 |
165220 |
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)
|
|
2289
|
417 |
383 |
if (waitingForField) {
|
|
2290
|
27 |
390 |
unless (csv->useIO) {
|
|
2291
|
1 |
26 |
if (csv->has_ahead == 214)
|
|
2295
|
35 |
381 |
if (seenSomething) {
|
|
2296
|
34 |
1 |
NewField;
|
|
|
1 |
33 |
NewField;
|
|
|
0 |
34 |
NewField;
|
|
2297
|
31 |
4 |
if (csv->blank_is_undef || csv->empty_is_undef)
|
|
|
4 |
27 |
if (csv->blank_is_undef || csv->empty_is_undef)
|
|
2301
|
34 |
1 |
unless (csv->is_bound)
|
|
2303
|
3 |
32 |
if (csv->keep_meta_info && fflags)
|
|
|
3 |
0 |
if (csv->keep_meta_info && fflags)
|
|
2312
|
24 |
359 |
if (f & CSV_FLAGS_QUO)
|
|
2313
|
24 |
0 |
ERROR_INSIDE_QUOTES (2027);
|
|
2315
|
359 |
0 |
if (sv) {
|
|
2316
|
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;
|
|
2318
|
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)
|
|
2331
|
152 |
0 |
unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
|
|
|
152 |
0 |
unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
|
|
|
0 |
152 |
unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
|
|
|
0 |
0 |
unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
|
|
|
152 |
0 |
unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
|
|
|
0 |
152 |
unless ((svp = hv_fetchs (hv, "callbacks", FALSE)) && _is_hashref (*svp))
|
|
2336
|
152 |
0 |
unless (svp && _is_coderef (*svp))
|
|
|
152 |
0 |
unless (svp && _is_coderef (*svp))
|
|
|
0 |
152 |
unless (svp && _is_coderef (*svp))
|
|
|
0 |
0 |
unless (svp && _is_coderef (*svp))
|
|
|
152 |
0 |
unless (svp && _is_coderef (*svp))
|
|
|
0 |
152 |
unless (svp && _is_coderef (*svp))
|
|
2342
|
0 |
152 |
PUSHMARK (SP);
|
|
2343
|
0 |
152 |
mXPUSHs (newRV_inc ((SV *)hv));
|
|
2344
|
0 |
152 |
mXPUSHs (newRV_inc ((SV *)av));
|
|
2348
|
152 |
0 |
if (res) {
|
|
2350
|
64 |
88 |
if (SvROK (rv) && (rv = SvRV (rv)) && SvPOK (rv)) {
|
|
|
64 |
0 |
if (SvROK (rv) && (rv = SvRV (rv)) && SvPOK (rv)) {
|
|
|
64 |
0 |
if (SvROK (rv) && (rv = SvRV (rv)) && SvPOK (rv)) {
|
|
2351
|
64 |
0 |
if (strcmp (SvPV_nolen (rv), "skip") == 0)
|
|
2356
|
152 |
0 |
FREETMPS;
|
|
2368
|
4569 |
405 |
if (csv.eolx || csv.eol_is_cr) {
|
|
|
489 |
4080 |
if (csv.eolx || csv.eol_is_cr) {
|
|
2378
|
3037 |
1937 |
if ((csv.useIO = useIO)) {
|
|
2381
|
232 |
2805 |
if ((ahead = csv.has_ahead)) {
|
|
2383
|
232 |
0 |
if ((svp = hv_fetchs (hv, "_AHEAD", FALSE)) && *svp) {
|
|
|
232 |
0 |
if ((svp = hv_fetchs (hv, "_AHEAD", FALSE)) && *svp) {
|
|
2386
|
0 |
232 |
if (pos && SvIV (pos) > (IV)csv.size)
|
|
|
0 |
0 |
if (pos && SvIV (pos) > (IV)csv.size)
|
|
2396
|
227 |
4747 |
if (csv.has_error_input) {
|
|
2405
|
60 |
4903 |
if (csv.strict) {
|
|
2406
|
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);
|
|
2412
|
56 |
4 |
if (nf && !csv.strict_n) csv.strict_n = (short)nf;
|
|
|
20 |
36 |
if (nf && !csv.strict_n) csv.strict_n = (short)nf;
|
|
2413
|
60 |
0 |
if (csv.strict_n > 0 && nf != (STRLEN)csv.strict_n) {
|
|
|
25 |
35 |
if (csv.strict_n > 0 && nf != (STRLEN)csv.strict_n) {
|
|
2414
|
18 |
7 |
unless (csv.useIO & useIO_EOF) {
|
|
2418
|
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))
|
|
2421
|
20 |
5 |
if (last_error) /* an error callback can reset and accept */
|
|
2426
|
3029 |
1934 |
if (csv.useIO) {
|
|
2427
|
3029 |
0 |
if (csv.tmp && csv.used < csv.size && csv.has_ahead) {
|
|
|
482 |
2547 |
if (csv.tmp && csv.used < csv.size && csv.has_ahead) {
|
|
|
94 |
388 |
if (csv.tmp && csv.used < csv.size && csv.has_ahead) {
|
|
2433
|
598 |
2337 |
if (csv.useIO & useIO_EOF)
|
|
2439
|
1917 |
1112 |
if (avf) {
|
|
2440
|
11 |
1906 |
if (csv.keep_meta_info)
|
|
2451
|
1934 |
0 |
if (svp && *svp)
|
|
|
1934 |
0 |
if (svp && *svp)
|
|
2456
|
4263 |
700 |
if (result && csv.types) {
|
|
|
2 |
4261 |
if (result && csv.types) {
|
|
2461
|
6 |
2 |
for (i = 0; i <= len && i <= csv.types_len; i++) {
|
|
|
6 |
0 |
for (i = 0; i <= len && i <= csv.types_len; i++) {
|
|
2462
|
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)) {
|
|
2504
|
3469 |
382 |
if (state && csv.has_hooks & HOOK_AFTER_PARSE)
|
|
|
5 |
3464 |
if (state && csv.has_hooks & HOOK_AFTER_PARSE)
|
|
2506
|
382 |
3469 |
return (state || !last_error);
|
|
|
2 |
380 |
return (state || !last_error);
|
|
2512
|
250 |
83 |
while (av_len (av) >= 0)
|
|
2525
|
56 |
300 |
if (SvOK (off)) {
|
|
2527
|
12 |
44 |
if (skip < 0) {
|
|
2532
|
44 |
312 |
if (SvOK (len))
|
|
2535
|
794 |
318 |
while (c_xsParse (csv, hv, row, NULL, io, 1)) {
|
|
2539
|
20 |
774 |
if (skip > 0) {
|
|
2545
|
12 |
762 |
if (n++ >= tail) {
|
|
2550
|
138 |
636 |
if (csv.has_hooks & HOOK_AFTER_PARSE) {
|
|
2551
|
63 |
75 |
unless (hook (aTHX_ hv, "after_parse", row)) {
|
|
2558
|
52 |
659 |
if (n >= length && skip >= 0)
|
|
|
32 |
20 |
if (n >= length && skip >= 0)
|
|
2563
|
8 |
350 |
while (n > length) {
|
|
2582
|
251 |
21422 |
if (*csv.eol)
|
|
2585
|
20277 |
1396 |
if (useIO && csv.has_hooks & HOOK_BEFORE_PRINT)
|
|
|
9 |
20268 |
if (useIO && csv.has_hooks & HOOK_BEFORE_PRINT)
|
|
2591
|
21661 |
8 |
if (result && !useIO && csv.utf8)
|
|
|
1391 |
20270 |
if (result && !useIO && csv.utf8)
|
|
|
25 |
1366 |
if (result && !useIO && csv.utf8)
|
|
2612
|
3082 |
0 |
if (SvOK (self) && SvROK (self)) {
|
|
|
1047 |
2035 |
if (SvOK (self) && SvROK (self)) {
|
|
2613
|
1047 |
0 |
CSV_XS_SELF;
|
|
|
1047 |
0 |
CSV_XS_SELF;
|
|
|
1047 |
0 |
CSV_XS_SELF;
|
|
|
0 |
1047 |
CSV_XS_SELF;
|
|
2622
|
2087 |
995 |
if (xse && items > 2 && SvPOK (ST (2))) {
|
|
|
1011 |
1076 |
if (xse && items > 2 && SvPOK (ST (2))) {
|
|
|
1011 |
0 |
if (xse && items > 2 && SvPOK (ST (2))) {
|
|
2634
|
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) {
|
|
2637
|
3 |
1 |
if (SvOK (*sv))
|
|
2655
|
1396 |
0 |
CSV_XS_SELF;
|
|
|
1396 |
0 |
CSV_XS_SELF;
|
|
|
1396 |
0 |
CSV_XS_SELF;
|
|
|
0 |
1396 |
CSV_XS_SELF;
|
|
2657
|
1391 |
1 |
ST (0) = xsCombine (self, hv, av, dst, useIO) ? &PL_sv_yes : &PL_sv_undef;
|
|
2669
|
1937 |
0 |
CSV_XS_SELF;
|
|
|
1937 |
0 |
CSV_XS_SELF;
|
|
|
1937 |
0 |
CSV_XS_SELF;
|
|
|
0 |
1937 |
CSV_XS_SELF;
|
|
2673
|
1729 |
205 |
ST (0) = xsParse (self, hv, av, avf, src, 0) ? &PL_sv_yes : &PL_sv_no;
|
|
2684
|
20282 |
0 |
CSV_XS_SELF;
|
|
|
20282 |
0 |
CSV_XS_SELF;
|
|
|
20282 |
0 |
CSV_XS_SELF;
|
|
|
0 |
20282 |
CSV_XS_SELF;
|
|
2685
|
5 |
20277 |
if (fields == &PL_sv_undef)
|
|
2688
|
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))
|
|
2694
|
20270 |
7 |
ST (0) = xsCombine (self, hv, av, io, 1) ? &PL_sv_yes : &PL_sv_no;
|
|
2706
|
1919 |
0 |
CSV_XS_SELF;
|
|
|
1919 |
0 |
CSV_XS_SELF;
|
|
|
1919 |
0 |
CSV_XS_SELF;
|
|
|
0 |
1919 |
CSV_XS_SELF;
|
|
2711
|
1742 |
175 |
: &PL_sv_undef;
|
|
2722
|
356 |
0 |
CSV_XS_SELF;
|
|
|
356 |
0 |
CSV_XS_SELF;
|
|
|
356 |
0 |
CSV_XS_SELF;
|
|
|
0 |
356 |
CSV_XS_SELF;
|
|
2724
|
56 |
300 |
offset = items > 2 ? ST (2) : &PL_sv_undef;
|
|
2725
|
44 |
312 |
length = items > 3 ? ST (3) : &PL_sv_undef;
|
|
2739
|
32 |
0 |
CSV_XS_SELF;
|
|
|
32 |
0 |
CSV_XS_SELF;
|
|
|
32 |
0 |
CSV_XS_SELF;
|
|
|
0 |
32 |
CSV_XS_SELF;
|
|
2742
|
21 |
11 |
if (eol)
|
|
2756
|
23354 |
0 |
CSV_XS_SELF;
|
|
|
23354 |
0 |
CSV_XS_SELF;
|
|
|
23354 |
0 |
CSV_XS_SELF;
|
|
|
0 |
23354 |
CSV_XS_SELF;
|
|
2767
|
2 |
0 |
CSV_XS_SELF;
|
|
|
2 |
0 |
CSV_XS_SELF;
|
|
|
2 |
0 |
CSV_XS_SELF;
|
|
|
0 |
2 |
CSV_XS_SELF;
|