home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / osi / isode / vmsisode / vmsisode80_tar.Z / vmsisode80_tar / sockit / source / trace.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-14  |  599 b   |  33 lines

  1. #include <stdio.h>
  2. static int depth = 0;
  3. static char last_function[32];
  4. static int first_time = 1;
  5. static int max_depth = 0;
  6. static int function_count = 1;
  7.  
  8. int si_trace_in(s)
  9. char *s;
  10. {
  11.     depth++;
  12.     if (first_time) {
  13.         first_time = 0;
  14. /*        printf("Depth of trace:");scanf("%d",&max_depth);
  15.         printf("Max depth is %d\n",max_depth);*/
  16.     }
  17.     if (depth <= max_depth) {
  18.         if (strcmp(last_function, s)) {
  19.             fprintf(stderr,"->%s (%d %d)\n",last_function,depth,function_count);
  20.             function_count = 1;
  21.             strcpy(last_function, s);
  22.         }
  23.         else function_count++;
  24.     }
  25. }
  26.  
  27. void si_trace_out(s)
  28. char *s;
  29. {
  30.     depth--;
  31. }
  32.  
  33.