add man page, cleanup
[unix-history] / usr / src / old / vfilters / necf / necf.c
index ae4e623..e5010d5 100644 (file)
@@ -1,30 +1,42 @@
-/*     necf.c  1.3     81/06/01        */
+/*
+ * Copyright (c) 1983 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef lint
+char copyright[] =
+"@(#) Copyright (c) 1983 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif /* not lint */
+
+#ifndef lint
+static char sccsid[] = "@(#)necf.c     5.4 (Berkeley) %G%";
+#endif /* not lint */
+
 #include <stdio.h>
 #include <sgtty.h>
 #include <stdio.h>
 #include <sgtty.h>
-#include <signal.h>
 
 #define PAGESIZE       66
 
 
 #define PAGESIZE       66
 
-struct sgttyb tty;
-
 main()
 {
 main()
 {
-       extern char _sobuf[BUFSIZ];
        extern char *rindex();
        char line[256];
        register char c, *cp;
        register lnumber;
 
        extern char *rindex();
        char line[256];
        register char c, *cp;
        register lnumber;
 
-       signal(SIGINT, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
-       signal(SIGHUP, SIG_IGN);
-
-       tty.sg_ispeed = tty.sg_ospeed = B9600;
-       tty.sg_erase = tty.sg_kill = -1;
-       tty.sg_flags = (ANYP|XTABS|LDECCTQ);
-       if (ioctl(1, TIOCSETP, (char *)&tty) < 0)
-               exit (2);
-       setbuf(stdout, _sobuf);
 #ifdef SHEETFEEDER
        printf("\033=\033\033\033O\f");
 #else
 #ifdef SHEETFEEDER
        printf("\033=\033\033\033O\f");
 #else
@@ -39,8 +51,10 @@ main()
                }
                if (lnumber >= 2) {
 #endif
                }
                if (lnumber >= 2) {
 #endif
+#ifdef TTY
                        if ((cp = rindex(line, '\n')) != NULL)
                                *cp = '\r';
                        if ((cp = rindex(line, '\n')) != NULL)
                                *cp = '\r';
+#endif
                        printf("%s", line);
 #ifdef SHEETFEEDER
                }
                        printf("%s", line);
 #ifdef SHEETFEEDER
                }