X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/2b84abb596f52ab2068d52108adc96838ad4340a..31cef89cb428866f787983e68246030321893df4:/usr/src/cmd/pi/subr.c diff --git a/usr/src/cmd/pi/subr.c b/usr/src/cmd/pi/subr.c index 4aa269f1a4..a02db2cc89 100644 --- a/usr/src/cmd/pi/subr.c +++ b/usr/src/cmd/pi/subr.c @@ -1,18 +1,8 @@ /* 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 @@ -37,7 +27,7 @@ togopt(c) { register char *tp; - tp = &opts[c-'a']; + tp = &opt( c ); *tp = 1 - *tp; } @@ -105,9 +95,15 @@ Perror(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); +*/ } int * @@ -199,7 +195,7 @@ opush(c) register CHAR c; { - c -= 'a'; + c -= 'A'; optstk[c] <<= 1; optstk[c] |= opts[c]; opts[c] = 1; @@ -212,7 +208,7 @@ opop(c) register CHAR c; { - c -= 'a'; + c -= 'A'; opts[c] = optstk[c] & 1; optstk[c] >>= 1; #ifdef PI0