Add define for Kirk Smith's USR Courier driver. Change default baud
[unix-history] / usr / src / usr.bin / mail / main.c
index 5ab4d3c..218e349 100644 (file)
@@ -1,4 +1,18 @@
-#
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ */
+
+#ifndef lint
+char *copyright =
+"@(#) Copyright (c) 1980 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif not lint
+
+#ifndef lint
+static char *sccsid = "@(#)main.c      5.3 (Berkeley) %G%";
+#endif not lint
 
 #include "rcv.h"
 #include <sys/stat.h>
 
 #include "rcv.h"
 #include <sys/stat.h>
@@ -9,8 +23,6 @@
  * Startup -- interface with user.
  */
 
  * Startup -- interface with user.
  */
 
-static char *SccsId = "@(#)main.c      2.8 %G%";
-
 jmp_buf        hdrjmp;
 
 /*
 jmp_buf        hdrjmp;
 
 /*
@@ -31,7 +43,6 @@ main(argc, argv)
        register int i, argp;
        int mustsend, uflag, hdrstop(), (*prevint)(), f;
        FILE *ibuf, *ftat;
        register int i, argp;
        int mustsend, uflag, hdrstop(), (*prevint)(), f;
        FILE *ibuf, *ftat;
-       extern char _sobuf[];
        struct sgttyb tbuf;
 
 #ifdef signal
        struct sgttyb tbuf;
 
 #ifdef signal
@@ -47,6 +58,9 @@ main(argc, argv)
 
        uflag = 0;
        argv[argc] = (char *) -1;
 
        uflag = 0;
        argv[argc] = (char *) -1;
+#ifdef GETHOST
+       inithost();
+#endif GETHOST
        mypid = getpid();
        intty = isatty(0);
        outtty = isatty(1);
        mypid = getpid();
        intty = isatty(0);
        outtty = isatty(1);
@@ -57,7 +71,6 @@ main(argc, argv)
        else
                baud = B9600;
        image = -1;
        else
                baud = B9600;
        image = -1;
-       setbuf(stdout, _sobuf);
 
        /*
         * Now, determine how we are being used.
 
        /*
         * Now, determine how we are being used.
@@ -204,6 +217,20 @@ main(argc, argv)
                        noheader++;
                        break;
 
                        noheader++;
                        break;
 
+               case 'v':
+                       /*
+                        * Send mailer verbose flag
+                        */
+                       assign("verbose", "");
+                       break;
+
+               case 'I':
+                       /*
+                        * We're interactive
+                        */
+                       intty = 1;
+                       break;
+
                default:
                        fprintf(stderr, "Unknown flag: %s\n", argv[i]);
                        exit(1);
                default:
                        fprintf(stderr, "Unknown flag: %s\n", argv[i]);
                        exit(1);
@@ -263,17 +290,15 @@ main(argc, argv)
                        fprintf(stderr, "No mail for %s\n", myname);
                exit(1);
        }
                        fprintf(stderr, "No mail for %s\n", myname);
                exit(1);
        }
-       if (!edit && !noheader && value("noheader") == NOSTR) {
+       if (!noheader && value("noheader") == NOSTR) {
                if (setjmp(hdrjmp) == 0) {
                        if ((prevint = sigset(SIGINT, SIG_IGN)) != SIG_IGN)
                                sigset(SIGINT, hdrstop);
                if (setjmp(hdrjmp) == 0) {
                        if ((prevint = sigset(SIGINT, SIG_IGN)) != SIG_IGN)
                                sigset(SIGINT, hdrstop);
-                       announce();
+                       announce(!0);
                        fflush(stdout);
                        sigset(SIGINT, prevint);
                }
        }
                        fflush(stdout);
                        sigset(SIGINT, prevint);
                }
        }
-       if (edit)
-               newfileinfo();
        if (!edit && msgCount == 0) {
                printf("No mail\n");
                fflush(stdout);
        if (!edit && msgCount == 0) {
                printf("No mail\n");
                fflush(stdout);
@@ -295,9 +320,7 @@ main(argc, argv)
 hdrstop()
 {
 
 hdrstop()
 {
 
-       clrbuf(stdout);
-       printf("\nInterrupt\n");
        fflush(stdout);
        fflush(stdout);
-       sigrelse(SIGINT);
+       fprintf(stderr, "\nInterrupt\n");
        longjmp(hdrjmp, 1);
 }
        longjmp(hdrjmp, 1);
 }