home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d0xx / d045 / make.lha / Make / debug.c next >
Encoding:
C/C++ Source or Header  |  1986-12-03  |  1.3 KB  |  57 lines

  1. #include "make.h"
  2.  
  3. #ifdef DEBUG
  4. /*----------------------------------------------------------------*/
  5. ptime( file, t )
  6. char *file;
  7. long t;
  8.    {
  9.    int date, time;
  10.  
  11.    date = (t >> 17) & 0x7fffL;
  12.    time = t & 0x1ffffL;
  13.  
  14.    printf("%s: %ld - ", file, date );
  15.    printf("%02ld:%02ld:%02ld\n", (time / (60*60)),
  16.                                  (time / 60) % 60,
  17.                                  (time % 60) );
  18.    }
  19.  
  20. /*----------------------------------------------------------------*/
  21. static printlist( node )
  22. STRNODE *node;
  23.    {
  24.    for( ; node != NULL; node=node->next )
  25.       printf("|    %s\n", node->string);
  26.    }
  27.  
  28. /*----------------------------------------------------------------*/
  29. pnode( node )
  30. TNODE *node;
  31.    {
  32.    printf("+-------------------------------------\n" );
  33.    printf("|  node at $%08lx\n",                      node );
  34.    printf("|  targets:\n");
  35.               printlist( node->targets );
  36.    printf("|  dependancies :\n" );
  37.               printlist( node->depends );
  38.    printf("|  commands:\n" );
  39.               printlist( node->commands );
  40.    printf("+-------------------------------------\n" );
  41.    }
  42.  
  43. /*----------------------------------------------------------------*/
  44. trav( root )
  45. TREENODE *root;
  46.    {
  47.    if (root != NULL )
  48.       {
  49.       trav( root->lnode );
  50.       pnode( root->inode);
  51.       trav( root->rnode );
  52.       }
  53.    }
  54. #else
  55. ptime(){}
  56. #endif
  57.