error.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
typedef int boolean;
#define reg register
#define TRUE 1
#define FALSE 0
#define true 1
#define false 0
/*
* Descriptors for the various languages we know about.
* If you touch these, also touch lang_table
*/
#define INUNKNOWN 0
#define INCPP 1
#define INCC 2
#define INAS 3
#define INLD 4
#define INLINT 5
#define INF77 6
#define INPI 7
#define INPC 8
#define INFRANZ 9
#define INLISP 10
#define INVAXIMA 11
#define INRATFOR 12
#define INLEX 13
#define INYACC 14
#define INAPL 15
#define INMAKE 16
#define INRI 17
#define INTROFF 18
#define INMOD2 19
#define INSUNF77 20
extern int language;
/*
* We analyze each line in the error message file, and
* attempt to categorize it by type, as well as language.
* Here are the type descriptors.
*/
typedef int Errorclass;
#define C_FIRST 0 /* first error category */
#define C_UNKNOWN 0 /* must be zero */
#define SORTABLE(x) (!(NOTSORTABLE(x)))
#define NOTSORTABLE(x) (x <= C_NONSPEC)
/*
* Resources to count and print out the error categories
*/
extern char *class_table[];
extern int class_count[];
/* places to put the error complaints */
extern char *currentfilename;
extern char *processname;
extern char *scriptname;
/*
* codes for inquire() to return
*/
int probethisfile();
/*
* codes for probethisfile to return
*/
#define F_NOTEXIST 1
#define F_NOTREAD 2
#define F_NOTWRITE 3
#define F_TOUCHIT 4
/*
* Describes attributes about a language
*/
struct lang_desc{
char *lang_name;
char *lang_incomment; /* one of the following defines */
char *lang_outcomment; /* one of the following defines */
};
extern struct lang_desc lang_table[];
#define CINCOMMENT "/*###"
#define COUTCOMMENT "%%%*/\n"
#define FINCOMMENT "C###"
#define FOUTCOMMENT "%%%\n"
#define NEWLINE "%%%\n"
#define PIINCOMMENT "(*###"
#define PIOUTCOMMENT "%%%*)\n"
#define LISPINCOMMENT ";###"
#define ASINCOMMENT "####"
#define RIINCOMMENT CINCOMMENT
#define RIOUTCOMMENT COUTCOMMENT
#define TROFFINCOMMENT ".\\\"###"
#define TROFFOUTCOMMENT NEWLINE
#define MOD2INCOMMENT "(*###"
#define MOD2OUTCOMMENT "%%%*)\n"
/*
* Defines and resources for determing if a given line
* is to be discarded because it refers to a file not to
* be touched, or if the function reference is to a
* function the user doesn't want recorded.
*/
#define IG_FILE1 "llib-lc"
#define IG_FILE2 "llib-port"
#define ERRORNAME "/.errorrc"
int nignored;
char **names_ignored;
/*
* Structure definition for a full error
*/
struct edesc{
int error_lgtext; /* how many on the right hand side*/
char **error_text; /* the right hand side proper*/
int error_language; /* the language for this error*/
int error_position; /* oridinal position */
int error_line; /* discovered line number*/
int error_no; /* sequence number on input */
};
/*
* Resources for the true errors
*/
extern int nerrors;
/*
* Resources for each of the files mentioned
*/
extern int nfiles;
/*
* The langauge the compilation is in, as intuited from
* the flavor of error messages analyzed.
*/
extern int langauge;
extern char *currentfilename;
/*
* Functional forwards
*/
char *Calloc();
char *strsave();
char *clobberfirst();
char lastchar();
char firstchar();
char next_lastchar();
char **wordvsplice();
int wordvcmp();
/*
* Printing hacks
*/