File:  [MW Coherent from dump] / coherent / b / bin / as / mwcvar.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:36 2019 UTC (7 years, 2 months ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * MWC K&R C version of error message functions.
 */
#include <asm.h>
#include <errno.h>

/*
 * Show line numbers if no listing.
 */
static void
showLine()
{
	if (!((NULL == inpc) || lswitchX))
		fprintf(errdev, "%d: %s: ", inpc->lineNo, inpc->name);
}

/*
 * Print error msg and die.
 */
/*VARARGS1*/
void
fatal(s)
char *s;
{
	int save = errno;

	if (Qswitch)
		exit(1);

	showLine();
	fprintf(errdev, "%r\n", &s);

	if (0 != (errno = save))
		perror("errno reports");

	exit(1);
}

/*
 * Print error msg to listing.
 */
/*VARARGS1*/
void
yyerror(s)
char *s;
{
	if (2 != pass)
		return;
	errCt++;
	sTitle();

	if (Qswitch)
		return;

	showLine();
	fprintf(errdev, "%r\n", &s);
}

/*
 * Print warning msg to listing.
 */
/*VARARGS1*/
void
yywarn(s)
char *s;
{
	if ((2 != pass) || wswitch || Qswitch)
		return;
	sTitle();

	showLine();
	fprintf(errdev, "Warning %r\n", &s);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.