move the text of error messages from ERROR to the functions
authorKirk McKusick <mckusic@ucbvax.Berkeley.EDU>
Wed, 10 Jun 1981 15:45:29 +0000 (07:45 -0800)
committerKirk McKusick <mckusic@ucbvax.Berkeley.EDU>
Wed, 10 Jun 1981 15:45:29 +0000 (07:45 -0800)
which generate them.

SCCS-vsn: usr.bin/pascal/libpc/ARGV.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/ASRT.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/CHR.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/CTTOT.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/DISPOSE.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/ERROR.c 1.8
SCCS-vsn: usr.bin/pascal/libpc/FLUSH.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/FNIL.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/GET.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/GETNAME.c 1.6
SCCS-vsn: usr.bin/pascal/libpc/HALT.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/IOSYNC.c 1.5
SCCS-vsn: usr.bin/pascal/libpc/LINO.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/LLIMIT.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/LN.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/MAX.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/NAM.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/NEW.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/NIL.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/PACK.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/PAGE.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/PCLOSE.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/PCSTART.c 1.5
SCCS-vsn: usr.bin/pascal/libpc/PRED.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/PUT.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/RANG4.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/READ4.c 1.5
SCCS-vsn: usr.bin/pascal/libpc/READ8.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/READC.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/READE.c 1.5
SCCS-vsn: usr.bin/pascal/libpc/READLN.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/REMOVE.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/RESET.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/REWRITE.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/RSNG4.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/SEEK.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/SQRT.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/STLIM.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/SUBSC.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/SUBSCZ.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/SUCC.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/TEOF.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/TEOLN.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/UNIT.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/UNPACK.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/UNSYNC.c 1.3
SCCS-vsn: usr.bin/pascal/libpc/WRITEC.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/WRITEF.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/WRITES.c 1.4
SCCS-vsn: usr.bin/pascal/libpc/WRITLN.c 1.2
SCCS-vsn: usr.bin/pascal/libpc/h00vars.h 1.7
SCCS-vsn: usr.bin/pascal/libpc/Makefile 1.8
SCCS-vsn: usr.bin/pascal/libpc/APPEND.c 1.2

53 files changed:
usr/src/usr.bin/pascal/libpc/APPEND.c
usr/src/usr.bin/pascal/libpc/ARGV.c
usr/src/usr.bin/pascal/libpc/ASRT.c
usr/src/usr.bin/pascal/libpc/CHR.c
usr/src/usr.bin/pascal/libpc/CTTOT.c
usr/src/usr.bin/pascal/libpc/DISPOSE.c
usr/src/usr.bin/pascal/libpc/ERROR.c
usr/src/usr.bin/pascal/libpc/FLUSH.c
usr/src/usr.bin/pascal/libpc/FNIL.c
usr/src/usr.bin/pascal/libpc/GET.c
usr/src/usr.bin/pascal/libpc/GETNAME.c
usr/src/usr.bin/pascal/libpc/HALT.c
usr/src/usr.bin/pascal/libpc/IOSYNC.c
usr/src/usr.bin/pascal/libpc/LINO.c
usr/src/usr.bin/pascal/libpc/LLIMIT.c
usr/src/usr.bin/pascal/libpc/LN.c
usr/src/usr.bin/pascal/libpc/MAX.c
usr/src/usr.bin/pascal/libpc/Makefile
usr/src/usr.bin/pascal/libpc/NAM.c
usr/src/usr.bin/pascal/libpc/NEW.c
usr/src/usr.bin/pascal/libpc/NIL.c
usr/src/usr.bin/pascal/libpc/PACK.c
usr/src/usr.bin/pascal/libpc/PAGE.c
usr/src/usr.bin/pascal/libpc/PCLOSE.c
usr/src/usr.bin/pascal/libpc/PCSTART.c
usr/src/usr.bin/pascal/libpc/PRED.c
usr/src/usr.bin/pascal/libpc/PUT.c
usr/src/usr.bin/pascal/libpc/RANG4.c
usr/src/usr.bin/pascal/libpc/READ4.c
usr/src/usr.bin/pascal/libpc/READ8.c
usr/src/usr.bin/pascal/libpc/READC.c
usr/src/usr.bin/pascal/libpc/READE.c
usr/src/usr.bin/pascal/libpc/READLN.c
usr/src/usr.bin/pascal/libpc/REMOVE.c
usr/src/usr.bin/pascal/libpc/RESET.c
usr/src/usr.bin/pascal/libpc/REWRITE.c
usr/src/usr.bin/pascal/libpc/RSNG4.c
usr/src/usr.bin/pascal/libpc/SEEK.c
usr/src/usr.bin/pascal/libpc/SQRT.c
usr/src/usr.bin/pascal/libpc/STLIM.c
usr/src/usr.bin/pascal/libpc/SUBSC.c
usr/src/usr.bin/pascal/libpc/SUBSCZ.c
usr/src/usr.bin/pascal/libpc/SUCC.c
usr/src/usr.bin/pascal/libpc/TEOF.c
usr/src/usr.bin/pascal/libpc/TEOLN.c
usr/src/usr.bin/pascal/libpc/UNIT.c
usr/src/usr.bin/pascal/libpc/UNPACK.c
usr/src/usr.bin/pascal/libpc/UNSYNC.c
usr/src/usr.bin/pascal/libpc/WRITEC.c
usr/src/usr.bin/pascal/libpc/WRITEF.c
usr/src/usr.bin/pascal/libpc/WRITES.c
usr/src/usr.bin/pascal/libpc/WRITLN.c
usr/src/usr.bin/pascal/libpc/h00vars.h

index abb00a4..4c0e1a2 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)APPEND.c 1.1 %G%";
+static char sccsid[] = "@(#)APPEND.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 APPEND(filep)
 
 
 APPEND(filep)
 
@@ -12,7 +11,7 @@ APPEND(filep)
        filep = GETNAME (filep, 0, 0, 0);
        filep->fbuf = fopen(filep->fname, "a");
        if (filep->fbuf == NULL) {
        filep = GETNAME (filep, 0, 0, 0);
        filep->fbuf = fopen(filep->fname, "a");
        if (filep->fbuf == NULL) {
-               ERROR(EOPEN, filep->pfname);
+               PERROR("Could not open ", filep->pfname);
                return;
        }
        filep->funit |= (EOFF | FWRITE);
                return;
        }
        filep->funit |= (EOFF | FWRITE);
index 2f0255b..4332561 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)ARGV.c 1.2 %G%";
+static char sccsid[] = "@(#)ARGV.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 ARGV(subscript, var, siz)
 
 
 ARGV(subscript, var, siz)
 
@@ -15,7 +14,7 @@ ARGV(subscript, var, siz)
        register int    size = siz;
 
        if (subscript >= _argc) {
        register int    size = siz;
 
        if (subscript >= _argc) {
-               ERROR(EARGV, subscript);
+               ERROR("Argument to argv of %D is out of range\n", subscript);
                return;
        }
        cp = _argv[subscript];
                return;
        }
        cp = _argv[subscript];
index fdb9bd1..02043a9 100644 (file)
@@ -1,8 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)ASRT.c 1.1 %G%";
+static char sccsid[] = "@(#)ASRT.c 1.2 %G%";
 
 
-#include "h01errs.h"
+#define NULL 0
 
 ASRT(cond, stmt)
 
 
 ASRT(cond, stmt)
 
@@ -11,5 +11,11 @@ ASRT(cond, stmt)
 {
        if (cond)
                return;
 {
        if (cond)
                return;
-       ERROR(EASRT, stmt);
+       if (stmt != NULL) {
+               ERROR("Assertion failed: %s\n", stmt);
+               return;
+       } else {
+               ERROR("Assertion failed\n", 0);
+               return;
+       }
 }
 }
index 1320484..cc7fdd3 100644 (file)
@@ -1,8 +1,7 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)CHR.c 1.2 %G%";
+static char sccsid[] = "@(#)CHR.c 1.3 %G%";
 
 
-#include "h01errs.h"
 
 char
 CHR(value)
 
 char
 CHR(value)
