/* rev.c - reverse chars within each line */ /* ufilter2.c - prototype filter program - line (actually record) oriented */ #include #include #define BUFSIZ 4096 char buffer[BUFSIZ]; extern int $$ferr; main(argc,argv) char **argv; BEGIN register int howlong; /* char length of this record */ register char temp,*p,*q; WHILE (!feof(stdin)) DO howlong = fget(buffer,BUFSIZ,stdin); IF (ferror(stdin)) THEN error("read failure $$ferr=%oo\7\n",$$ferr); FI; IF (feof(stdin)) THEN exit(); FI; FOR (p=buffer,q=buffer+howlong-2; p