/* @(#)diagmesg.h	1.4	2/10/93 */
/*******************************************************************************

This code was written and designed by 
Andrew Gene HALL of I.N. Services Pty. Ltd., Scarborough WA, Australia,
for the 
University of Western Australia, Crawley WA, Australia.

*******************************************************************************/
#ifndef DIAGMESG_H
#define DIAGMESG_H
#include <stdio.h>

/* extern int fprintf(); CHANGE 9/3 */

/* Global types */
/* Possible settings for the Diagnostic Reporting Level */
enum Diagnostic_Level	{ NONE, ERROR, INFORM, DEBUG };

/* Declaration of global variables */
extern enum Diagnostic_Level	current_level;
extern FILE			*error_fp;

/* macros for doing Diagnostic Report */
#define ERROR_MSG( s )\
do{ if ( current_level >= ERROR  ) fprintf( error_fp, "(e)   %s\n", s); }while(0)
#define INFORM_MSG( s )\
do{ if ( current_level >= INFORM ) fprintf( error_fp, "(i)   %s\n", s); }while(0)
#define DEBUG_MSG( s )\
do{ if ( current_level >= DEBUG  ) fprintf( error_fp, "(d)   %s\n", s); }while(0)

/* buffer control */
#define BUFFER_BLOCK 32

extern void	Buffer_MSG( enum Diagnostic_Level, char *);
extern void	Flush_MSG( void );
#endif
