
/*
 *	Function	SWError
 *	Programmer	N.d'Alterio
 *	Date		15/09/95
 *
 *  Synopsis:	Displays an error message, either by requester if
 *		running from WB in console if started from CLI.
 *
 *  Arguments:	*swa				Program arguments structure,
 *		*win				Pointer to program window,
 *		*error_str			The error message.
 *
 *  Returns:	None.
 *
 *  Variables:	es				Easy struct for requester 
 * 	
 *  Functions:	EasyRequest			Displays requester (INTUITION)
 *		fprintf				Prints to file stream (ANSI)
 *
 *  $Id: SWError.c 1.4 1995/09/23 19:53:45 daltern Exp $
 *
 */

#include "SpoolWatch.h"

void SWError( struct SWArgs *swa, struct Window *win, char *error_str )

{

  struct EasyStruct es;

  switch ( swa->start ) {

	case WB_START:

		es.es_StructSize   = sizeof( struct EasyStruct );
		es.es_Flags        = 0;
		es.es_Title        = "SpoolWatch Error";
		es.es_TextFormat   = error_str;
		es.es_GadgetFormat = "Ok";

  		EasyRequest( win, &es, NULL );
		break;

	case CLI_START:

		fprintf( stdout, "\n %s\n\n", error_str );
		break;

  }   /* end switch */

}   /* end function SWError */

/*========================================================================*
                          END FUNCTION SWError
 *========================================================================*/