1 #ifndef lint 2 static char sccsid[] = "@(#)necf.c 1.7 (Berkeley) 07/16/83"; 3 #endif 4 5 #include <stdio.h> 6 #include <sgtty.h> 7 8 #define PAGESIZE 66 9 10 main() 11 { 12 extern char _sobuf[BUFSIZ]; 13 extern char *rindex(); 14 char line[256]; 15 register char c, *cp; 16 register lnumber; 17 18 setbuf(stdout, _sobuf); 19 #ifdef SHEETFEEDER 20 printf("\033=\033\033\033O\f"); 21 #else 22 printf("\033="); 23 #endif 24 lnumber = 0; 25 while (fgets(line, sizeof(line), stdin) != NULL) { 26 #ifdef SHEETFEEDER 27 if (lnumber == PAGESIZE-1) { 28 putchar('\f'); 29 lnumber = 0; 30 } 31 if (lnumber >= 2) { 32 #endif 33 #ifdef TTY 34 if ((cp = rindex(line, '\n')) != NULL) 35 *cp = '\r'; 36 #endif 37 printf("%s", line); 38 #ifdef SHEETFEEDER 39 } 40 lnumber++; 41 #endif 42 } 43 fflush (stdout); 44 } 45