@@ -10,7 +9,7 @@ CHR(value)
        long    value;
 {
        if (value < 0 || value > 127) {
        long    value;
 {
        if (value < 0 || value > 127) {
-               ERROR(ECHR, value);
+               ERROR("Argument to chr of %D is out of range\n", value);
                return;
        }
        return (char)value;
                return;
        }
        return (char)value;
index f49b983..ea3362a 100644 (file)
@@ -1,10 +1,9 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)CTTOT.c 1.3 %G%";
+static char sccsid[] = "@(#)CTTOT.c 1.4 %G%";
 
 #include "whoami.h"
 #include "h00vars.h"
 
 #include "whoami.h"
 #include "h00vars.h"
-#include "h01errs.h"
 
 long   _mask[] = {     
 #              ifdef DEC11
 
 long   _mask[] = {     
 #              ifdef DEC11
index fabedf3..ce55404 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)DISPOSE.c 1.2 %G%";
+static char sccsid[] = "@(#)DISPOSE.c 1.3 %G%";
 
 #include       "h00vars.h"
 
 #include       "h00vars.h"
-#include       "h01errs.h"
 
 DISPOSE(var, siz)
        register char   **var;  /* pointer to pointer being deallocated */
 
 DISPOSE(var, siz)
        register char   **var;  /* pointer to pointer being deallocated */
@@ -12,7 +11,7 @@ DISPOSE(var, siz)
        register int size = siz;
 
        if (*var == 0 || *var + size > _maxptr || *var < _minptr) {
        register int size = siz;
 
        if (*var == 0 || *var + size > _maxptr || *var < _minptr) {
-               ERROR(ENILPTR,0);
+               ERROR("Pointer value out of legal range\n", 0);
                return;
        }
        free(*var);
                return;
        }
        free(*var);
index c6d7cb3..42e2a69 100644 (file)
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)ERROR.c 1.7 %G%";
+static char sccsid[] = "@(#)ERROR.c 1.8 %G%";
 
 #include       <stdio.h>
 #include       <signal.h>
 #include       "h00vars.h"
 
 #include       <stdio.h>
 #include       <signal.h>
 #include       "h00vars.h"
-#include       "h01errs.h"
 
 /*
 
 /*
- * Routine ERROR is called from the runtime library when a runtime error
- * occurs. Its arguments are the internal number of the error which occurred,
- * and an error specific piece of error data. The error file is constructed
- * from errdata by the makefile using the editor script make.ed1.
+ * Routine ERROR is called from the runtime library when a runtime
+ * error occurs. Its arguments are a pointer to an error message and 
+ * an error specific piece of data.
  */
 long
  */
 long
-ERROR(msg, d1, d2, d3, d4)
+ERROR(msg, d1, d2)
 
        char    *msg;
 
        char    *msg;
-       int     d1, d2, d3, d4;
+       long    d1, d2;
 {
 {
-       union cvt {
-               int     intdat;
-               long    longdat;
-               char    *strngdat;
-               double  dbldat;
-       } errdata;
-
-       errdata.dbldat = 0.0;
-       errdata.intdat = d1;
        PFLUSH();
        fputc('\n',stderr);
        SETRACE();
        PFLUSH();
        fputc('\n',stderr);
        SETRACE();
-       switch ((int)msg) {
-       case ECHR:
-               fprintf(stderr, "Argument to chr of %D is out of range\n"
-                       ,errdata.longdat);
-               return(errdata.longdat);
-       case EHALT:
-               fputs("Call to procedure halt\n",stderr);
-               PCEXIT(0);
-       case ENILPTR:
-               fputs("Pointer value out of legal range\n",stderr);
-               return(0);
-       case EPASTEOF:
-               fprintf(stderr,"%s: Tried to read past end of file\n"
-                       ,errdata.strngdat);
-               return(0);
-       case EREADIT:
-               fprintf(stderr,"%s: Attempt to read, but open for writing\n"
-                       ,errdata.strngdat);
-               return(0);
-       case EWRITEIT:
-               fprintf(stderr,"%s: Attempt to write, but open for reading\n"
-                       ,errdata.strngdat);
-               return(0);
-       case ECLOSE:
-               fprintf(stderr,"%s: Close failed\n",errdata.strngdat);
-               return(0);
-       case ELLIMIT:
-               fprintf(stderr,"%s: Line limit exceeded\n",errdata.strngdat);
-               return(0);
-       case ESQRT:
-               fprintf(stderr,"Negative argument of %e to sqrt\n"
-                       ,errdata.dbldat);
-               return(errdata.dbldat);
-       case EREFINAF:
-               fprintf(stderr,"%s: ",errdata.strngdat);
-       case ENOFILE:
-               fputs("Reference to an inactive file\n",stderr);
-               return(0);
-       case EWRITE:
-               fputs("Could not write to ",stderr);
-               perror(errdata.strngdat);
-               return(0);
-       case EOPEN:
-               fputs("Could not open ",stderr);
-               perror(errdata.strngdat);
-               return(0);
-       case ECREATE:
-               fputs("Could not create ",stderr);
-               perror(errdata.strngdat);
-               return(0);
-       case EREMOVE:
-               fputs("Could not remove ",stderr);
-               perror(errdata.strngdat);
-               return(0);
-       case ESEEK:
-               fputs("Could not reset ",stderr);
-               perror(errdata.strngdat);
-               return(0);
-       case ENAMESIZE:
-               fprintf(stderr,"%s: File name too long\n",errdata.strngdat);
-               return(0);
-       case ELN:
-               fprintf(stderr,"Non-positive argument of %e to ln\n"
-                       ,errdata.dbldat);
-               return(errdata.dbldat);
-       case EBADINUM:
-               fprintf(stderr,"%s: Bad data found on integer read\n"
-                       ,errdata.strngdat);
-               return(0);
-       case EBADFNUM:
-               fprintf(stderr,"%s: Bad data found on real read\n"
-                       ,errdata.strngdat);
-               return(0);
-       case ENUMNTFD:
-               fprintf(stderr,
-                       "Unknown name \"%s\" found on enumerated type read\n",
-                       errdata.strngdat);
-               return(0);
-       case ENAMRNG:
-               fprintf(stderr,
-                       "Enumerated type value of %D is out of range on output\n",
-                       errdata.longdat);
-               return(errdata.longdat);
-       case EFMTSIZE:
-               fprintf(stderr,"Non-positive format width: %D\n",errdata.longdat);
-               return(0);
-       case EGOTO:
-               fputs("Active frame not found in non-local goto\n", stderr);
-               return(0);
-       case ECASE:
-               fprintf(stderr,"Label of %D not found in case\n"
-                       ,errdata.longdat);
-               return(errdata.longdat);
-       case EOUTOFMEM:
-               fputs("Ran out of memory\n",stderr);
-               return(0);
-       case EARGV:
-               fprintf(stderr,"Argument to argv of %D is out of range\n"
-                       ,errdata.longdat);
-               return(errdata.longdat);
-       case EPACK:
-               fprintf(stderr,"i = %D: Bad i to pack(a,i,z)\n"
-                       ,errdata.longdat);
-               return(errdata.longdat);
-       case EUNPACK:
-               fprintf(stderr,"i = %D: Bad i to unpack(z,a,i)\n"
-                       ,errdata.longdat);
-               return(errdata.longdat);
-       case ERANGE:
-               fprintf(stderr,"Value of %D is out of range\n",errdata.longdat);
-               return(errdata.longdat);
-       case ESUBSC:
-               fprintf(stderr,"Subscript value of %D is out of range\n"
-                       ,errdata.longdat);
-               return(errdata.longdat);
-       case EASRT:
-               fprintf(stderr,"Assertion failed: %s\n",errdata.strngdat);
-               return(0);
-       case ESTLIM:
-               fprintf(stderr,
-                       "Statement count limit exceeded, %D statements executed\n",
-                       errdata.longdat);
-               return(errdata.longdat);
-       default:
-               fprintf(stderr, msg, d1, d2, d3, d4);
-               return(0);
+       /*
+        * Historical anomaly
+        */
+       if ((int)msg == 5) {
+               fprintf(stderr, "Label of %D not found in case\n", d1);
+               return d1;
        }
        }
+       fprintf(stderr, msg, d1, d2);
+       return d1;
 }
 }
index 50b21a6..cbd9fbc 100644 (file)
@@ -1,16 +1,15 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)FLUSH.c 1.1 %G%";
+static char sccsid[] = "@(#)FLUSH.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 FLUSH(curfile)
 
        register struct iorec   *curfile;
 {
        if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) {
 
 FLUSH(curfile)
 
        register struct iorec   *curfile;
 {
        if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) {
-               ERROR(ENOFILE, 0);
+               ERROR("Reference to an inactive file\n", 0);
                return;
        }
        if (curfile->funit & FWRITE) {
                return;
        }
        if (curfile->funit & FWRITE) {
index 97daa8b..1ce1f0a 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)FNIL.c 1.2 %G%";
+static char sccsid[] = "@(#)FNIL.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 char *
 FNIL(curfile)
 
 char *
 FNIL(curfile)
@@ -11,11 +10,11 @@ FNIL(curfile)
        register struct iorec   *curfile;
 {
        if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) {
        register struct iorec   *curfile;
 {
        if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) {
-               ERROR(ENOFILE, 0);
+               ERROR("Reference to an inactive file\n", 0);
                return;
        }
        if (curfile->funit & FDEF) {
                return;
        }
        if (curfile->funit & FDEF) {
-               ERROR(EREFINAF, curfile->pfname);
+               ERROR("%s: Reference to an inactive file\n", curfile->pfname);
                return;
        }
        if (curfile->funit & FREAD) {
                return;
        }
        if (curfile->funit & FREAD) {
index a77a20b..a21d9af 100644 (file)
@@ -1,21 +1,21 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)GET.c 1.1 %G%";
+static char sccsid[] = "@(#)GET.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 GET(curfile)
 
        register struct iorec   *curfile;
 {
        if (curfile->funit & FWRITE) {
 
 GET(curfile)
 
        register struct iorec   *curfile;
 {
        if (curfile->funit & FWRITE) {
-               ERROR(EREADIT, curfile->pfname);
+               ERROR("%s: Attempt to read, but open for writing\n",
+                       curfile->pfname);
                return;
        }
        IOSYNC(curfile);
        if (curfile->funit & EOFF) {
                return;
        }
        IOSYNC(curfile);
        if (curfile->funit & EOFF) {
-               ERROR(EPASTEOF, curfile->pfname);
+               ERROR("%s: Tried to read past end of file\n", curfile->pfname);
                return;
        }
        curfile->funit |= SYNC;
                return;
        }
        curfile->funit |= SYNC;
index ed76fc3..ed4bce9 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)GETNAME.c 1.5 %G%";
+static char sccsid[] = "@(#)GETNAME.c 1.6 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 /*
  * GETNAME - activate a file
 
 /*
  * GETNAME - activate a file
@@ -81,7 +80,7 @@ GETNAME(filep, name, namlim, datasize)
                        }
                        fclose(filep->fbuf);
                        if (ferror(filep->fbuf)) {
                        }
                        fclose(filep->fbuf);
                        if (ferror(filep->fbuf)) {
-                               ERROR(ECLOSE, filep->pfname);
+                               ERROR("%s: Close failed\n", filep->pfname);
                                return;
                        }
                        /*
                                return;
                        }
                        /*
@@ -89,7 +88,8 @@ GETNAME(filep, name, namlim, datasize)
                         */
                        if ((filep->funit & TEMP) && name != NULL) {
                                if (unlink(filep->pfname)) {
                         */
                        if ((filep->funit & TEMP) && name != NULL) {
                                if (unlink(filep->pfname)) {
-                                       ERROR(EREMOVE, filep->pfname);
+                                       PERROR("Could not remove ",
+                                               filep->pfname);
                                        return;
                                }
                        }
                                        return;
                                }
                        }
@@ -120,7 +120,7 @@ GETNAME(filep, name, namlim, datasize)
                if (name[cnt] == '\0' || name[cnt] == ' ')
                        break;
        if (cnt >= NAMSIZ) {
                if (name[cnt] == '\0' || name[cnt] == ' ')
                        break;
        if (cnt >= NAMSIZ) {
-               ERROR(ENAMESIZE, name);
+               ERROR("%s: File name too long\n", name);
                return;
        }
        maxnamlen = cnt;
                return;
        }
        maxnamlen = cnt;
index c87ea79..dc0c7e5 100644 (file)
@@ -1,10 +1,10 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)HALT.c 1.1 %G%";
+static char sccsid[] = "@(#)HALT.c 1.2 %G%";
 
 
-#include "h01errs.h"
 
 HALT()
 {
 
 HALT()
 {
-       ERROR(EHALT, 0);
+               ERROR("Call to procedure halt\n", 0);
+               PCEXIT(0);
 }
 }
index 8e5727d..1d7f361 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)IOSYNC.c 1.4 %G%";
+static char sccsid[] = "@(#)IOSYNC.c 1.5 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 /*
  * insure that a usable image is in the buffer window
 
 /*
  * insure that a usable image is in the buffer window
@@ -15,14 +14,15 @@ IOSYNC(curfile)
        char                    *limit, *ptr;
 
        if (curfile->funit & FWRITE) {
        char                    *limit, *ptr;
 
        if (curfile->funit & FWRITE) {
-               ERROR(EREADIT, curfile->pfname);
+               ERROR("%s: Attempt to read, but open for writing\n",
+                       curfile->pfname);
                return;
        }
        if ((curfile->funit & SYNC) == 0) {
                return;
        }
        if (curfile->funit & EOFF) {
                return;
        }
        if ((curfile->funit & SYNC) == 0) {
                return;
        }
        if (curfile->funit & EOFF) {
-               ERROR(EPASTEOF, curfile->pfname);
+               ERROR("%s: Tried to read past end of file\n", curfile->pfname);
                return;
        }
        curfile->funit &= ~SYNC;
                return;
        }
        curfile->funit &= ~SYNC;
@@ -33,7 +33,7 @@ IOSYNC(curfile)
        }
        fread(curfile->fileptr, (int)curfile->fsize, 1, curfile->fbuf);
        if (ferror(curfile->fbuf)) {
        }
        fread(curfile->fileptr, (int)curfile->fsize, 1, curfile->fbuf);
        if (ferror(curfile->fbuf)) {
-               ERROR(EPASTEOF, curfile->pfname);
+               ERROR("%s: Tried to read past end of file\n", curfile->pfname);
                return;
        }
        if (feof(curfile->fbuf)) {
                return;
        }
        if (feof(curfile->fbuf)) {
index c68066a..85858e3 100644 (file)
@@ -1,14 +1,13 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)LINO.c 1.1 %G%";
+static char sccsid[] = "@(#)LINO.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 LINO()
 {
        if (++_stcnt >= _stlim) {
 
 LINO()
 {
        if (++_stcnt >= _stlim) {
-               ERROR(ESTLIM, _stcnt);
+               ERROR("Statement count limit of %D exceeded\n", _stcnt);
                return;
        }
 }
                return;
        }
 }
index 19da5e0..4e07ca6 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)LLIMIT.c 1.2 %G%";
+static char sccsid[] = "@(#)LLIMIT.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 LLIMIT(curfile, limit)
 
 
 LLIMIT(curfile, limit)
 
@@ -14,7 +13,7 @@ LLIMIT(curfile, limit)
                limit = 0x7fffffff;
        curfile->llimit = limit;
        if (curfile->lcount >= curfile->llimit) {
                limit = 0x7fffffff;
        curfile->llimit = limit;
        if (curfile->lcount >= curfile->llimit) {
-               ERROR(ELLIMIT, curfile->pfname);
+               ERROR("%s: Line limit exceeded\n", curfile->pfname);
                return;
        }
 }
                return;
        }
 }
index 876d1a9..6da3f9b 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)LN.c 1.3 %G%";
+static char sccsid[] = "@(#)LN.c 1.4 %G%";
 
 #include <math.h>
 
 #include <math.h>
-#include "h01errs.h"
 
 double
 LN(value)
 
 double
 LN(value)
@@ -11,7 +10,7 @@ LN(value)
        double  value;
 {
        if (value <= 0) {
        double  value;
 {
        if (value <= 0) {
-               ERROR(ELN, value);
+               ERROR("Non-positive argument of %e to ln\n", value);
                return;
        }
        return log(value);
                return;
        }
        return log(value);
index 747d7d2..36fc127 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)MAX.c 1.3 %G%";
+static char sccsid[] = "@(#)MAX.c 1.4 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 long
 MAX(width, reduce, min)
 
 long
 MAX(width, reduce, min)
@@ -13,7 +12,7 @@ MAX(width, reduce, min)
        long            min;            /* minimum amount of space needed */
 {
        if (width <= 0) {
        long            min;            /* minimum amount of space needed */
 {
        if (width <= 0) {
-               ERROR(EFMTSIZE, width);
+               ERROR("Non-positive format width: %D\n", width);
                return;
        }
        if ((width -= reduce) >= min)
                return;
        }
        if ((width -= reduce) >= min)
index 91ae583..3246a51 100644 (file)
@@ -1,4 +1,4 @@
-SCCSID = "@(#)Makefile 1.7 %G%"
+SCCSID = "@(#)Makefile 1.8 %G%"
 CFLAGS = -O
 LIB = ${DESTDIR}/usr/lib
 SRCDIR = ${DESTDIR}/usr/ucb
 CFLAGS = -O
 LIB = ${DESTDIR}/usr/lib
 SRCDIR = ${DESTDIR}/usr/ucb
@@ -19,12 +19,12 @@ CMDS =      ACTFILE.c ADDT.c ARGV.c ASRT.c BUFF.c CARD.c CHR.c CLCK.c \
        SUBSC.c SUBSCZ.c SUBT.c SUCC.c TEOF.c TEOLN.c TIME.c TRUNC.c \
        UNIT.c UNPACK.c WRITEC.c WRITEF.c WRITES.c WRITLN.c
 
        SUBSC.c SUBSCZ.c SUBT.c SUCC.c TEOF.c TEOLN.c TIME.c TRUNC.c \
        UNIT.c UNPACK.c WRITEC.c WRITEF.c WRITES.c WRITLN.c
 
-SYS =  ERROR.c GETNAME.c IOSYNC.c PCEXIT.c PCLOSE.c PCSTART.c PFLUSH.c \
-       PMFLUSH.c RAND.s SETRACE.s UNSYNC.c UNWIND.c blkclr.c blkcpy.c
+SYS =  ERROR.c GETNAME.c IOSYNC.c PCEXIT.c PCLOSE.c PCSTART.c PERROR.c \
+       PFLUSH.c PMFLUSH.c RAND.s SETRACE.s UNSYNC.c UNWIND.c blkclr.c blkcpy.c
 
 
-EXTN = APPEND.c CATCHERR.c SEEK.c TELL.c
+EXTN = APPEND.c SEEK.c TELL.c
 
 
-HDRS = whoami.h h00vars.h errdata make.ed1
+HDRS = whoami.h h00vars.h
 
 OBJS = ACTFILE.o ADDT.o ARGV.o ASRT.o BUFF.o CARD.o CHR.o CLCK.o\
        CTTOT.o DATE.o DEFNAME.o DISPOSE.o EXPO.o FCALL.o FLUSH.o\
 
 OBJS = ACTFILE.o ADDT.o ARGV.o ASRT.o BUFF.o CARD.o CHR.o CLCK.o\
        CTTOT.o DATE.o DEFNAME.o DISPOSE.o EXPO.o FCALL.o FLUSH.o\
@@ -37,10 +37,10 @@ OBJS =      ACTFILE.o ADDT.o ARGV.o ASRT.o BUFF.o CARD.o CHR.o CLCK.o\
        SUBSC.o SUBSCZ.o SUBT.o SUCC.o TEOF.o TEOLN.o TIME.o TRUNC.o\
        UNIT.o UNPACK.o WRITEC.o WRITEF.o WRITES.o WRITLN.o
 
        SUBSC.o SUBSCZ.o SUBT.o SUCC.o TEOF.o TEOLN.o TIME.o TRUNC.o\
        UNIT.o UNPACK.o WRITEC.o WRITEF.o WRITES.o WRITLN.o
 
-SYOBJ =        ERROR.o GETNAME.o IOSYNC.o PCEXIT.o PCLOSE.o PCSTART.o PFLUSH.o\
-       PMFLUSH.o RAND.o SETRACE.o UNSYNC.o UNWIND.o blkclr.o blkcpy.o
+SYOBJ =        ERROR.o GETNAME.o IOSYNC.o PCEXIT.o PCLOSE.o PCSTART.o PERROR.o\
+       PFLUSH.o PMFLUSH.o RAND.o SETRACE.o UNSYNC.o UNWIND.o blkclr.o blkcpy.o
 
 
-EXOBJ =        APPEND.o CATCHERR.o SEEK.o TELL.o
+EXOBJ =        APPEND.o SEEK.o TELL.o
 
 sources: ${CMDS} ${SYS} ${EXTN} ${HDRS}
 
 
 sources: ${CMDS} ${SYS} ${EXTN} ${HDRS}
 
@@ -57,15 +57,11 @@ install: libpc
        cp libpc ${LIB}/libpc.a
        ${RANLIB} ${LIB}/libpc.a
 
        cp libpc ${LIB}/libpc.a
        ${RANLIB} ${LIB}/libpc.a
 
-libpc: h01errs.h ${OBJS} ${SYOBJ} ${EXOBJ}
+libpc: ${OBJS} ${SYOBJ} ${EXOBJ}
        ${RM} libpc
        ${AR} cr libpc ${OBJS} ${SYOBJ} ${EXOBJ}
        ${RANLIB} libpc
 
        ${RM} libpc
        ${AR} cr libpc ${OBJS} ${SYOBJ} ${EXOBJ}
        ${RANLIB} libpc
 
-h01errs.h: errdata make.ed1
-       ed - errdata <make.ed1
-       ${RM} E.s *.o
-
 whoami.h:
        cp ${PASDIR}/whoami.h whoami.h
 
 whoami.h:
        cp ${PASDIR}/whoami.h whoami.h
 
@@ -105,119 +101,69 @@ depend:  sources
 # DEPENDENCIES MUST END AT END OF FILE
 ACTFILE.o: h00vars.h
 APPEND.o: h00vars.h
 # DEPENDENCIES MUST END AT END OF FILE
 ACTFILE.o: h00vars.h
 APPEND.o: h00vars.h
-APPEND.o: h01errs.h
 ARGV.o: h00vars.h
 ARGV.o: h00vars.h
-ARGV.o: h01errs.h
-ASRT.o: h01errs.h
 BUFF.o: h00vars.h
 CATCHERR.o: h00vars.h
 BUFF.o: h00vars.h
 CATCHERR.o: h00vars.h
-CHR.o: h01errs.h
+CTTOT.o: whoami.h
 CTTOT.o: h00vars.h
 CTTOT.o: h00vars.h
-CTTOT.o: h01errs.h
 DEFNAME.o: h00vars.h
 DISPOSE.o: h00vars.h
 DEFNAME.o: h00vars.h
 DISPOSE.o: h00vars.h
-DISPOSE.o: h01errs.h
 ERROR.o: h00vars.h
 ERROR.o: h00vars.h
-ERROR.o: h01errs.h
 FCALL.o: h00vars.h
 FLUSH.o: h00vars.h
 FCALL.o: h00vars.h
 FLUSH.o: h00vars.h
-FLUSH.o: h01errs.h
 FNIL.o: h00vars.h
 FNIL.o: h00vars.h
-FNIL.o: h01errs.h
 FRTN.o: h00vars.h
 FSAV.o: h00vars.h
 GET.o: h00vars.h
 FRTN.o: h00vars.h
 FSAV.o: h00vars.h
 GET.o: h00vars.h
-GET.o: h01errs.h
 GETNAME.o: h00vars.h
 GETNAME.o: h00vars.h
-GETNAME.o: h01errs.h
-HALT.o: h01errs.h
 IN.o: h00vars.h
 INCT.o: h00vars.h
 IOSYNC.o: h00vars.h
 IN.o: h00vars.h
 INCT.o: h00vars.h
 IOSYNC.o: h00vars.h
-IOSYNC.o: h01errs.h
 LINO.o: h00vars.h
 LINO.o: h00vars.h
-LINO.o: h01errs.h
 LLIMIT.o: h00vars.h
 LLIMIT.o: h00vars.h
-LLIMIT.o: h01errs.h
-LN.o: h01errs.h
 MAX.o: h00vars.h
 MAX.o: h00vars.h
-MAX.o: h01errs.h
 NAM.o: h00vars.h
 NAM.o: h00vars.h
-NAM.o: h01errs.h
 NEW.o: h00vars.h
 NEW.o: h00vars.h
-NEW.o: h01errs.h
 NEWZ.o: h00vars.h
 NEWZ.o: h00vars.h
-NEWZ.o: h01errs.h
 NIL.o: h00vars.h
 NIL.o: h00vars.h
-NIL.o: h01errs.h
-PACK.o: h01errs.h
 PAGE.o: h00vars.h
 PAGE.o: h00vars.h
-PAGE.o: h01errs.h
 PCEXIT.o: h00vars.h
 PCLOSE.o: h00vars.h
 PCEXIT.o: h00vars.h
 PCLOSE.o: h00vars.h
-PCLOSE.o: h01errs.h
 PCSTART.o: h00vars.h
 PCSTART.o: h00vars.h
+PERROR.o: h00vars.h
 PFLUSH.o: h00vars.h
 PMFLUSH.o: h00vars.h
 PFLUSH.o: h00vars.h
 PMFLUSH.o: h00vars.h
-PRED.o: h01errs.h
 PUT.o: h00vars.h
 PUT.o: h00vars.h
-PUT.o: h01errs.h
 RANDOM.o: h00vars.h
 RANDOM.o: h00vars.h
-RANG4.o: h01errs.h
 READ4.o: h00vars.h
 READ4.o: h00vars.h
-READ4.o: h01errs.h
 READ8.o: h00vars.h
 READ8.o: h00vars.h
-READ8.o: h01errs.h
 READC.o: h00vars.h
 READC.o: h00vars.h
-READC.o: h01errs.h
 READE.o: h00vars.h
 READE.o: h00vars.h
-READE.o: h01errs.h
 READLN.o: h00vars.h
 READLN.o: h00vars.h
-READLN.o: h01errs.h
 RELEQ.o: h00vars.h
 RELNE.o: h00vars.h
 RELSGE.o: h00vars.h
 RELSGT.o: h00vars.h
 RELSLE.o: h00vars.h
 RELEQ.o: h00vars.h
 RELNE.o: h00vars.h
 RELSGE.o: h00vars.h
 RELSGT.o: h00vars.h
 RELSLE.o: h00vars.h
-RELSLT.o: h00vars.h
 RELTGE.o: h00vars.h
 RELTGT.o: h00vars.h
 RELTLE.o: h00vars.h
 RELTLT.o: h00vars.h
 REMOVE.o: h00vars.h
 RELTGE.o: h00vars.h
 RELTGT.o: h00vars.h
 RELTLE.o: h00vars.h
 RELTLT.o: h00vars.h
 REMOVE.o: h00vars.h
-REMOVE.o: h01errs.h
 RESET.o: h00vars.h
 RESET.o: h00vars.h
-RESET.o: h01errs.h
 REWRITE.o: h00vars.h
 REWRITE.o: h00vars.h
-REWRITE.o: h01errs.h
-RSNG4.o: h01errs.h
 SEED.o: h00vars.h
 SEEK.o: h00vars.h
 SEED.o: h00vars.h
 SEEK.o: h00vars.h
-SEEK.o: h01errs.h
-SQRT.o: h01errs.h
 STLIM.o: h00vars.h
 STLIM.o: h00vars.h
-STLIM.o: h01errs.h
-SUBSC.o: h01errs.h
-SUBSCZ.o: h01errs.h
-SUCC.o: h01errs.h
 TELL.o: h00vars.h
 TEOF.o: h00vars.h
 TELL.o: h00vars.h
 TEOF.o: h00vars.h
-TEOF.o: h01errs.h
 TEOLN.o: h00vars.h
 TEOLN.o: h00vars.h
-TEOLN.o: h01errs.h
 UNIT.o: h00vars.h
 UNIT.o: h00vars.h
-UNIT.o: h01errs.h
-UNPACK.o: h01errs.h
 UNSYNC.o: h00vars.h
 UNSYNC.o: h00vars.h
-UNSYNC.o: h01errs.h
 WRITEC.o: h00vars.h
 WRITEC.o: h00vars.h
-WRITEC.o: h01errs.h
 WRITEF.o: h00vars.h
 WRITEF.o: h00vars.h
-WRITEF.o: h01errs.h
 WRITES.o: h00vars.h
 WRITES.o: h00vars.h
-WRITES.o: h01errs.h
 WRITLN.o: h00vars.h
 WRITLN.o: h00vars.h
-WRITLN.o: h01errs.h
 # DEPENDENCIES MUST END AT END OF FILE
 # IF YOU PUT STUFF HERE IT WILL GO AWAY
 # see make depend above
 # DEPENDENCIES MUST END AT END OF FILE
 # IF YOU PUT STUFF HERE IT WILL GO AWAY
 # see make depend above
index e6c0ae8..64dc784 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)NAM.c 1.2 %G%";
+static char sccsid[] = "@(#)NAM.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 char *
 NAM(val, name)
 
 char *
 NAM(val, name)
@@ -16,7 +15,8 @@ NAM(val, name)
 
        sptr = (short *)name;
        if (value < 0 || value >= *sptr) {
 
        sptr = (short *)name;
        if (value < 0 || value >= *sptr) {
-               ERROR(ENAMRNG, val);
+               ERROR("Enumerated type value of %D is out of range on output\n",
+                       val);
                return;
        }
        sptr++;
                return;
        }
        sptr++;
index 4a894d8..9ff8f8e 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)NEW.c 1.2 %G%";
+static char sccsid[] = "@(#)NEW.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 NEW(var, size)
        char    **var;  /* pointer to item being deallocated */
 
 NEW(var, size)
        char    **var;  /* pointer to item being deallocated */
@@ -14,7 +13,7 @@ NEW(var, size)
 
        memblk = malloc((int)size);
        if (memblk == 0) {
 
        memblk = malloc((int)size);
        if (memblk == 0) {
-               ERROR(EOUTOFMEM,0);
+               ERROR("Ran out of memory\n", 0);
                return;
        }
        *var = memblk;
                return;
        }
        *var = memblk;
index 3624050..7c2c584 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)NIL.c 1.1 %G%";
+static char sccsid[] = "@(#)NIL.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 char *
 NIL(ptr)
 
 char *
 NIL(ptr)
