/*
 * debug.h
 *
 * Author: Tomi Ollila <too@cs.hut.fi>
 *
 * 	Copyright (c) 1993 Tomi Ollila
 * 	    All rights reserved
 *
 * Created: Mon Nov 15 23:22:32 1993 too
 * Last modified: Mon Nov 15 23:26:22 1993 too
 *
 * HISTORY
 * $Log: debug.h,v $
 * Revision 1.1  1993/11/17  11:47:44  too
 * Initial revision
 *
 * Revision 1.1  1993/11/17  11:47:44  too
 * Initial revision
 *
 */

#ifndef _DEBUG_H_
#define _DEBUG_H_

#ifdef DEBUG

#define ReplyPkt(packet, res1, res2) do \
{ \
    syslog(7, "ReplyPkt - " __FILE__ ":%ld: -- pkt: %lx res1: %ld res2: %ld\n", \
	   __LINE__, (LONG)packet, res1, res2); \
    ReplyPkt(packet, res1, res2); \
} while(0)

#define BP0 do { syslog(7, "** " __FILE__ ":%ld: **", __LINE__); \
		   Wait(SIGBREAKF_CTRL_E); \
	       } while (0)

#define DP0 syslog(7, "-- " __FILE__ ":%ld: --", __LINE__);

#define BP(fmt, args...) \
  do { \
	 LONG _args[] = { __LINE__, args }; \
         Syslog(7, "** " __FILE__ ":%ld: " fmt, (LONG *)_args); \
	 Wait(SIGBREAKF_CTRL_E); \
     } while(0)

#define DP(fmt, args...) \
  do { \
	 LONG _args[] = { __LINE__, args }; \
         Syslog(7, "-- " __FILE__ ":%ld: " fmt, (LONG *)_args); \
     } while(0)

#else /* not DEBUG */

#define BP0;
#define BP (void)
#define DP0;
#define DP (void)

#endif /* DEBUG */

#endif /* _DEBUG_H_ */

