#ifndef DEBUG_H
#define DEBUG_H

/* debug.h
**
** $VER: debug.h 0.1 (31.03.94)
**
** by
**
** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
**
** (C) Copyright 1994
** All Rights Reserved !
**
** $HISTORY:
**
** 31.03.94 : 000.001 : initial
*/

#define bug      kprintf

#ifdef DEBUG

extern void kprintf(char *fmt,...);

#define D(x)     x
#define DB(x)   { bug(__FILE__ "(%4ld):" __FUNC__ "() :",__LINE__); \
						bug x; \
					 }

#define DTL(x)  { struct TagItem *tstate = x; \
						struct TagItem *tag; \
						bug(__FILE__ "(%4ld):" __FUNC__ "() TagList :\n",__LINE__); \
						while((tag = NextTagItem(&tstate))) \
						  bug("{0x%08lx,0x%08lx}\n",tag->ti_Tag,tag->ti_Data); \
					 }

#define ENTERING  bug("entering " __FUNC__ "()\n")
#define LEAVING   bug("leaving " __FUNC__ "()\n")

#else

#define D(x)
#define DB(x)
#define DTL(x)
#define ENTERING
#define LEAVING

#endif

#endif   /* DEBUG_H */