@@ -11,7 +10,7 @@ NIL(ptr)
        char    *ptr;           /* pointer to struct */
 {
        if (ptr > _maxptr || ptr < _minptr) {
        char    *ptr;           /* pointer to struct */
 {
        if (ptr > _maxptr || ptr < _minptr) {
-               ERROR(ENILPTR, 0);
+               ERROR("Pointer value out of legal range\n", 0);
                return;
        }
        return ptr;
                return;
        }
        return ptr;
index 17c2545..2293fc1 100644 (file)
@@ -1,8 +1,7 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)PACK.c 1.2 %G%";
+static char sccsid[] = "@(#)PACK.c 1.3 %G%";
 
 
-#include "h01errs.h"
 
 /*
  * pack(a,i,z)
 
 /*
  * pack(a,i,z)
@@ -39,7 +38,7 @@ PACK(i, a, z, size_a, lb_a, ub_a, size_z)
 
        subscr = i - lb_a;
        if (subscr < 0 || subscr > ub_a) {
 
        subscr = i - lb_a;
        if (subscr < 0 || subscr > ub_a) {
-               ERROR(EPACK, i);
+               ERROR("i = %D: Bad i to pack(a,i,z)\n", i);
                return;
        }
        cp = &a[subscr * size_a];
                return;
        }
        cp = &a[subscr * size_a];
index 38d4ed2..dc10915 100644 (file)
@@ -1,21 +1,21 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)PAGE.c 1.1 %G%";
+static char sccsid[] = "@(#)PAGE.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 PAGE(curfile)
 
        register struct iorec   *curfile;
 {
        if (curfile->funit & FREAD) {
 
 PAGE(curfile)
 
        register struct iorec   *curfile;
 {
        if (curfile->funit & FREAD) {
-               ERROR(EWRITEIT, curfile->pfname);
+               ERROR("%s: Attempt to write, but open for reading\n",
+                       curfile->pfname);
                return;
        }
        fputc('\f', curfile->fbuf);
        if (ferror(curfile->fbuf)) {
                return;
        }
        fputc('\f', curfile->fbuf);
        if (ferror(curfile->fbuf)) {
-               ERROR(EWRITE, curfile->pfname);
+               PERROR("Could not write to ", curfile->pfname);
                return;
        }
 }
                return;
        }
 }
index 5c2d22c..ea21ca1 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)PCLOSE.c 1.3 %G%";
+static char sccsid[] = "@(#)PCLOSE.c 1.4 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 PCLOSE(level)
 
 
 PCLOSE(level)
 
@@ -21,13 +20,14 @@ PCLOSE(level)
                                }
                                fclose(next->fbuf);
                                if (ferror(next->fbuf)) {
                                }
                                fclose(next->fbuf);
                                if (ferror(next->fbuf)) {
-                                       ERROR(ECLOSE, next->pfname);
+                                       ERROR("%s: Close failed\n",
+                                               next->pfname);
                                        return;
                                }
                        }
                        if ((next->funit & TEMP) != 0 &&
                            unlink(next->pfname)) {
                                        return;
                                }
                        }
                        if ((next->funit & TEMP) != 0 &&
                            unlink(next->pfname)) {
-                               ERROR(EREMOVE, next->pfname);
+                               PERROR("Could not remove ", next->pfname);
                                return;
                        }
                }
                                return;
                        }
                }
index b0aeef1..5faee77 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)PCSTART.c 1.4 %G%";
+static char sccsid[] = "@(#)PCSTART.c 1.5 %G%";
 
 #include "h00vars.h"
 
 
 #include "h00vars.h"
 
@@ -19,7 +19,6 @@ char          *_minptr = (char *)0x7fffffff;
 char           *_minptr = (char *)0xffff;
 #endif VAX
 char           *_maxptr = (char *)0;
 char           *_minptr = (char *)0xffff;
 #endif VAX
 char           *_maxptr = (char *)0;
-struct errentry _entry[MAXERRS];
 
 /*
  * file record variables
 
 /*
  * file record variables
index 8315d6d..67363ee 100644 (file)
@@ -1,8 +1,7 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)PRED.c 1.3 %G%";
+static char sccsid[] = "@(#)PRED.c 1.4 %G%";
 
 
-#include "h01errs.h"
 
 long
 PRED(value, lower, upper)
 
 long
 PRED(value, lower, upper)
index 2ea7e9b..4009dfd 100644 (file)
@@ -1,21 +1,21 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)PUT.c 1.2 %G%";
+static char sccsid[] = "@(#)PUT.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 PUT(curfile)
 
        register struct iorec   *curfile;
 {
        if (curfile->funit & FREAD) {
 
 PUT(curfile)
 
        register struct iorec   *curfile;
 {
        if (curfile->funit & FREAD) {
-               ERROR(EWRITEIT, curfile->pfname);
+               ERROR("%s: Attempt to write, but open for reading\n",
+                       curfile->pfname);
                return;
        }
        fwrite(curfile->fileptr, (int)curfile->fsize, 1, curfile->fbuf);
        if (ferror(curfile->fbuf)) {
                return;
        }
        fwrite(curfile->fileptr, (int)curfile->fsize, 1, curfile->fbuf);
        if (ferror(curfile->fbuf)) {
-               ERROR(EWRITE, curfile->pfname);
+               PERROR("Could not write to ", curfile->pfname);
                return;
        }
 }
                return;
        }
 }
index 739588a..1974768 100644 (file)
@@ -1,8 +1,7 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)RANG4.c 1.2 %G%";
+static char sccsid[] = "@(#)RANG4.c 1.3 %G%";
 
 
-#include "h01errs.h"
 
 long
 RANG4(value, lower, upper)
 
 long
 RANG4(value, lower, upper)
@@ -12,7 +11,7 @@ RANG4(value, lower, upper)
        long    upper;
 {
        if (value < lower || value > upper) {
        long    upper;
 {
        if (value < lower || value > upper) {
-               ERROR(ERANGE, value);
+               ERROR("Value of %D is out of range\n", value);
                return;
        }
        return  value;
                return;
        }
        return  value;
index b49d92f..6cad81d 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)READ4.c 1.4 %G%";
+static char sccsid[] = "@(#)READ4.c 1.5 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 long
 READ4(curfile)
 
 long
 READ4(curfile)
@@ -14,17 +13,18 @@ READ4(curfile)
        int                     retval;
 
        if (curfile->funit & FWRITE) {
        int                     retval;
 
        if (curfile->funit & FWRITE) {
-               ERROR(EREADIT, curfile->pfname);
+               ERROR("%s: Attempt to read, but open for writing\n",
+                       curfile->pfname);
                return;
        }
        UNSYNC(curfile);
        retval = fscanf(curfile->fbuf, "%ld", &data);
        if (retval == EOF) {
                return;
        }
        UNSYNC(curfile);
        retval = fscanf(curfile->fbuf, "%ld", &data);
        if (retval == EOF) {
-               ERROR(EPASTEOF, curfile->pfname);
+               ERROR("%s: Tried to read past end of file\n", curfile->pfname);
                return;
        }
        if (retval == 0) {
                return;
        }
        if (retval == 0) {
-               ERROR(EBADINUM, curfile->pfname);
+               ERROR("%s: Bad data found on integer read\n", curfile->pfname);
                return;
        }
        curfile->funit &= ~EOLN;
                return;
        }
        curfile->funit &= ~EOLN;
index 78a5c0d..1308626 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)READ8.c 1.3 %G%";
+static char sccsid[] = "@(#)READ8.c 1.4 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 double
 READ8(curfile)
 
 double
 READ8(curfile)
@@ -14,17 +13,18 @@ READ8(curfile)
        int                     retval;
 
        if (curfile->funit & FWRITE) {
        int                     retval;
 
        if (curfile->funit & FWRITE) {
-               ERROR(EREADIT, curfile->pfname);
+               ERROR("%s: Attempt to read, but open for writing\n",
+                       curfile->pfname);
                return;
        }
        UNSYNC(curfile);
        retval = fscanf(curfile->fbuf, "%lf", &data);
        if (retval == EOF) {
                return;
        }
        UNSYNC(curfile);
        retval = fscanf(curfile->fbuf, "%lf", &data);
        if (retval == EOF) {
-               ERROR(EPASTEOF, curfile->pfname);
+               ERROR("%s: Tried to read past end of file\n", curfile->pfname);
                return;
        }
        if (retval == 0) {
                return;
        }
        if (retval == 0) {
-               ERROR(EBADFNUM, curfile->pfname);
+               ERROR("%s: Bad data found on real read\n", curfile->pfname);
                return;
        }
        curfile->funit &= ~EOLN;
                return;
        }
        curfile->funit &= ~EOLN;
index a5cb6ed..144326a 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)READC.c 1.1 %G%";
+static char sccsid[] = "@(#)READC.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 char
 READC(curfile)
 
 char
 READC(curfile)
@@ -13,12 +12,13 @@ READC(curfile)
        char                    data;
 
        if (curfile->funit & FWRITE) {
        char                    data;
 
        if (curfile->funit & FWRITE) {
-               ERROR(EREADIT, curfile->pfname);
+               ERROR("%s: Attempt to read, but open for writing\n",
+                       curfile->pfname);
                return;
        }
        IOSYNC(curfile);
        if (curfile->funit & EOFF) {
                return;
        }
        IOSYNC(curfile);
        if (curfile->funit & EOFF) {
-               ERROR(EPASTEOF, curfile->pfname);
+               ERROR("%s: Tried to read past end of file\n", curfile->pfname);
                return;
        }
        curfile->funit |= SYNC;
                return;
        }
        curfile->funit |= SYNC;
index 0bf2417..57273ae 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)READE.c 1.4 %G%";
+static char sccsid[] = "@(#)READE.c 1.5 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 long
 READE(curfile, name)
 
 long
 READE(curfile, name)
@@ -20,7 +19,8 @@ READE(curfile, name)
        int             retval;
 
        if (curfile->funit & FWRITE) {
        int             retval;
 
        if (curfile->funit & FWRITE) {
-               ERROR(EREADIT, curfile->pfname);
+               ERROR("%s: Attempt to read, but open for writing\n",
+                       curfile->pfname);
                return;
        }
        UNSYNC(curfile);
                return;
        }
        UNSYNC(curfile);
@@ -28,13 +28,11 @@ READE(curfile, name)
            "%*[ \t\n]%74[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]",
            namebuf);
        if (retval == EOF) {
            "%*[ \t\n]%74[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]",
            namebuf);
        if (retval == EOF) {
-               ERROR(EPASTEOF, curfile->pfname);
-               return;
-       }
-       if (retval == 0) {
-               ERROR(ENUMNTFD, namebuf);
+               ERROR("%s: Tried to read past end of file\n", curfile->pfname);
                return;
        }
                return;
        }
+       if (retval == 0)
+               goto ename;
        curfile->funit &= ~EOLN;
        curfile->funit |= SYNC;
        for (len = 0; len < NAMSIZ && namebuf[len]; len++)
        curfile->funit &= ~EOLN;
        curfile->funit |= SYNC;
        for (len = 0; len < NAMSIZ && namebuf[len]; len++)
@@ -51,5 +49,6 @@ READE(curfile, name)
                }
                cp += (int)nextlen;
        } while (--cnt);
                }
                cp += (int)nextlen;
        } while (--cnt);
-       ERROR(ENUMNTFD, namebuf);
+ename:
+       ERROR("Unknown name \"%s\" found on enumerated type read\n", namebuf);
 }
 }
index 282fcdd..2caf783 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)READLN.c 1.3 %G%";
+static char sccsid[] = "@(#)READLN.c 1.4 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 READLN(curfile)
 
 
 READLN(curfile)
 
index f24e7ba..0286044 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)REMOVE.c 1.2 %G%";
+static char sccsid[] = "@(#)REMOVE.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 REMOVE(name, namlim)
 
 
 REMOVE(name, namlim)
 
@@ -22,7 +21,7 @@ REMOVE(name, namlim)
                if (name[cnt] == '\0' || name[cnt++] == ' ')
                        break;
        if (cnt >= NAMSIZ) {
                if (name[cnt] == '\0' || name[cnt++] == ' ')
                        break;
        if (cnt >= NAMSIZ) {
-               ERROR(ENAMESIZE, name);
+               ERROR("%s: File name too long\n", name);
                return;
        }
        maxnamlen = cnt;
                return;
        }
        maxnamlen = cnt;
@@ -36,7 +35,7 @@ REMOVE(name, namlim)
         * unlink the file
         */
        if (unlink(namebuf)) {
         * unlink the file
         */
        if (unlink(namebuf)) {
-               ERROR(EREMOVE, namebuf);
+               PERROR("Could not remove ", namebuf);
                return;
        }
 }
                return;
        }
 }
