/*
 * |-----------------------------------------------------------|
 * | Copyright (c) 1991, 1990 MIPS Computer Systems, Inc.      |
 * | All Rights Reserved                                       |
 * |-----------------------------------------------------------|
 * |          Restricted Rights Legend                         |
 * | Use, duplication, or disclosure by the Government is      |
 * | subject to restrictions as set forth in                   |
 * | subparagraph (c)(1)(ii) of the Rights in Technical        |
 * | Data and Computer Software Clause of DFARS 252.227-7013.  |
 * |         MIPS Computer Systems, Inc.                       |
 * |         950 DeGuigne Avenue                               |
 * |         Sunnyvale, California 94088-3650, USA             |
 * |-----------------------------------------------------------|
 */
#ident	"$Header: error.c,v 1.4.2.1 92/06/24 13:44:30 marker Exp $"
#include <stdio.h>
	extern	int	errno;
	extern	char	*O_name;
/*VARARGS1*/
fatal(fmt, arg1, arg2, arg3)
	char	*fmt;
	int	arg1, arg2, arg3;
{
	warning(fmt, arg1, arg2, arg3);
#ifdef	DEBUG
	abort();
#else
	exit(1);
#endif
}

sfatal(str)
	char	*str;
{
	swarning(str);
#ifdef	DEBUG
	abort();
#else
	exit(1);
#endif
}

/*VARARGS1*/
warning(fmt, arg1, arg2, arg3)
	char	*fmt;
	int	arg1, arg2, arg3;
{
	fprintf(stderr, "%s: ", O_name);
	fprintf(stderr, fmt, arg1, arg2, arg3);
	fprintf(stderr, "\n");
}

swarning(str)
	char	*str;
{
#ifdef	DEBUG
	fprintf(stderr, "(%d)  ", errno);
#endif
	fprintf(stderr, "%s: ", O_name);
	perror(str);
}
