Revision 3648,
970 bytes
checked in by epeisach, 34 years ago
(diff) |
Define _sobuf for AUX. C routine dos not define internally
|
Rev | Line | |
---|
[730] | 1 | /* |
---|
| 2 | * Copyright (c) 1983 Regents of the University of California. |
---|
| 3 | * All rights reserved. The Berkeley software License Agreement |
---|
| 4 | * specifies the terms and conditions for redistribution. |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | #ifndef lint |
---|
| 8 | static char sccsid[] = "@(#)necf.c 5.1 (Berkeley) 5/15/85"; |
---|
| 9 | #endif not lint |
---|
| 10 | |
---|
| 11 | #include <stdio.h> |
---|
| 12 | #include <sgtty.h> |
---|
| 13 | |
---|
| 14 | #define PAGESIZE 66 |
---|
| 15 | |
---|
[3648] | 16 | #ifdef _AUX_SOURCE |
---|
| 17 | char _sobuf[BUFSIZ]; |
---|
| 18 | #endif |
---|
| 19 | |
---|
[730] | 20 | main() |
---|
| 21 | { |
---|
| 22 | extern char _sobuf[BUFSIZ]; |
---|
| 23 | extern char *rindex(); |
---|
| 24 | char line[256]; |
---|
| 25 | register char c, *cp; |
---|
| 26 | register lnumber; |
---|
| 27 | |
---|
| 28 | setbuf(stdout, _sobuf); |
---|
| 29 | #ifdef SHEETFEEDER |
---|
| 30 | printf("\033=\033\033\033O\f"); |
---|
| 31 | #else |
---|
| 32 | printf("\033="); |
---|
| 33 | #endif |
---|
| 34 | lnumber = 0; |
---|
| 35 | while (fgets(line, sizeof(line), stdin) != NULL) { |
---|
| 36 | #ifdef SHEETFEEDER |
---|
| 37 | if (lnumber == PAGESIZE-1) { |
---|
| 38 | putchar('\f'); |
---|
| 39 | lnumber = 0; |
---|
| 40 | } |
---|
| 41 | if (lnumber >= 2) { |
---|
| 42 | #endif |
---|
| 43 | #ifdef TTY |
---|
| 44 | if ((cp = rindex(line, '\n')) != NULL) |
---|
| 45 | *cp = '\r'; |
---|
| 46 | #endif |
---|
| 47 | printf("%s", line); |
---|
| 48 | #ifdef SHEETFEEDER |
---|
| 49 | } |
---|
| 50 | lnumber++; |
---|
| 51 | #endif |
---|
| 52 | } |
---|
| 53 | fflush (stdout); |
---|
| 54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.