|
|
1.1 ! root 1: /* @(#)genbsubs.c 1.1 */ ! 2: ! 3: /* The output of bunequal is the offset of the byte which didn't match; ! 4: * if all the bytes match, then we return n. ! 5: * bunequal(s1, s2, n) */ ! 6: ! 7: int ! 8: bunequal(s1, s2, n) ! 9: register char *s1, *s2; ! 10: register n; ! 11: { ! 12: register int i = 0; ! 13: ! 14: while (i++ < n) { ! 15: if (*s1++ != *s2++) { ! 16: break; ! 17: } ! 18: } ! 19: return(i-1); ! 20: } ! 21: ! 22: /* bskip(s1, n, b) : finds the first occurrence of any byte != 'b' in the 'n' ! 23: * bytes beginning at 's1'. ! 24: */ ! 25: ! 26: int ! 27: bskip(s1, n, b) ! 28: register char *s1; ! 29: register int n; ! 30: register int b; ! 31: { ! 32: register int i = 0; ! 33: ! 34: while (i++ < n) { ! 35: if (*s1++ != b) { ! 36: break; ! 37: } ! 38: } ! 39: return(i-1); ! 40: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.