/* This is the test program for the DBugLib package.
   It exercises all features, assuming you actually attempt to
   print, file, and so on. (put the include files where you want them)

   Note that for ANYTHING to happen, #define DEBUG.  This can be done in
   Lattice by giving "-d" (alone) on the first pass.  This also generates
   line numbers in the quad file.

   */

#include <lattice/stdio.h>
#include <mystuff/DBugLib.h>

void main(argc, argv)
int argc; char * argv[];
{
   DEBUG_ENTER("Alpha", "Decimal, then Hex: %d, %x" COMMA 123 COMMA 0x456);
   DEBUG_ENTER("Beta", NULL);
   DEBUGF(2, "If you type an 'F', this will go to a file");
   DEBUG_TRACEBACK();
   DEBUG_RETURN(NULL);
   DEBUGF(5, "Here, close the console. then, wait a while...");
   DEBUGF(5, "This should not display on a closed console");
   DEBUGF(5, "Neither should this");
   DEBUG_OPEN(NULL);
   DEBUGF(0, "This should always display");
   DEBUGF(0, "About to play with Detail levels:");
   DEBUGF(1, "ONE");
   DEBUGF(2, "TWO");
   DEBUGF(3, "THREE");
   DEBUGF(4, "FOUR");
   DEBUGF(5, "FIVE");
   DEBUGF(6, "SIX");
   DEBUGF(7, "SEVEN");
   DEBUGF(8, "EIGHT");
   DEBUGF(9, "NINE");
   DEBUGF(10, "TEN");
   DEBUGF(11, "ELEVEN");
   DEBUGF(10, "Ten");
   DEBUGF(9, "Nine");
   DEBUGF(8, "Eight");
   DEBUGF(7, "Seven");
   DEBUGF(6, "Six");
   DEBUGF(5, "Five");
   DEBUGF(4, "Four");
   DEBUGF(3, "Three");
   DEBUGF(2, "Two");
   DEBUGF(1, "One");
   DEBUGF(0, "Zero");
   DEBUG_TRACEBACK();
   DEBUGF(0, "About to play with function calls:");
      /* Level zero is Alpha */
   DEBUG_ENTER("One", NULL);
   DEBUG_ENTER("Two", NULL);
   DEBUG_ENTER("Three", NULL);
   DEBUG_ENTER("Four", NULL);
   DEBUG_ENTER("Five", NULL);
   DEBUG_ENTER("Six", NULL);
   DEBUG_ENTER("Seven", NULL);
   DEBUG_ENTER("Eight", NULL);
   DEBUG_ENTER("Nine", NULL);
   DEBUG_ENTER("Ten", NULL);
   DEBUG_ENTER("Eleven", NULL);
   DEBUGF(0, "This is a debug statement inside %d" COMMA 11);
   DEBUG_TRACEBACK();
   DEBUG_RETURN("Eleven");
   DEBUG_RETURN("Ten");
   DEBUG_RETURN("Nine");
   DEBUG_RETURN("Eight");
   DEBUG_TRACEBACK();
   DEBUG_ENTER("Eight", NULL);
   DEBUG_ENTER("Nine", NULL);
   DEBUG_ENTER("Ten", NULL);
   DEBUG_ENTER("Eleven", NULL);
   DEBUG_TRACEBACK();
   DEBUG_RETURN("Eleven");
   DEBUG_RETURN("Ten");
   DEBUG_RETURN("Nine");
   DEBUG_RETURN("Eight");
   DEBUG_TRACEBACK();
   DEBUG_RETURN("Seven");
   DEBUG_RETURN("Six");
   DEBUG_RETURN("Five");
   DEBUG_RETURN("Four");
   DEBUG_TRACEBACK();
   DEBUG_RETURN(NULL);
   DEBUG_RETURN(NULL);
   DEBUG_RETURN(NULL);
   DEBUG_RETURN("Returning a string from alpha: |%s|" COMMA "A string!");
   Exit(0);
   }


