home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- static int depth = 0;
- static char last_function[32];
- static int first_time = 1;
- static int max_depth = 0;
- static int function_count = 1;
-
- int si_trace_in(s)
- char *s;
- {
- depth++;
- if (first_time) {
- first_time = 0;
- /* printf("Depth of trace:");scanf("%d",&max_depth);
- printf("Max depth is %d\n",max_depth);*/
- }
- if (depth <= max_depth) {
- if (strcmp(last_function, s)) {
- fprintf(stderr,"->%s (%d %d)\n",last_function,depth,function_count);
- function_count = 1;
- strcpy(last_function, s);
- }
- else function_count++;
- }
- }
-
- void si_trace_out(s)
- char *s;
- {
- depth--;
- }
-
-