Revision 6341,
1009 bytes
checked in by miki, 32 years ago
(diff) |
Define _sobuf for sun
|
Line | |
---|
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 | |
---|
16 | #ifdef _AUX_SOURCE |
---|
17 | char _sobuf[BUFSIZ]; |
---|
18 | #endif |
---|
19 | #ifdef sun |
---|
20 | char _sobuf[BUFSIZ]; |
---|
21 | #endif |
---|
22 | |
---|
23 | main() |
---|
24 | { |
---|
25 | extern char _sobuf[BUFSIZ]; |
---|
26 | extern char *rindex(); |
---|
27 | char line[256]; |
---|
28 | register char c, *cp; |
---|
29 | register lnumber; |
---|
30 | |
---|
31 | setbuf(stdout, _sobuf); |
---|
32 | #ifdef SHEETFEEDER |
---|
33 | printf("\033=\033\033\033O\f"); |
---|
34 | #else |
---|
35 | printf("\033="); |
---|
36 | #endif |
---|
37 | lnumber = 0; |
---|
38 | while (fgets(line, sizeof(line), stdin) != NULL) { |
---|
39 | #ifdef SHEETFEEDER |
---|
40 | if (lnumber == PAGESIZE-1) { |
---|
41 | putchar('\f'); |
---|
42 | lnumber = 0; |
---|
43 | } |
---|
44 | if (lnumber >= 2) { |
---|
45 | #endif |
---|
46 | #ifdef TTY |
---|
47 | if ((cp = rindex(line, '\n')) != NULL) |
---|
48 | *cp = '\r'; |
---|
49 | #endif |
---|
50 | printf("%s", line); |
---|
51 | #ifdef SHEETFEEDER |
---|
52 | } |
---|
53 | lnumber++; |
---|
54 | #endif |
---|
55 | } |
---|
56 | fflush (stdout); |
---|
57 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.