home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d103 / avltrees.lha / AvlTrees / vixie.h < prev   
C/C++ Source or Header  |  1987-10-22  |  2KB  |  74 lines

  1. /* vixie.h - include file to define general vixie-type things
  2.  * v1.0 vix 21jun86 [broken out of as.h]
  3.  */
  4.  
  5. #ifdef    DOCUMENTATION
  6.  
  7. There are two macros you can define before including this file which can
  8. change the things defined by this file.
  9.  
  10. DEBUG:    if defined, will cause enter/exit messages to be printed by the
  11.     ENTER/EXIT/EXITV macros.  If not defined, causes ENTER to do nothing,
  12.     and EXIT/EXITV to generate 'return' without any messages.
  13.  
  14.     If defined, should be set to the name of the including module.
  15.  
  16. MAIN:    Should be defined for a program containing a main() function which
  17.     is linked with other modules which include this file.
  18.  
  19.     Value is not important, only existence/nonexistence matters.
  20.  
  21. #endif    DOCUMENTATION
  22.  
  23.  
  24. #ifndef    _VIXIE_FLAG
  25. #define    _VIXIE_FLAG
  26.  
  27.  
  28.                         /*--- debugging stuff ---*/
  29. #define    MAXPROC    256
  30.  
  31. #ifdef DEBUG
  32. #define    ENTER(proc) { \
  33.             APC_PROCS[I_PROC] = proc; \
  34.             printf("ENTER(%d:%s.%s)\n", \
  35.                 I_PROC, DEBUG, APC_PROCS[I_PROC]); \
  36.             I_PROC++; \
  37.         }
  38. #define    EXIT(value) { \
  39.             I_PROC--; \
  40.             printf("EXIT(%d:%s.%s)\n", \
  41.                 I_PROC, DEBUG, \
  42.                 APC_PROCS[I_PROC]); \
  43.             return value; \
  44.         }
  45. #define    EXITV { \
  46.             I_PROC--; \
  47.             printf("EXITV(%d:%s.%s)\n", \
  48.                 I_PROC, DEBUG, \
  49.                 APC_PROCS[I_PROC]); \
  50.             return value; \
  51.         }
  52. #else
  53. #define    ENTER(proc)
  54. #define    EXIT(value)    {return value;}
  55. #define    EXITV        return;
  56. #endif
  57.  
  58. #ifdef MAIN
  59. int    I_PROC = 0;
  60. char    *APC_PROCS[MAXPROC];
  61. #else
  62. extern    int    I_PROC;
  63. extern    char    *APC_PROCS[MAXPROC];
  64. #endif
  65.  
  66.  
  67.             /*--- why didn't k&r put these into stdio.h? ---*/
  68. #define    TRUE        1
  69. #define    FALSE        0
  70. extern    char        *malloc(), *calloc();
  71.  
  72.  
  73. #endif    _VIXIE_FLAG
  74.