index 64ba102..2b666da 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)RESET.c 1.3 %G%";
+static char sccsid[] = "@(#)RESET.c 1.4 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 RESET(filep, name, maxnamlen, datasize)
 
 
 RESET(filep, name, maxnamlen, datasize)
 
@@ -14,7 +13,7 @@ RESET(filep, name, maxnamlen, datasize)
 {
        if (name == NULL && filep == INPUT && filep->fname[0] == '\0') {
                if (fseek(filep->fbuf, (long)0, 0)) {
 {
        if (name == NULL && filep == INPUT && filep->fname[0] == '\0') {
                if (fseek(filep->fbuf, (long)0, 0)) {
-                       ERROR(ESEEK, filep->pfname);
+                       PERROR("Could not reset ", filep->pfname);
                        return;
                }
                filep->funit &= ~(EOFF | EOLN);
                        return;
                }
                filep->funit &= ~(EOFF | EOLN);
@@ -28,7 +27,7 @@ RESET(filep, name, maxnamlen, datasize)
                        filep->funit |= (EOFF | SYNC | FREAD);
                        return;
                }
                        filep->funit |= (EOFF | SYNC | FREAD);
                        return;
                }
-               ERROR(EOPEN, filep->pfname);
+               PERROR("Could not open ", filep->pfname);
                return;
        }
        filep->funit |= (SYNC | FREAD);
                return;
        }
        filep->funit |= (SYNC | FREAD);
