/*****************************************************************************

	DspChr()

	This function displays a single character on the terminal screen in
the format used by error reporting.  Non-displayable characters are converted
into a displayable form,  but not the caret form.  See below.

*****************************************************************************/

#include "ZPort.h"		/* define portability identifiers */
#include "DefChars.h"		/* define identifiers for characters */

extern	VOID	ZDspBf();	/* output a buffer to the terminal */
extern	VOID	ZDspCh();	/* output a character to the terminal */

VOID DspChr(Charac)
char Charac;
{
	switch (Charac) {
		case TABCHR:	ZDspBf("<TAB>", 5);
				break;
		case LINEFD:	ZDspBf("<LF>", 4);
				break;
		case VRTTAB:	ZDspBf("<VT>", 4);
				break;
		case FORMFD:	ZDspBf("<FF>", 4);
				break;
		case CRETRN:	ZDspBf("<CR>", 4);
				break;
		case ESCAPE:	ZDspBf("<ESC>", 5);
				break;
		case '\0':	ZDspBf("<NUL>", 5);
				break;
		default:
				if (Charac < SPACE)
					{
					ZDspCh('<');
					ZDspCh('^');
					ZDspCh(Charac + '\100');
					ZDspCh('>');
					}
				else
					ZDspCh(Charac);
	}
}
