add man page, cleanup
[unix-history] / usr / src / old / vfilters / necf / necf.c
CommitLineData
fa32567f
DF
1/*
2 * Copyright (c) 1983 Regents of the University of California.
9b0a4950
KB
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are permitted
a399f6c8
KB
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
fa32567f
DF
16 */
17
c936af6c 18#ifndef lint
9b0a4950
KB
19char copyright[] =
20"@(#) Copyright (c) 1983 Regents of the University of California.\n\
21 All rights reserved.\n";
22#endif /* not lint */
23
24#ifndef lint
a399f6c8 25static char sccsid[] = "@(#)necf.c 5.4 (Berkeley) %G%";
9b0a4950 26#endif /* not lint */
c936af6c 27
ad2055c1
BJ
28#include <stdio.h>
29#include <sgtty.h>
ad2055c1 30
3c783019
SL
31#define PAGESIZE 66
32
ad2055c1
BJ
33main()
34{
3c783019
SL
35 extern char *rindex();
36 char line[256];
37 register char c, *cp;
38 register lnumber;
ad2055c1 39
fb21b3a2 40#ifdef SHEETFEEDER
3c783019 41 printf("\033=\033\033\033O\f");
fb21b3a2
SL
42#else
43 printf("\033=");
44#endif
3c783019
SL
45 lnumber = 0;
46 while (fgets(line, sizeof(line), stdin) != NULL) {
fb21b3a2 47#ifdef SHEETFEEDER
3c783019
SL
48 if (lnumber == PAGESIZE-1) {
49 putchar('\f');
50 lnumber = 0;
51 }
52 if (lnumber >= 2) {
fb21b3a2 53#endif
f5e7cf14 54#ifdef TTY
3c783019
SL
55 if ((cp = rindex(line, '\n')) != NULL)
56 *cp = '\r';
f5e7cf14 57#endif
3c783019 58 printf("%s", line);
fb21b3a2 59#ifdef SHEETFEEDER
3c783019
SL
60 }
61 lnumber++;
fb21b3a2 62#endif
3c783019 63 }
ad2055c1
BJ
64 fflush (stdout);
65}