1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)error.h	5.1 (Berkeley) 5/31/85
   7:  */
   8: 
   9: typedef int boolean;
  10: #define reg register
  11: 
  12: #define TRUE    1
  13: #define FALSE   0
  14: 
  15: #define true    1
  16: #define false   0
  17: /*
  18:  *	Descriptors for the various languages we know about.
  19:  *	If you touch these, also touch lang_table
  20:  */
  21: #define INUNKNOWN   0
  22: #define INCPP   1
  23: #define INCC    2
  24: #define INAS    3
  25: #define INLD    4
  26: #define INLINT  5
  27: #define INF77   6
  28: #define INPI    7
  29: #define INPC    8
  30: #define INFRANZ 9
  31: #define INLISP  10
  32: #define INVAXIMA    11
  33: #define INRATFOR    12
  34: #define INLEX   13
  35: #define INYACC  14
  36: #define INAPL   15
  37: #define INMAKE  16
  38: #define INRI    17
  39: #define INTROFF 18
  40: #define INMOD2  19
  41: 
  42: extern  int language;
  43: /*
  44:  *	We analyze each line in the error message file, and
  45:  *	attempt to categorize it by type, as well as language.
  46:  *	Here are the type descriptors.
  47:  */
  48: typedef int Errorclass;
  49: 
  50: #define C_FIRST 0       /* first error category */
  51: #define C_UNKNOWN   0   /* must be zero */
  52: #define C_IGNORE    1   /* ignore the message; used for pi */
  53: #define C_SYNC      2   /* synchronization errors */
  54: #define C_DISCARD   3   /* touches dangerous files, so discard */
  55: #define C_NONSPEC   4   /* not specific to any file */
  56: #define C_THISFILE  5   /* specific to this file, but at no line */
  57: #define C_NULLED    6   /* refers to special func; so null */
  58: #define C_TRUE      7   /* fits into true error format */
  59: #define C_DUPL      8   /* sub class only; duplicated error message */
  60: #define C_LAST  9       /* last error category */
  61: 
  62: #define SORTABLE(x) (!(NOTSORTABLE(x)))
  63: #define NOTSORTABLE(x)  (x <= C_NONSPEC)
  64: /*
  65:  *	Resources to count and print out the error categories
  66:  */
  67: extern  char        *class_table[];
  68: extern  int     class_count[];
  69: 
  70: #define nunknown    class_count[C_UNKNOWN]
  71: #define nignore     class_count[C_IGNORE]
  72: #define nsyncerrors class_count[C_SYNC]
  73: #define ndiscard    class_count[C_DISCARD]
  74: #define nnonspec    class_count[C_NONSPEC]
  75: #define nthisfile   class_count[C_THISFILE]
  76: #define nnulled     class_count[C_NULLED]
  77: #define ntrue       class_count[C_TRUE]
  78: #define ndupl       class_count[C_DUPL]
  79: 
  80: /* places to put the error complaints */
  81: 
  82: #define TOTHEFILE   1   /* touch the file */
  83: #define TOSTDOUT    2   /* just print them out (ho-hum) */
  84: 
  85: FILE    *errorfile; /* where error file comes from */
  86: FILE    *queryfile; /* where the query responses from the user come from*/
  87: 
  88: extern  char    *currentfilename;
  89: extern  char    *processname;
  90: extern  char    *scriptname;
  91: 
  92: extern  boolean query;
  93: extern  boolean terse;
  94: int inquire();          /* inquire for yes/no */
  95: /*
  96:  *	codes for inquire() to return
  97:  */
  98: #define Q_NO    1           /* 'N' */
  99: #define Q_no    2           /* 'n' */
 100: #define Q_YES   3           /* 'Y' */
 101: #define Q_yes   4           /* 'y' */
 102: 
 103: int probethisfile();
 104: /*
 105:  *	codes for probethisfile to return
 106:  */
 107: #define F_NOTEXIST  1
 108: #define F_NOTREAD   2
 109: #define F_NOTWRITE  3
 110: #define F_TOUCHIT   4
 111: 
 112: /*
 113:  *	Describes attributes about a language
 114:  */
 115: struct lang_desc{
 116:     char    *lang_name;
 117:     char    *lang_incomment;    /* one of the following defines */
 118:     char    *lang_outcomment;   /* one of the following defines */
 119: };
 120: extern struct lang_desc lang_table[];
 121: 
 122: #define CINCOMMENT  "/*###"
 123: #define COUTCOMMENT "%%%*/\n"
 124: #define FINCOMMENT  "C###"
 125: #define FOUTCOMMENT "%%%\n"
 126: #define NEWLINE     "%%%\n"
 127: #define PIINCOMMENT "(*###"
 128: #define PIOUTCOMMENT    "%%%*)\n"
 129: #define LISPINCOMMENT   ";###"
 130: #define ASINCOMMENT "####"
 131: #define RIINCOMMENT CINCOMMENT
 132: #define RIOUTCOMMENT    COUTCOMMENT
 133: #define TROFFINCOMMENT  ".\\\"###"
 134: #define TROFFOUTCOMMENT NEWLINE
 135: #define MOD2INCOMMENT   "(*###"
 136: #define MOD2OUTCOMMENT  "%%%*)\n"
 137: /*
 138:  *	Defines and resources for determing if a given line
 139:  *	is to be discarded because it refers to a file not to
 140:  *	be touched, or if the function reference is to a
 141:  *	function the user doesn't want recorded.
 142:  */
 143: #define IG_FILE1    "llib-lc"
 144: #define IG_FILE2    "llib-port"
 145: #define IG_FILE3    "/usr/lib/llib-lc"
 146: #define IG_FILE4    "/usr/lib/llib-port"
 147: 
 148: #define ERRORNAME   "/.errorrc"
 149: int nignored;
 150: char    **names_ignored;
 151: /*
 152:  *	Structure definition for a full error
 153:  */
 154: typedef struct edesc    Edesc;
 155: typedef Edesc   *Eptr;
 156: 
 157: struct edesc{
 158:     Eptr    error_next;     /*linked together*/
 159:     int error_lgtext;       /* how many on the right hand side*/
 160:     char    **error_text;       /* the right hand side proper*/
 161:     Errorclass  error_e_class;  /* error category of this error*/
 162:     Errorclass  error_s_class;  /* sub descriptor of error_e_class*/
 163:     int error_language;     /* the language for this error*/
 164:     int error_position;     /* oridinal position */
 165:     int error_line;     /* discovered line number*/
 166:     int error_no;       /* sequence number on input */
 167: };
 168: /*
 169:  *	Resources for the true errors
 170:  */
 171: extern  int nerrors;
 172: extern  Eptr    er_head;
 173: extern  Eptr    *errors;
 174: /*
 175:  *	Resources for each of the files mentioned
 176:  */
 177: extern  int nfiles;
 178: extern  Eptr    **files;    /* array of pointers into errors*/
 179: boolean *touchedfiles;          /* which files we touched */
 180: /*
 181:  *	The langauge the compilation is in, as intuited from
 182:  *	the flavor of error messages analyzed.
 183:  */
 184: extern  int langauge;
 185: extern  char    *currentfilename;
 186: /*
 187:  *	Functional forwards
 188:  */
 189: char    *Calloc();
 190: char    *strsave();
 191: char    *clobberfirst();
 192: char    lastchar();
 193: char    firstchar();
 194: char    next_lastchar();
 195: char    **wordvsplice();
 196: int wordvcmp();
 197: boolean persperdexplode();
 198: /*
 199:  *	Printing hacks
 200:  */
 201: char    *plural(), *verbform();

