home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / fp / ifp_unix.lzh / ifp / interp / trace.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-05-23  |  2.5 KB  |  66 lines

  1.  
  2. /****** trace.c *******************************************************/
  3. /**                                                                  **/
  4. /**                    University of Illinois                        **/
  5. /**                                                                  **/
  6. /**                Department of Computer Science                    **/
  7. /**                                                                  **/
  8. /**   Tool: IFP                         Version: 0.5                 **/
  9. /**                                                                  **/
  10. /**   Author:  Arch D. Robison          Date:   May 1, 1985          **/
  11. /**                                                                  **/
  12. /**   Revised by: Arch D. Robison       Date:  Sept 9, 1986          **/
  13. /**                                                                  **/
  14. /**   Principal Investigators: Prof. R. H. Campbell                  **/
  15. /**                            Prof. W. J. Kubitz                    **/
  16. /**                                                                  **/
  17. /**                                                                  **/
  18. /**------------------------------------------------------------------**/
  19. /**   (C) Copyright 1987  University of Illinois Board of Trustees   **/
  20. /**                       All Rights Reserved.                       **/
  21. /**********************************************************************/
  22.  
  23. #include <stdio.h>
  24. #include "struct.h"
  25. #include "umax.h"
  26.  
  27. int TraceIndent = 0;    /* Indentation level of trace         */
  28. int TraceDepth = 2;    /* Depth to which functions are printed */
  29.  
  30. /*
  31.  * PrintTrace
  32.  *
  33.  * Print a trace messages "ENTER>" or "EXIT> " with their arguments.
  34.  * Each message is preceeded by an indentation pattern.  Each '|' in
  35.  * the pattern represents one level of indentation; each '.' in the
  36.  * patttern represents DOTSIZE levels of indentation.  The latter
  37.  * abbreviation keeps us from going off the deep end.
  38.  */
  39. #define DOTSIZE 20
  40.  
  41. void PrintTrace (F,InOut,EnterExit)
  42.    ObjectPtr F,InOut;
  43.    char *EnterExit;
  44.    {
  45.       int K;
  46.  
  47.       /*
  48.        * A SysStop >= 2 indicates multiple user interrupts, i.e. the user
  49.        * does not want to see trace information.
  50.        */
  51.       if (SysStop < 2) {
  52.      LineWait ();
  53.      for (K = TraceIndent; K>=DOTSIZE; K-=DOTSIZE) printf (".");
  54.      while (--K >= 0) printf (" |");
  55.      printf (EnterExit);
  56.      OutObject (InOut);
  57.      printf (" : ");
  58.      OutFun (F,TraceDepth);
  59.      printf ("\n");
  60.      LineSignal ();
  61.       }
  62.    }
  63.  
  64. /******************************* end of trace.c ******************************/
  65.  
  66.