index 6fe7618..c925a03 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)REWRITE.c 1.2 %G%";
+static char sccsid[] = "@(#)REWRITE.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 REWRITE(filep, name, maxnamlen, datasize)
 
 
 REWRITE(filep, name, maxnamlen, datasize)
 
@@ -15,7 +14,7 @@ REWRITE(filep, name, maxnamlen, datasize)
        filep = GETNAME (filep, name, maxnamlen, datasize);
        filep->fbuf = fopen(filep->fname, "w");
        if (filep->fbuf == NULL) {
        filep = GETNAME (filep, name, maxnamlen, datasize);
        filep->fbuf = fopen(filep->fname, "w");
        if (filep->fbuf == NULL) {
-               ERROR(ECREATE, filep->pfname);
+               PERROR("Could not create ",filep->pfname);
                return;
        }
        filep->funit |= (EOFF | FWRITE);
                return;
        }
        filep->funit |= (EOFF | FWRITE);
index e415764..270bfec 100644 (file)
@@ -1,8 +1,7 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)RSNG4.c 1.2 %G%";
+static char sccsid[] = "@(#)RSNG4.c 1.3 %G%";
 
 
-#include "h01errs.h"
 
 long
 RSNG4(value, upper)
 
 long
 RSNG4(value, upper)