Defined variables

names_ignored defined in line 150; used 7 times
nignored defined in line 149; used 10 times
touchedfiles defined in line 179; used 7 times

Defined struct's

edesc defined in line 157; used 1 times
lang_desc defined in line 115; used 4 times

Defined typedef's

Edesc defined in line 154; used 2 times
Eptr defined in line 155; used 47 times
Errorclass defined in line 48; used 35 times

Defined macros

ASINCOMMENT defined in line 130; used 2 times
CINCOMMENT defined in line 122; used 2 times
COUTCOMMENT defined in line 123; used 2 times
C_DISCARD defined in line 54; used 2 times
C_DUPL defined in line 59; used 3 times
C_FIRST defined in line 50; used 1 times
C_LAST defined in line 60; used 1 times
C_NONSPEC defined in line 55; used 9 times
C_NULLED defined in line 57; used 3 times
C_SYNC defined in line 53; used 13 times
C_THISFILE defined in line 56; used 2 times
C_TRUE defined in line 58; used 27 times
C_UNKNOWN defined in line 51; used 35 times
ERRORNAME defined in line 148; used 1 times
FINCOMMENT defined in line 124; used 1 times
FOUTCOMMENT defined in line 125; used 1 times
F_NOTEXIST defined in line 107; used 1 times
F_NOTREAD defined in line 108; used 1 times
F_NOTWRITE defined in line 109; used 1 times
F_TOUCHIT defined in line 110; used 1 times
IG_FILE1 defined in line 143; used 1 times
IG_FILE2 defined in line 144; used 1 times
IG_FILE3 defined in line 145; used 1 times
IG_FILE4 defined in line 146; used 1 times
INAPL defined in line 36; never used
INAS defined in line 24; used 1 times
INCC defined in line 23; used 4 times
INCPP defined in line 22; used 1 times
INF77 defined in line 27; used 1 times
INFRANZ defined in line 30; never used
INLD defined in line 25; used 4 times
INLEX defined in line 34; never used
INLINT defined in line 26; used 5 times
INLISP defined in line 31; never used
INMAKE defined in line 37; used 3 times
INMOD2 defined in line 40; used 1 times
INPC defined in line 29; never used
INPI defined in line 28; used 8 times
INRATFOR defined in line 33; never used
INRI defined in line 38; used 1 times
INTROFF defined in line 39; used 1 times
INUNKNOWN defined in line 21; used 1 times
INVAXIMA defined in line 32; never used
INYACC defined in line 35; never used
LISPINCOMMENT defined in line 129; used 1 times
MOD2INCOMMENT defined in line 135; used 1 times
MOD2OUTCOMMENT defined in line 136; used 1 times
NEWLINE defined in line 126; used 2 times
NOTSORTABLE defined in line 63; used 7 times
PIINCOMMENT defined in line 127; used 1 times
PIOUTCOMMENT defined in line 128; used 1 times
Q_NO defined in line 98; used 3 times
Q_YES defined in line 100; used 2 times
Q_no defined in line 99; used 1 times
Q_yes defined in line 101; used 1 times
RIINCOMMENT defined in line 131; used 1 times
RIOUTCOMMENT defined in line 132; used 1 times
SORTABLE defined in line 62; used 1 times
TOSTDOUT defined in line 83; used 8 times
TOTHEFILE defined in line 82; used 2 times
TROFFINCOMMENT defined in line 133; used 1 times
TROFFOUTCOMMENT defined in line 134; used 1 times
false defined in line 16; never used
ndiscard defined in line 73; used 2 times
ndupl defined in line 78; never used
nignore defined in line 71; used 4 times
nnonspec defined in line 74; used 3 times
nnulled defined in line 76; used 3 times
nsyncerrors defined in line 72; used 3 times
nthisfile defined in line 75; used 3 times
ntrue defined in line 77; used 3 times
nunknown defined in line 70; used 3 times
true defined in line 15; never used

Usage of this include

Last modified: 1985-05-31
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1923
Valid CSS Valid XHTML 1.0 Strict