errormain.c 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 1990 Sun Microsystems. Inc */
#pragma ident "%Z%%M% %I% %E% SMI"
/* - - - - -- - - - -- - - - - - - - - - - - - - - - - - - - - -*/
#include <stdio.h>
#include <ctype.h>
#include <signal.h>
#include "error.h"
int nerrors = 0;
int nfiles = 0;
char *currentfilename = "????";
char *processname;
int errorsort();
#ifdef SUNOS
extern int onintr();
#else
extern void onintr(int);
#endif
/*
* error [-I ignorename] [-n] [-q] [-t suffixlist] [-s] [-v] [infile]
*
* -T: terse output
*
* -I: the following name, `ignorename' contains a list of
* function names that are not to be treated as hard errors.
* Default: ~/.errorsrc
*
* -n: don't touch ANY files!
*
* -q: The user is to be queried before touching each
* file; if not specified, all files with hard, non
* ignorable errors are touched (assuming they can be).
*
* -t: touch only files ending with the list of suffices, each
* suffix preceded by a dot.
* eg, -t .c.y.l
* will touch only files ending with .c, .y or .l
*
* -s: print a summary of the error's categories.
*
* -v: after touching all files, overlay vi(1), ex(1) or ed(1)
* on top of error, entered in the first file with
* an error in it, with the appropriate editor
* set up to use the "next" command to get the other
* files containing errors.
*
* -p: (obsolete: for older versions of pi without bug
* fix regarding printing out the name of the main file
* with an error in it)
* Take the following argument and use it as the name of
* the pascal source file, suffix .p
*
* -E: show the errors in sorted order; intended for
* debugging.
*
* -S: show the errors in unsorted order
* (as they come from the error file)
*
* infile: The error messages come from this file.
* Default: stdin
*/
int argc;
char *argv[];
{
char *cp;
char *ignorename = 0;
int ed_argc;
char **ed_argv; /*return from touchfiles*/
processname = argv[0];
default:
processname, *cp);
break;
case 't':
if (argc > 1){
}
break;
case 'I': /*ignore file name*/
if (argc > 1)
break;
}
}
if (notouch)
suffixlist = 0;
if (argc > 1){
if (argc > 3){
exit(3);
}
exit(4);
}
}
if (query){
"%s: Can't open \"%s\" to query the user.\n",
processname, im_on);
exit(9);
}
}
if (Show_Errors)
if (show_errors)
if (pr_summary){
if (nunknown)
P("%d Errors are unclassifiable.\n", nunknown);
if (nignore)
P("%d Errors are classifiable, but totally discarded.\n",nignore);
if (nsyncerrors)
P("%d Errors are synchronization errors.\n", nsyncerrors);
if (nignore)
P("%d Errors are discarded because they refer to sacrosinct files.\n", ndiscard);
if (nnulled)
P("%d Errors are nulled because they refer to specific functions.\n", nnulled);
if (nnonspec)
P("%d Errors are not specific to any file.\n", nnonspec);
if (nthisfile)
P("%d Errors are specific to a given file, but not to a line.\n", nthisfile);
if (ntrue)
P("%d Errors are true errors, and can be inserted into the files.\n", ntrue);
}
exit(0);
/* NOTREACHED */
}
int argc;
char **argv;
{
if (query){
? "Edit? "
: "Do you still want to edit the files you touched? ")){
case Q_NO:
case Q_no:
return;
default:
break;
}
}
/*
* ed_agument's first argument is
* to find the first occurance of ###
*/
}
char *name;
int argc;
char **argv;
{
sleep(2);
return;
return;
}
{
int order;
/*
* Sort by:
* 1) synchronization, non specific, discarded errors first;
* 2) nulled and true errors last
* a) grouped by similar file names
* 1) grouped in ascending line number
*/
return(0);
}
if (order == 0){
}
return(order);
}