Lines Matching refs:f2
247 FILE *f1, *f2;
251 f1 = f2 = NULL;
328 f2 = fopen(_PATH_DEVNULL, "r");
331 if ((f2 = opentemp(file2)) == NULL ||
332 fstat(fileno(f2), &stb2) == -1) {
339 f2 = stdin;
341 f2 = fopen(file2, "r");
343 if (f2 == NULL) {
353 switch (files_differ(f1, f2, flags)) {
375 (void)prepare(1, f2, stb2.st_size, flags);
376 } else if (!asciifile(f1) || !asciifile(f2) ||
378 !prepare(1, f2, stb2.st_size, flags)) {
415 check(f1, f2, flags);
416 output(file1, f1, file2, f2, flags);
428 if (f2 != NULL)
429 fclose(f2);
440 files_differ(FILE *f1, FILE *f2, int flags)
454 j = fread(buf2, 1, sizeof(buf2), f2);
455 if ((!i && ferror(f1)) || (!j && ferror(f2)))
687 check(FILE *f1, FILE *f2, int flags)
693 rewind(f2);
704 ixnew[j] = ctnew += skipline(f2);
710 d = getc(f2);
735 if ((d = getc(f2)) == '\n') {
738 ungetc(d, f2);
754 } while (isspace(d = getc(f2)));
761 d = getc(f2);
771 ctnew += skipline(f2);
781 if ((c = getc(f1)) != (d = getc(f2))) {
787 ctnew += skipline(f2);
799 ixnew[j] = ctnew += skipline(f2);
864 output(char *file1, FILE *f1, char *file2, FILE *f2, int flags)
869 rewind(f2);
879 fetch(ixnew, J[i0], J[i0], f2, '\0', 0, flags);
901 change(file1, f1, file2, f2, i, i, j, j, &flags);
904 change(file1, f1, file2, f2, i, i, j + 1, j, &flags);
909 change(file1, f1, file2, f2, i + 1, i, j, j, &flags);
913 change(file1, f1, file2, f2, i0, i1, j0, j1, &flags);
925 change(file1, f1, file2, f2, i1, i0, j1, j0, &flags);
929 change(file1, f1, file2, f2, 1, 0, 1, len[1], &flags);
941 dump_context_vec(f1, f2, flags);
943 dump_unified_vec(f1, f2, flags);
1009 change(char *file1, FILE *f1, char *file2, FILE *f2, int a, int b, int c, int d,
1041 line = preadline(fileno(f2),
1085 dump_context_vec(f1, f2, *pflags);
1087 dump_unified_vec(f1, f2, *pflags);
1139 fetch(ixnew, c, d, f2, '>', 0, *pflags);
1159 fetch(ixnew, c, d, f2, '\0', 0, *pflags);
1168 fetch(ixnew, c, d, f2, diff_format == D_NORMAL ? '>' : '\0', 0, *pflags);
1429 dump_context_vec(FILE *f1, FILE *f2, int flags)
1516 fetch(ixnew, lowc, d, f2, ' ', 0, flags);
1518 fetch(ixnew, lowc, c - 1, f2, ' ', 0, flags);
1519 fetch(ixnew, c, d, f2,
1525 fetch(ixnew, d + 1, upd, f2, ' ', 0, flags);
1532 dump_unified_vec(FILE *f1, FILE *f2, int flags)
1584 fetch(ixnew, c, d, f2, '+', 0, flags);
1591 fetch(ixnew, lowc, c - 1, f2, ' ', 0, flags);
1592 fetch(ixnew, c, d, f2, '+', 0, flags);
1598 fetch(ixnew, d + 1, upd, f2, ' ', 0, flags);