Lines Matching defs:c
1 /* $OpenBSD: diffreg.c,v 1.93 2019/06/28 13:35:00 deraadt Exp $ */
39 * Copyright (c) 1991, 1993
164 int c; /* start line in new file */
254 clow2low(int c)
257 return (c);
261 cup2low(int c)
264 return (tolower(c));
597 equiv(struct line *a, int n, struct line *b, int m, int *c)
615 c[j] = -b[j].serial;
618 c[j] = b[j].serial;
621 c[j] = -1;
625 stone(int *a, int n, int *b, int *c, int flags)
639 c[0] = newcand(0, 0, 0);
646 oldc = c[0];
651 l = search(c, k, y);
653 oldc = c[l - 1];
655 if (clist[c[l]].y <= y)
657 tc = c[l];
658 c[l] = newcand(i, y, oldc);
663 c[l] = newcand(i, y, oldc);
689 search(int *c, int k, int y)
693 if (clist[c[k]].y < y) /* quick look for typical case */
701 t = clist[c[l]].y;
734 int i, j, /* jackpot, */ c, d;
754 c = getc(f1);
761 if (c == EOF && isspace(d)) {
764 } else if (isspace(c) && d == EOF) {
771 if (flags & D_STRIPCR && (c == '\r' || d == '\r')) {
772 if (c == '\r') {
773 if ((c = getc(f1)) == '\n') {
776 ungetc(c, f1);
788 if ((flags & D_FOLDBLANKS) && isspace(c) &&
791 if (c == '\n')
794 } while (isspace(c = getc(f1)));
801 while (isspace(c) && c != '\n') {
802 c = getc(f1);
810 if (chrtran(c) != chrtran(d)) {
813 if (c != '\n' && c != EOF)
815 if (d != '\n' && c != EOF)
819 if (c == '\n' || c == EOF)
826 if ((c = getc(f1)) != (d = getc(f2))) {
829 if (c != '\n' && c != EOF)
831 if (d != '\n' && c != EOF)
835 if (c == '\n' || c == EOF)
901 int i, c;
903 for (i = 1; (c = getc(f)) != '\n' && c != EOF; i++)
977 #define c i0
978 if ((c = getc(f1)) == EOF)
980 printf("%c", c);
982 #undef c
1048 * to get to lines c to d of the to file. If a is greater then b then there
1050 * lines appended (beginning at b). If c is greater than d then there are
1054 change(char *file1, FILE *f1, char *file2, FILE *f2, int a, int b, int c, int d,
1066 a > b && c > d)
1084 if (a > b || c <= d) { /* Changes and inserts. */
1085 for (i = c; i <= d; i++) {
1124 c > context_vec_ptr->d + (2 * diff_context) + 1) {
1137 context_vec_ptr->c = c;
1149 printf("%c", a > b ? 'a' : c > d ? 'd' : 'c');
1151 range(c, d, ",");
1155 printf("%c", a > b ? 'a' : c > d ? 'd' : 'c');
1161 printf("a%d %d\n", b, d - c + 1);
1164 if (!(c > d))
1166 printf("a%d %d\n", b, d - c + 1);
1175 printf("%c", getc(f1));
1184 fetch(ixnew, c, d, f2, '>', 0, *pflags);
1187 printf("%%%c", *walk);
1192 printf("%c", *walk);
1198 else if (color && c > d)
1208 else if (color && c > d)
1210 printf("%c", (a > b) ? '>' : ((c > d) ? '<' : '|'));
1211 if (color && c > d)
1214 fetch(ixnew, c, d, f2, '\0', 0, *pflags);
1219 if (a <= b && c <= d && diff_format == D_NORMAL)
1223 fetch(ixnew, c, d, f2, diff_format == D_NORMAL ? '>' : '\0', 0, *pflags);
1236 c += edoffset;
1239 if ((diff_format == D_EDIT || diff_format == D_REVERSE) && c <= d)
1250 int i, j, c, lastc, col, nc, newcol;
1264 printf("%c", getc(lb));
1291 printf("%c", ch);
1302 c = getc(lb);
1303 if (flags & D_STRIPCR && c == '\r') {
1304 if ((c = getc(lb)) == '\n')
1307 ungetc(c, lb);
1308 c = '\r';
1311 if (c == EOF) {
1324 if (c == '\t') {
1343 if (diff_format == D_EDIT && j == 1 && c == '\n' &&
1356 if (diff_format != D_SIDEBYSIDE || c != '\n') {
1357 if (color && c == '\n')
1358 printf("\033[m%c", c);
1360 printf("%c", c);
1366 lastc = c;
1502 int a, b, c, d;
1511 lowc = MAX(1, cvp->c - diff_context);
1540 c = cvp->c;
1543 if (a <= b && c <= d)
1544 ch = 'c';
1553 ch == 'c' ? '!' : '-', 0, flags);
1567 if (cvp->c <= cvp->d) {
1576 c = cvp->c;
1579 if (a <= b && c <= d)
1580 ch = 'c';
1587 fetch(ixnew, lowc, c - 1, f2, ' ', 0, flags);
1588 fetch(ixnew, c, d, f2,
1589 ch == 'c' ? '!' : '+', 0, flags);
1605 int a, b, c, d;
1614 lowc = MAX(1, cvp->c - diff_context);
1636 c = cvp->c;
1640 * c: both new and old changes
1644 if (a <= b && c <= d)
1645 ch = 'c';
1650 case 'c':
1653 fetch(ixnew, c, d, f2, '+', 0, flags);
1660 fetch(ixnew, lowc, c - 1, f2, ' ', 0, flags);
1661 fetch(ixnew, c, d, f2, '+', 0, flags);
1684 time_format = "%c";