/*
 *	$Id: wtrace.h,v 1.1 1997/01/03 19:44:55 james Exp james $
 *	$log$
 */

#ifndef _WTRACE_H
#define _WTRACE_H

#include <errno.h>

#ifndef FAILURE
#	define FAILURE 0
#endif

#ifndef SUCCESS
#	define SUCCESS 1
#endif

/* trace commands */
#define START 0
#define STOP  1
#define PRINT 2


#ifdef __cplusplus
extern	"C" {
#endif 

#ifdef __STDC__
	int		Trace(int, const char *, ...);
#else
	int		Trace();
#endif

#ifdef __cplusplus
}
#endif 

#ifdef _DEBUG
# define TRACE_START Trace( START, "%s\t%s", __fn, "started" )
# define TRACE_STOP Trace( STOP, "%s\t%s", __fn, "returned" )
# define TRACE_LINE Trace( PRINT, "%s: %d", __FILE__, __LINE__ )
# define TRACE_PRINT( a ) Trace( PRINT, a )
# define TRACE_MSG0( a ) Trace( PRINT, a )
# define TRACE_MSG1( a, b ) Trace( PRINT, a, b )
# define TRACE_MSG2( a, b, c ) Trace( PRINT, a, b, c )
#else
# define TRACE_START
# define TRACE_STOP
# define TRACE_LINE
# define TRACE_PRINT
# define TRACE_MSG0
# define TRACE_MSG1
# define TRACE_MSG2
#endif

#endif /* _WTRACE_H */
