version 1.32, 2003/07/09 00:39:26 |
version 1.33, 2003/07/15 23:17:56 |
|
|
static void output(char *, FILE *, char *, FILE *); |
static void output(char *, FILE *, char *, FILE *); |
static void check(char *, FILE *, char *, FILE *); |
static void check(char *, FILE *, char *, FILE *); |
static void range(int, int, char *); |
static void range(int, int, char *); |
|
static void uni_range(int, int); |
static void dump_context_vec(FILE *, FILE *); |
static void dump_context_vec(FILE *, FILE *); |
static void dump_unified_vec(FILE *, FILE *); |
static void dump_unified_vec(FILE *, FILE *); |
static void prepare(int, FILE *); |
static void prepare(int, FILE *); |
|
|
} |
} |
} |
} |
|
|
|
static __inline void |
|
range(int a, int b, char *separator) |
|
{ |
|
printf("%d", a > b ? b : a); |
|
if (a < b) |
|
printf("%s%d", separator, b); |
|
} |
|
|
|
static __inline void |
|
uni_range(int a, int b) |
|
{ |
|
if (a < b) |
|
printf("%d,%d", a, b - a + 1); |
|
else if (a == b) |
|
printf("%d", b); |
|
else |
|
printf("%d,0", b); |
|
} |
|
|
/* |
/* |
* The following struct is used to record change information when |
* The following struct is used to record change information when |
* doing a "context" or "unified" diff. (see routine "change" to |
* doing a "context" or "unified" diff. (see routine "change" to |
|
|
} |
} |
|
|
static void |
static void |
range(int a, int b, char *separator) |
|
{ |
|
printf("%d", a > b ? b : a); |
|
if (a < b) |
|
printf("%s%d", separator, b); |
|
} |
|
|
|
static void |
|
fetch(long *f, int a, int b, FILE *lb, char *s, int oldfile) |
fetch(long *f, int a, int b, FILE *lb, char *s, int oldfile) |
{ |
{ |
int i, j, c, col, nc; |
int i, j, c, col, nc; |
|
|
lowc = max(1, cvp->c - context); |
lowc = max(1, cvp->c - context); |
upd = min(len[1], context_vec_ptr->d + context); |
upd = min(len[1], context_vec_ptr->d + context); |
|
|
printf("@@ -%d,%d +%d,%d @@\n", lowa, upb - lowa + 1, |
fputs("@@ -", stdout); |
lowc, upd - lowc + 1); |
uni_range(lowa, upb); |
|
fputs(" +", stdout); |
|
uni_range(lowc, upd); |
|
fputs(" @@\n", stdout); |
|
|
/* |
/* |
* Output changes in "unified" diff format--the old and new lines |
* Output changes in "unified" diff format--the old and new lines |