added "more" command
[unix-history] / usr / src / usr.bin / mt / mt.c
index fe91956..40d301a 100644 (file)
@@ -1,4 +1,19 @@
-static char *sccsid = "@(#)mt.c        4.6 (Berkeley) 83/02/08";
+/*
+ * 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[] = "@(#)mt.c       5.1 (Berkeley) %G%";
+#endif not lint
+
 /*
  * mt --
  *   magnetic tape manipulation program
 /*
  * mt --
  *   magnetic tape manipulation program
@@ -41,17 +56,17 @@ main(argc, argv)
        register char *cp;
        register struct commands *comp;
 
        register char *cp;
        register struct commands *comp;
 
-       if (argc < 2) {
-               fprintf(stderr, "usage: mt [ -f device ] command [ count ]\n");
-               exit(1);
-       }
-       if ((equal(argv[1], "-t") || equal(argv[1], "-f")) && argc > 2) {
+       if (argc > 2 && (equal(argv[1], "-t") || equal(argv[1], "-f"))) {
                argc -= 2;
                tape = argv[2];
                argv += 2;
        } else
                if ((tape = getenv("TAPE")) == NULL)
                        tape = DEFTAPE;
                argc -= 2;
                tape = argv[2];
                argv += 2;
        } else
                if ((tape = getenv("TAPE")) == NULL)
                        tape = DEFTAPE;
+       if (argc < 2) {
+               fprintf(stderr, "usage: mt [ -f device ] command [ count ]\n");
+               exit(1);
+       }
        cp = argv[1];
        for (comp = com; comp->c_name != NULL; comp++)
                if (strncmp(cp, comp->c_name, strlen(cp)) == 0)
        cp = argv[1];
        for (comp = com; comp->c_name != NULL; comp++)
                if (strncmp(cp, comp->c_name, strlen(cp)) == 0)
@@ -97,8 +112,8 @@ main(argc, argv)
 #endif
 
 #ifdef sun
 #endif
 
 #ifdef sun
-#include <sys/tmreg.h>
-#include <sys/arreg.h>
+#include <sundev/tmreg.h>
+#include <sundev/arreg.h>
 #endif
 
 struct tape_desc {
 #endif
 
 struct tape_desc {
@@ -116,7 +131,7 @@ struct tape_desc {
 #endif
 #ifdef sun
        { MT_ISCPC,     "TapeMaster",   TMS_BITS,       0 },
 #endif
 #ifdef sun
        { MT_ISCPC,     "TapeMaster",   TMS_BITS,       0 },
-       { MT_ISARCH,    "Archive",      ARCH_CTRL_BITS, ARCH_BITS },
+       { MT_ISAR,      "Archive",      ARCH_CTRL_BITS, ARCH_BITS },
 #endif
        { 0 }
 };
 #endif
        { 0 }
 };