/*
**	$VER: debug.h 1.1 (23.02.94)
**
**	debug library header file
**
**	© Copyright 1994 by Norbert Püschel
**	All Rights Reserved
*/

#ifndef DEBUG_H
#define DEBUG_H

#ifdef DEBUG

#include <proto/exec.h>

#pragma libcall DebugBase DEBUGA 1e 32103
#pragma tagcall DebugBase DEBUG 1e 32103

#ifndef DEBUG_LOGFILE
#define DEBUG_LOGFILE "t:debug.log"
#endif

void DEBUGA(STRPTR fname,STRPTR format,LONG *args);

static void bug(STRPTR format,...)

{
  struct Library *DebugBase;

  DebugBase = OpenLibrary("debug.library",0);
  if(DebugBase) {
    DEBUGA(DEBUG_LOGFILE,format,(LONG *)(&format+1));
    CloseLibrary(DebugBase);
  }
}

#define D(x) x /* for D(bug(...)) */

#else

#define D(x)

#endif

#endif
