/* Copyright (c) 1979 Regents of the University of California */
static char sccsid
[] = "@(#)pc2.c 1.10 6/8/81";
* The hash table must be at least twice as big as the number
* of patterns, preferably bigger. It must also be a prime number
movc5 $0,(r3),$0,r0,(r3)\n\
movc5 $0,(r3),$0,r0,(r3)\n" },
movc3 r1,__disply+8,8(r0)[r1]\n\
movc3 r1,8(r0),__disply+8\n" },
movc3 r1,8(r0)[r1],__disply+8\n" },
movc3 r1,__disply+8,8(r0)\n\
bisl3 (r1)+,(r2)+,(r3)+\n\
bicl3 (r2)+,(r1)+,(r3)+\n\
struct pats
*htbl
[HSHSIZ
];
hash = 0; rehash = 1; ccp = cp; \
} while (*ccp && *ccp != '\n'); \
hash >>= 7; hash %= HSHSIZ; hp = &htbl[hash]; size = ccp - cp + 1; \
hp += rehash; rehash += 2; \
if (hp >= &htbl[HSHSIZ]) \
register struct pats
*pp
;
register struct pats
**hp
;
register char *cp
, *ccp
, *lp
;
register int hash
, rehash
, size
;
freopen(argv
[1], "r", stdin
);
freopen(argv
[2], "w", stdout
);
for(pp
= ptab
; pp
< &ptab
[sizeof ptab
/sizeof ptab
[0]]; pp
++) {
* check each line and replace as appropriate
while (fgets(line
, BUFSIZ
, stdin
)) {
for (cp
= (lp
!= NULL
) ? ++lp
: line
; *cp
== '\t'; )
if (strcmpn(cp
, "calls\t$", 7) != 0) {
if (strcmpn((*hp
)->name
, cp
, size
)==NULL
) {
fputs((*hp
)->replace
, stdout
);