| line |
true |
false |
branch |
|
97
|
0 |
0 |
if(boxes==NULL) |
|
103
|
0 |
0 |
{ for(boxnr = 0; boxnr < nr_boxes; boxnr++) |
|
104
|
0 |
0 |
if(boxes[boxnr]==NULL) break; |
|
106
|
0 |
0 |
if(boxnr >= nr_boxes) |
|
111
|
0 |
0 |
for(i=0; i<10; i++) |
|
127
|
0 |
0 |
if(boxnr >= 0 && boxnr < nr_boxes) /* bit careful */ |
|
|
0 |
0 |
if(boxnr >= 0 && boxnr < nr_boxes) /* bit careful */ |
|
137
|
0 |
0 |
if(boxnr < 0 || boxnr >= nr_boxes) return NULL; |
|
|
0 |
0 |
if(boxnr < 0 || boxnr >= nr_boxes) return NULL; |
|
147
|
0 |
0 |
if(box->keep_line) |
|
157
|
0 |
0 |
{ if(!fgets(box->line + bytes, bufsize - bytes, box->file)) |
|
161
|
0 |
0 |
if(bytes < bufsize-1 || box->line[bufsize-1]=='\n') |
|
|
0 |
0 |
if(bytes < bufsize-1 || box->line[bufsize-1]=='\n') |
|
172
|
0 |
0 |
if(!bytes) |
|
176
|
0 |
0 |
if(box->dosmode) |
|
178
|
0 |
0 |
if(len >= 2 && box->line[len-2]==CR) |
|
|
0 |
0 |
if(len >= 2 && box->line[len-2]==CR) |
|
183
|
0 |
0 |
if(len==0 || box->line[len-1]!='\n') /* Last line on Win* may lack */ |
|
|
0 |
0 |
if(len==0 || box->line[len-1]!='\n') /* Last line on Win* may lack */ |
|
199
|
0 |
0 |
{ return box->keep_line ? box->line_start : (long)ftell(box->file); |
|
223
|
0 |
0 |
if(line==NULL) return 0; /* end of file. */ |
|
224
|
0 |
0 |
if(line[0]=='\n') return 0; /* normal end of header. */ |
|
230
|
0 |
0 |
for(reader = line; *reader!=':' && *reader!='\n'; reader++) |
|
|
0 |
0 |
for(reader = line; *reader!=':' && *reader!='\n'; reader++) |
|
233
|
0 |
0 |
if(*reader=='\n') |
|
240
|
0 |
0 |
for(length=reader-line-1; length >= 0 && isspace(line[length]); --length) |
|
|
0 |
0 |
for(length=reader-line-1; length >= 0 && isspace(line[length]); --length) |
|
243
|
0 |
0 |
if(field_error && box->trace <= TRACE_WARNINGS) |
|
|
0 |
0 |
if(field_error && box->trace <= TRACE_WARNINGS) |
|
254
|
0 |
0 |
for(++reader; isspace(*reader); ++reader) |
|
264
|
0 |
0 |
if(line==NULL) break; |
|
266
|
0 |
0 |
if( !isspace(line[0]) || line[0]=='\n') |
|
|
0 |
0 |
if( !isspace(line[0]) || line[0]=='\n') |
|
292
|
0 |
0 |
if(sep==NULL) return 1; /* no seps, than we have to trust it. */ |
|
295
|
0 |
0 |
if(where >= 0) |
|
296
|
0 |
0 |
{ if(goto_position(box, where)!=0) |
|
305
|
0 |
0 |
while(line!=NULL && line[0]=='\n' && line[1]==EOL) |
|
|
0 |
0 |
while(line!=NULL && line[0]=='\n' && line[1]==EOL) |
|
|
0 |
0 |
while(line!=NULL && line[0]=='\n' && line[1]==EOL) |
|
308
|
0 |
0 |
found = (line==NULL || strncmp(line, sep->line, sep->length)==0); |
|
|
0 |
0 |
found = (line==NULL || strncmp(line, sep->line, sep->length)==0); |
|
324
|
0 |
0 |
if(line==NULL) |
|
327
|
0 |
0 |
if(line[0]!='\n') |
|
348
|
0 |
0 |
if(strncmp(sep->line, line, sep->length)!=0) return 0; |
|
350
|
0 |
0 |
if(strcmp(sep->line, "From ") !=0) return 1; |
|
353
|
0 |
0 |
while(*line) |
|
354
|
0 |
0 |
{ if( (line[0]=='1' || line[0]=='2') |
|
|
0 |
0 |
{ if( (line[0]=='1' || line[0]=='2') |
|
355
|
0 |
0 |
&& isdigit(line[1]) && isdigit(line[2]) && isdigit(line[3]) |
|
|
0 |
0 |
&& isdigit(line[1]) && isdigit(line[2]) && isdigit(line[3]) |
|
|
0 |
0 |
&& isdigit(line[1]) && isdigit(line[2]) && isdigit(line[3]) |
|
374
|
0 |
0 |
max_lines = expect_lines >= 0 ? (expect_lines+10) : 1000; |
|
387
|
0 |
0 |
if(*nr_lines == expect_lines && is_good_end(box, -1)) |
|
|
0 |
0 |
if(*nr_lines == expect_lines && is_good_end(box, -1)) |
|
390
|
0 |
0 |
if(file_position(box)-start == expect_chars && is_good_end(box,-1)) |
|
|
0 |
0 |
if(file_position(box)-start == expect_chars && is_good_end(box,-1)) |
|
394
|
0 |
0 |
if(line==NULL) /* remove empty line before eof.*/ |
|
395
|
0 |
0 |
{ if(last_blank && box->separators) |
|
|
0 |
0 |
{ if(last_blank && box->separators) |
|
409
|
0 |
0 |
while(sep != NULL && !is_separator(sep, line)) |
|
|
0 |
0 |
while(sep != NULL && !is_separator(sep, line)) |
|
412
|
0 |
0 |
if(sep!=NULL) |
|
416
|
0 |
0 |
if(last_blank) /* Remove blank line before separator. */ |
|
430
|
0 |
0 |
if(box->strip_gt && line[0]=='>') |
|
|
0 |
0 |
if(box->strip_gt && line[0]=='>') |
|
432
|
0 |
0 |
while(*reader == '>') reader++; |
|
433
|
0 |
0 |
if(strncmp(reader, "From ", 5)==0) |
|
441
|
0 |
0 |
if(*nr_lines >= max_lines) |
|
483
|
0 |
0 |
if(*nr_lines == expect_lines && is_good_end(box, -1)) |
|
|
0 |
0 |
if(*nr_lines == expect_lines && is_good_end(box, -1)) |
|
486
|
0 |
0 |
if(file_position(box)-start == expect_chars && is_good_end(box,-1)) |
|
|
0 |
0 |
if(file_position(box)-start == expect_chars && is_good_end(box,-1)) |
|
490
|
0 |
0 |
if(line==NULL) |
|
492
|
0 |
0 |
if(last_blank && box->separators) |
|
|
0 |
0 |
if(last_blank && box->separators) |
|
506
|
0 |
0 |
while(sep != NULL && !is_separator(sep, line)) |
|
|
0 |
0 |
while(sep != NULL && !is_separator(sep, line)) |
|
509
|
0 |
0 |
if(sep!=NULL) |
|
512
|
0 |
0 |
if(last_blank) /* remove empty line before separator */ |
|
525
|
0 |
0 |
if(box->strip_gt && line[0]=='>') |
|
|
0 |
0 |
if(box->strip_gt && line[0]=='>') |
|
527
|
0 |
0 |
while(*reader == '>') reader++; |
|
528
|
0 |
0 |
if(strncmp(reader, "From ", 5)==0) |
|
561
|
0 |
0 |
SvGROW(result, tocopy); |
|
|
0 |
0 |
SvGROW(result, tocopy); |
|
564
|
0 |
0 |
while(tocopy > 0 && bytes > 0) |
|
|
0 |
0 |
while(tocopy > 0 && bytes > 0) |
|
598
|
0 |
0 |
if(file==NULL) |
|
609
|
0 |
0 |
RETVAL = boxnr; |
|
632
|
0 |
0 |
RETVAL = boxnr; |
|
651
|
0 |
0 |
if(box==NULL) return; |
|
655
|
0 |
0 |
if(box->file != NULL) |
|
661
|
0 |
0 |
while(sep!=NULL) |
|
685
|
0 |
0 |
if(box==NULL) return; |
|
698
|
0 |
0 |
if(strncmp(sep->line, "From ", sep->length)==0) |
|
715
|
0 |
0 |
if(box==NULL) XSRETURN_UNDEF; |
|
718
|
0 |
0 |
if(old==NULL) XSRETURN_UNDEF; |
|
720
|
0 |
0 |
if(strncmp(old->line, "From ", old->length)==0) |
|
746
|
0 |
0 |
if(box==NULL) RETVAL = 0; |
|
765
|
0 |
0 |
if(box==NULL) RETVAL = 0; |
|
791
|
0 |
0 |
if(box==NULL || box->file==NULL) return; |
|
|
0 |
0 |
if(box==NULL || box->file==NULL) return; |
|
793
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv((IV)file_position(box)))); |
|
794
|
0 |
0 |
XPUSHs(end = sv_newmortal()); |
|
796
|
0 |
0 |
while(read_header_line(box, &name, &content)) |
|
800
|
0 |
0 |
XPUSHs(sv_2mortal(newRV_noinc((SV *)field))); |
|
818
|
0 |
0 |
if(box==NULL) |
|
821
|
0 |
0 |
RETVAL = box->dosmode; |
|
843
|
0 |
0 |
if(box==NULL) |
|
847
|
0 |
0 |
if(sep==NULL) |
|
851
|
0 |
0 |
while(line!=NULL && line[0]=='\n' && line[1]==EOL) |
|
|
0 |
0 |
while(line!=NULL && line[0]=='\n' && line[1]==EOL) |
|
|
0 |
0 |
while(line!=NULL && line[0]=='\n' && line[1]==EOL) |
|
854
|
0 |
0 |
if(line==NULL) /* EOF reached. */ |
|
857
|
0 |
0 |
if(strncmp(sep->line, line, sep->length)!=0) |
|
862
|
0 |
0 |
EXTEND(SP, 2); |
|
888
|
0 |
0 |
if(box==NULL) |
|
893
|
0 |
0 |
if(!box->dosmode && !box->strip_gt && expect_chars >=0) |
|
|
0 |
0 |
if(!box->dosmode && !box->strip_gt && expect_chars >=0) |
|
|
0 |
0 |
if(!box->dosmode && !box->strip_gt && expect_chars >=0) |
|
897
|
0 |
0 |
if(is_good_end(box, end)) |
|
898
|
0 |
0 |
{ EXTEND(SP, 3); |
|
909
|
0 |
0 |
if(lines==NULL) |
|
914
|
0 |
0 |
SvGROW(result, (unsigned int)nr_chars); |
|
|
0 |
0 |
SvGROW(result, (unsigned int)nr_chars); |
|
916
|
0 |
0 |
for(line_nr=0; line_nr
|
|
924
|
0 |
0 |
EXTEND(SP, 3); |
|
949
|
0 |
0 |
if(box==NULL) |
|
956
|
0 |
0 |
if(lines==NULL) return; |
|
958
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(begin))); |
|
959
|
0 |
0 |
XPUSHs(sv_2mortal(newSViv(file_position(box)))); |
|
966
|
0 |
0 |
for(line_nr=0; line_nr
|
|
972
|
0 |
0 |
XPUSHs(sv_2mortal(newRV((SV *)results))); |
|
996
|
0 |
0 |
if(box==NULL) |
|
1003
|
0 |
0 |
if(lines==NULL) |
|
1006
|
0 |
0 |
EXTEND(SP, 3); |
|
1013
|
0 |
0 |
for(line_nr=0; line_nr
|
|
1038
|
0 |
0 |
if(box==NULL) |
|
1043
|
0 |
0 |
if(expect_chars >=0) |
|
1046
|
0 |
0 |
if(is_good_end(box, end)) |
|
1050
|
0 |
0 |
EXTEND(SP, 4); |
|
1060
|
0 |
0 |
if(scan_stripped_lines(box, expect_chars, expect_lines, |
|
1062
|
0 |
0 |
{ EXTEND(SP, 4); |
|
1082
|
0 |
0 |
if(box==NULL) XSRETURN_UNDEF; |