BSD 4 release
[unix-history] / usr / src / cmd / pi / subr.c
index 4aa269f..a02db2c 100644 (file)
@@ -1,18 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 /* Copyright (c) 1979 Regents of the University of California */
-#include "whoami"
-/*
- * pi - Pascal interpreter code translator
- *
- * Charles Haley, Bill Joy UCB
- * Version 1.2 November 1978
- *
- *
- * pxp - Pascal execution profiler
- *
- * Bill Joy UCB
- * Version 1.2 November 1978
- */
 
 
+static char sccsid[] = "@(#)subr.c 1.2 11/13/80";
+
+#include "whoami.h"
 #include "0.h"
 
 #ifndef PI1
 #include "0.h"
 
 #ifndef PI1
@@ -37,7 +27,7 @@ togopt(c)
 {
        register char *tp;
 
 {
        register char *tp;
 
-       tp = &opts[c-'a'];
+       tp = &opt( c );
        *tp = 1 - *tp;
 }
 
        *tp = 1 - *tp;
 }
 
@@ -105,9 +95,15 @@ Perror(file, error)
        char *file, *error;
 {
 
        char *file, *error;
 {
 
+       write(2, file, strlen(file));
+       write(2, ": ", 2);
+       write(2, error, strlen(error));
+       write(2, "\n", 1);
+/*
        errno = 0;
        sys_errlist[0] = error;
        perror(file);
        errno = 0;
        sys_errlist[0] = error;
        perror(file);
+*/
 }
 
 int *
 }
 
 int *
@@ -199,7 +195,7 @@ opush(c)
        register CHAR c;
 {
 
        register CHAR c;
 {
 
-       c -= 'a';
+       c -= 'A';
        optstk[c] <<= 1;
        optstk[c] |= opts[c];
        opts[c] = 1;
        optstk[c] <<= 1;
        optstk[c] |= opts[c];
        opts[c] = 1;
@@ -212,7 +208,7 @@ opop(c)
        register CHAR c;
 {
 
        register CHAR c;
 {
 
-       c -= 'a';
+       c -= 'A';
        opts[c] = optstk[c] & 1;
        optstk[c] >>= 1;
 #ifdef PI0
        opts[c] = optstk[c] & 1;
        optstk[c] >>= 1;
 #ifdef PI0