File:  [MW Coherent from dump] / coherent / b / bin / as / unixvar.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

/*
 * UNIX K&R version of error message functions.
 */
#include <varargs.h>

/*
 * Put message and die.
 */
/*VARARGS*/
void
fatal(va_alist)
va_dcl
{
	va_list args;
	char *fmt;
		
	if(NULL != inpc)
		printf("%d: %s: ", inpc->lineNo, inpc->name);	/* NODOC */

	va_start(args);
	fmt = va_arg(args, char *);
	vprintf(fmt, args);
	va_end(args);

	putchar('\n');
	exit(1);
}

/*
 * Put message to listing.
 */
/*VARARGS*/
void
yyerror(va_alist)	/* NODOC */
va_dcl
{
	va_list args;
	char *fmt;
		
	if(2 != pass)
		return;
	sTitle();
	if(NULL != inpc)
		printf("%d: %s: ", inpc->lineNo, inpc->name);

	va_start(args);
	fmt = va_arg(args, char *);
	vprintf(fmt, args);
	va_end(args);

	putchar('\n');
}

unix.superglobalmegacorp.com

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