1: #include "defs"
   2: #include "string_defs"
   3: 
   4: #ifdef  C_OVERLAY
   5: char efilname[] = "/lib/f77_strings";
   6: int  efil = -1;
   7: 
   8: error(index,t,u,type)
   9: unsigned index;
  10: char *t, *u;
  11: register int type;
  12: {
  13:     char buf[100];
  14:     long lseek();
  15: 
  16:     if (efil < 0) {
  17:         efil = open(efilname, 0);
  18:         if (efil < 0) {
  19: oops:
  20:             perror(efilname);
  21:             exit(1);
  22:         }
  23:     }
  24:     if (lseek(efil, (long) index, 0) < 0 || read(efil, buf, sizeof(buf)) <= 0)
  25:         goto oops;
  26:     switch (type) {
  27:         case WARN1:
  28:         case WARN:
  29:         if(nowarnflag)
  30:             return;
  31:         fprintf(diagfile, "Warning on line %d of %s: ", lineno, infname);
  32:         ++nwarn;
  33:         break;
  34: 
  35:         case YYERR:
  36:         case ERR2:
  37:         case ERR1:
  38:         case ERR:
  39:         fprintf(diagfile, "Error on line %d of %s: ", lineno, infname);
  40:         ++nerr;
  41:         break;
  42: 
  43:         case FATAL1:
  44:         case FATAL:
  45:         fprintf(diagfile,"f77 compiler error line %d of %s: ", lineno, infname);
  46:         if(debugflag)
  47:             abort();
  48:         done(3);
  49:         exit(3);
  50:         case EXECERR:
  51:         fprintf(diagfile, "Error on line %d of %s: ", lineno, infname);
  52:         fprintf(diagfile,"Execution error %s");
  53:         ++nerr;
  54:         break;
  55:         case DCLERR:
  56:         if(t)
  57:             fprintf(diagfile,"Declaration error for %s: %s\n",
  58:             varstr(VL, (struct nameblock *)t->varname), buf);
  59:         else
  60:             fprintf(diagfile,"Declaration error %s\n", buf);
  61:         return;
  62: 
  63:         default:
  64:         fprintf(diagfile,"unrecognizable error switch\n");
  65:         exit(1);
  66:         /*NOTREACHED*/
  67:     }
  68:     fprintf(diagfile,buf,t,u);
  69:     fprintf(diagfile,"\n");
  70: }
  71: 
  72: #else   C_OVERLAY
  73: 
  74: error(str,t,u,type)
  75: char *str, *t, *u;
  76: register int type;
  77: {
  78:     switch (type) {
  79:         case WARN1:
  80:         case WARN:
  81:         if(nowarnflag)
  82:             return;
  83:         fprintf(diagfile, "Warning on line %d of %s: ", lineno, infname);
  84:         ++nwarn;
  85:         break;
  86: 
  87:         case YYERR:
  88:         case ERR2:
  89:         case ERR1:
  90:         case ERR:
  91:         fprintf(diagfile, "Error on line %d of %s: ", lineno, infname);
  92:         ++nerr;
  93:         break;
  94: 
  95:         case FATAL1:
  96:         case FATAL:
  97:         fprintf(diagfile,"f77 compiler error line %d of %s: ", lineno, infname);
  98:         if(debugflag)
  99:             abort();
 100:         done(3);
 101:         exit(3);
 102:         case EXECERR:
 103:         fprintf(diagfile, "Error on line %d of %s: ", lineno, infname);
 104:         fprintf(diagfile, "Execution error %s");
 105:         ++nerr;
 106:         break;
 107:         case DCLERR:
 108:         if(t)
 109:             fprintf(diagfile,"Declaration error for %s: %s\n",
 110:             varstr(VL, (struct nameblock *)t->varname), str);
 111:         else
 112:             fprintf(diagfile,"Declaration error %s\n", str);
 113:         return;
 114: 
 115:         default:
 116:         fprintf(diagfile,"unrecognizable error switch\n");
 117:         exit(1);
 118:         /*NOTREACHED*/
 119:     }
 120:     fprintf(diagfile,str,t,u);
 121:     fprintf(diagfile,"\n");
 122: }
 123: 
 124: #endif	C_OVERLAY

Defined functions

error defined in line 74; used 216 times

Defined variables

efil defined in line 6; used 5 times
efilname defined in line 5; used 2 times
Last modified: 1983-12-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 880
Valid CSS Valid XHTML 1.0 Strict