@@ -11,7 +10,7 @@ RSNG4(value, upper)
        long    upper;
 {
        if (value < 0 || value > upper) {
        long    upper;
 {
        if (value < 0 || value > upper) {
-               ERROR(ERANGE, value);
+               ERROR("Value of %D is out of range\n", value);
                return;
        }
        return  value;
                return;
        }
        return  value;
index 5042675..eeb307c 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)SEEK.c 1.1 %G%";
+static char sccsid[] = "@(#)SEEK.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 /*
  * Random access routine
 
 /*
  * Random access routine
@@ -15,7 +14,7 @@ SEEK(curfile, loc)
 {
        curfile->funit |= SYNC;
        if (fseek(curfile->fbuf, loc, 0) == -1) {
 {
        curfile->funit |= SYNC;
        if (fseek(curfile->fbuf, loc, 0) == -1) {
-               ERROR(ESEEK, curfile->pfname);
+               PERROR("Could not reset ", curfile->pfname);
                return;
        }
 }
                return;
        }
 }
index be9819e..e08c780 100644 (file)
@@ -1,8 +1,7 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)SQRT.c 1.2 %G%";
+static char sccsid[] = "@(#)SQRT.c 1.3 %G%";
 
 
-#include "h01errs.h"
 #include <math.h>
 
 double
 #include <math.h>
 
 double
@@ -11,7 +10,7 @@ SQRT(value)
        double  value;
 {
        if (value < 0) {
        double  value;
 {
        if (value < 0) {
-               ERROR(ESQRT, value);
+               ERROR("Negative argument of %e to sqrt\n", value);
                return;
        }
        return sqrt(value);
                return;
        }
        return sqrt(value);
index 2efc51e..16163f6 100644 (file)
@@ -1,16 +1,15 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)STLIM.c 1.1 %G%";
+static char sccsid[] = "@(#)STLIM.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 STLIM(limit)
 
        long    limit;
 {
        if (_stcnt >= limit) {
 
 STLIM(limit)
 
        long    limit;
 {
        if (_stcnt >= limit) {
-               ERROR(ESTLIM, _stcnt);
+               ERROR("Statement count limit of %D exceeded\n", _stcnt);
                return;
        }
        _stlim = limit;
                return;
        }
        _stlim = limit;
index d1e35aa..9f7233e 100644 (file)
@@ -1,8 +1,7 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)SUBSC.c 1.2 %G%";
+static char sccsid[] = "@(#)SUBSC.c 1.3 %G%";
 
 
-#include       "h01errs.h"
 
 long
 SUBSC(i, lower, upper)
 
 long
 SUBSC(i, lower, upper)
@@ -10,7 +9,8 @@ SUBSC(i, lower, upper)
        long    i, lower, upper;
 {
        if (i < lower || i > upper) {
        long    i, lower, upper;
 {
        if (i < lower || i > upper) {
-               ERROR(ESUBSC, i);
+               ERROR("Subscript value of %D is out of range\n", i);
+               return;
        }
        return i;
 }
        }
        return i;
 }
index 6e4a641..6fc206b 100644 (file)
@@ -1,8 +1,7 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)SUBSCZ.c 1.2 %G%";
+static char sccsid[] = "@(#)SUBSCZ.c 1.3 %G%";
 
 
-#include       "h01errs.h"
 
 long
 SUBSCZ(i, upper)
 
 long
 SUBSCZ(i, upper)
@@ -10,7 +9,8 @@ SUBSCZ(i, upper)
        long    i, upper;
 {
        if (i < 0 || i > upper) {
        long    i, upper;
 {
        if (i < 0 || i > upper) {
-               ERROR(ESUBSC, i);
+               ERROR("Subscript value of %D is out of range\n", i);
+               return;
        }
        return i;
 }
        }
        return i;
 }
index e7368ab..c5744a4 100644 (file)
@@ -1,8 +1,7 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)SUCC.c 1.3 %G%";
+static char sccsid[] = "@(#)SUCC.c 1.4 %G%";
 
 
-#include "h01errs.h"
 
 long
 SUCC(value, lower, upper)
 
 long
 SUCC(value, lower, upper)
index 893db41..e1b7dfb 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)TEOF.c 1.2 %G%";
+static char sccsid[] = "@(#)TEOF.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 bool
 TEOF(filep)
 
 bool
 TEOF(filep)
@@ -11,7 +10,7 @@ TEOF(filep)
        register struct iorec   *filep;
 {
        if (filep->fblk >= MAXFILES || _actfile[filep->fblk] != filep) {
        register struct iorec   *filep;
 {
        if (filep->fblk >= MAXFILES || _actfile[filep->fblk] != filep) {
-               ERROR(ENOFILE, 0);
+               ERROR("Reference to an inactive file\n", 0);
                return;
        }
        if (filep->funit & EOFF)
                return;
        }
        if (filep->funit & EOFF)
index b5703b6..c315a57 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)TEOLN.c 1.2 %G%";
+static char sccsid[] = "@(#)TEOLN.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 bool
 TEOLN(filep)
 
 bool
 TEOLN(filep)
@@ -11,7 +10,7 @@ TEOLN(filep)
        register struct iorec   *filep;
 {
        if (filep->fblk >= MAXFILES || _actfile[filep->fblk] != filep) {
        register struct iorec   *filep;
 {
        if (filep->fblk >= MAXFILES || _actfile[filep->fblk] != filep) {
-               ERROR(ENOFILE, 0);
+               ERROR("Reference to an inactive file\n", 0);
                return;
        }
        IOSYNC(filep);
                return;
        }
        IOSYNC(filep);
index a13bfb3..5ff7636 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)UNIT.c 1.1 %G%";
+static char sccsid[] = "@(#)UNIT.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 struct iorec *
 UNIT(curfile)
 
 struct iorec *
 UNIT(curfile)
@@ -11,11 +10,11 @@ UNIT(curfile)
        register struct iorec   *curfile;
 {
        if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) {
        register struct iorec   *curfile;
 {
        if (curfile->fblk >= MAXFILES || _actfile[curfile->fblk] != curfile) {
-               ERROR(ENOFILE, 0);
+               ERROR("Reference to an inactive file\n", 0);
                return;
        }
        if (curfile->funit & FDEF) {
                return;
        }
        if (curfile->funit & FDEF) {
-               ERROR(EREFINAF, curfile->pfname);
+               ERROR("%s: Reference to an inactive file\n", curfile->pfname);
                return;
        }
        return curfile;
                return;
        }
        return curfile;
index fc1f9d8..c971d4d 100644 (file)
@@ -1,8 +1,7 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)UNPACK.c 1.2 %G%";
+static char sccsid[] = "@(#)UNPACK.c 1.3 %G%";
 
 
-#include "h01errs.h"
 
 /*
  * unpack(z,a,i)
 
 /*
  * unpack(z,a,i)
@@ -30,7 +29,7 @@ UNPACK(i, a, z, size_a, lb_a, ub_a, size_z)
 
        subscr = i - lb_a;
        if (subscr < 0 || subscr > ub_a) {
 
        subscr = i - lb_a;
        if (subscr < 0 || subscr > ub_a) {
-               ERROR(EPACK, i);
+               ERROR("i = %D: Bad i to unpack(z,a,i)\n", i);
                return;
        }
        cp = &a[subscr * size_a];
                return;
        }
        cp = &a[subscr * size_a];
index 55ccd74..7e58332 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)UNSYNC.c 1.2 %G%";
+static char sccsid[] = "@(#)UNSYNC.c 1.3 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 /*
  * push back last char read to prepare for formatted read
 
 /*
  * push back last char read to prepare for formatted read
@@ -13,11 +12,12 @@ UNSYNC(curfile)
        register struct iorec   *curfile;
 {
        if (curfile->funit & FWRITE) {
        register struct iorec   *curfile;
 {
        if (curfile->funit & FWRITE) {
-               ERROR(EREADIT, curfile->pfname);
+               ERROR("%s: Attempt to read, but open for writing\n",
+                       curfile->pfname);
                return;
        }
        if (curfile->funit & EOFF) {
                return;
        }
        if (curfile->funit & EOFF) {
-               ERROR(EPASTEOF, curfile->pfname);
+               ERROR("%s: Tried to read past end of file\n", curfile->pfname);
                return;
        }
        if ((curfile->funit & SYNC) == 0) {
                return;
        }
        if ((curfile->funit & SYNC) == 0) {
index e2e1997..9bcc71d 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)WRITEC.c 1.3 %G%";
+static char sccsid[] = "@(#)WRITEC.c 1.4 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 WRITEC(curfile, d1, d2)
 
 
 WRITEC(curfile, d1, d2)
 
@@ -12,12 +11,13 @@ WRITEC(curfile, d1, d2)
        FILE                    *d2;
 {
        if (curfile->funit & FREAD) {
        FILE                    *d2;
 {
        if (curfile->funit & FREAD) {
-               ERROR(EWRITEIT, curfile->pfname);
+               ERROR("%s: Attempt to write, but open for reading\n",
+                       curfile->pfname);
                return;
        }
        fputc(d1, d2);
        if (ferror(curfile->fbuf)) {
                return;
        }
        fputc(d1, d2);
        if (ferror(curfile->fbuf)) {
-               ERROR(EWRITE, curfile->pfname);
+               PERROR("Could not write to ", curfile->pfname);
                return;
        }
 }
                return;
        }
 }
index f46f303..599c7f4 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)WRITEF.c 1.3 %G%";
+static char sccsid[] = "@(#)WRITEF.c 1.4 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 WRITEF(curfile, d1, d2, d3, d4, d5, d6, d7, d8)
 
 
 WRITEF(curfile, d1, d2, d3, d4, d5, d6, d7, d8)
 
@@ -13,12 +12,13 @@ WRITEF(curfile, d1, d2, d3, d4, d5, d6, d7, d8)
        int                     d3, d4, d5, d6, d7, d8;
 {
        if (curfile->funit & FREAD) {
        int                     d3, d4, d5, d6, d7, d8;
 {
        if (curfile->funit & FREAD) {
-               ERROR(EWRITEIT, curfile->pfname);
+               ERROR("%s: Attempt to write, but open for reading\n",
+                       curfile->pfname);
                return;
        }
        fprintf(d1, d2, d3, d4, d5, d6, d7, d8);
        if (ferror(curfile->fbuf)) {
                return;
        }
        fprintf(d1, d2, d3, d4, d5, d6, d7, d8);
        if (ferror(curfile->fbuf)) {
-               ERROR(EWRITE, curfile->pfname);
+               PERROR("Could not write to ", curfile->pfname);
                return;
        }
 }
                return;
        }
 }
index 38ae490..017e080 100644 (file)
@@ -1,9 +1,8 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)WRITES.c 1.3 %G%";
+static char sccsid[] = "@(#)WRITES.c 1.4 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 WRITES(curfile, d1, d2, d3, d4)
 
 
 WRITES(curfile, d1, d2, d3, d4)
 
@@ -13,12 +12,13 @@ WRITES(curfile, d1, d2, d3, d4)
        char                    *d4;
 {
        if (curfile->funit & FREAD) {
        char                    *d4;
 {
        if (curfile->funit & FREAD) {
-               ERROR(EWRITEIT, curfile->pfname);
+               ERROR("%s: Attempt to write, but open for reading\n",
+                       curfile->pfname);
                return;
        }
        fwrite(d1, d2, d3, d4);
        if (ferror(curfile->fbuf)) {
                return;
        }
        fwrite(d1, d2, d3, d4);
        if (ferror(curfile->fbuf)) {
-               ERROR(EWRITE, curfile->pfname);
+               PERROR("Could not write to ", curfile->pfname);
                return;
        }
 }
                return;
        }
 }
index 4324cc6..077ce2e 100644 (file)
@@ -1,25 +1,25 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-static char sccsid[] = "@(#)WRITLN.c 1.1 %G%";
+static char sccsid[] = "@(#)WRITLN.c 1.2 %G%";
 
 #include "h00vars.h"
 
 #include "h00vars.h"
-#include "h01errs.h"
 
 WRITLN(curfile)
 
        register struct iorec   *curfile;
 {
        if (curfile->funit & FREAD) {
 
 WRITLN(curfile)
 
        register struct iorec   *curfile;
 {
        if (curfile->funit & FREAD) {
-               ERROR(EWRITEIT, curfile->pfname);
+               ERROR("%s: Attempt to write, but open for reading\n",
+                       curfile->pfname);
                return;
        }
        if (++curfile->lcount >= curfile->llimit) {
                return;
        }
        if (++curfile->lcount >= curfile->llimit) {
-               ERROR(ELLIMIT, curfile->pfname);
+               ERROR("%s: Line limit exceeded\n", curfile->pfname);
                return;
        }
        fputc('\n', curfile->fbuf);
        if (ferror(curfile->fbuf)) {
                return;
        }
        fputc('\n', curfile->fbuf);
        if (ferror(curfile->fbuf)) {
-               ERROR(EWRITE, curfile->pfname);
+               PERROR("Could not write to ", curfile->pfname);
                return;
        }
 }
                return;
        }
 }
index a3d56ae..231b25b 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1979 Regents of the University of California */
 
 /* Copyright (c) 1979 Regents of the University of California */
 
-/* sccsid[] = "@(#)h00vars.h 1.6 %G%"; */
+/* sccsid[] = "@(#)h00vars.h 1.7 %G%"; */
 
 #include <stdio.h>
 #include "whoami.h"
 
 #include <stdio.h>
 #include "whoami.h"
@@ -48,11 +48,6 @@ struct formalrtn {
        struct display  fdisp[ MAXLVL ];        /* saved at first passing */
 };
 
        struct display  fdisp[ MAXLVL ];        /* saved at first passing */
 };
 
-struct errentry {
-       long (*entryaddr)();
-};
-
-
 /*
  * program variables
  */
 /*
  * program variables
  */
@@ -65,7 +60,6 @@ extern long           _seed;          /* random number seed */
 extern char            *_maxptr;       /* maximum valid pointer */
 extern char            *_minptr;       /* minimum valid pointer */
 extern long            _pcpcount[];    /* pxp buffer */
 extern char            *_maxptr;       /* maximum valid pointer */
 extern char            *_minptr;       /* minimum valid pointer */
 extern long            _pcpcount[];    /* pxp buffer */
-extern struct errentry _entry[MAXERRS];/* error entry catches */
 
 /*
  * file structures
 
 /*
  * file structures