home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vile-src.zip / vile-8.1 / trace.h < prev    next >
C/C++ Source or Header  |  1998-04-26  |  1KB  |  58 lines

  1. /*
  2.  * debugging support -- tom dickey.
  3.  *
  4.  * $Header: /usr/build/vile/vile/RCS/trace.h,v 1.6 1998/04/26 12:36:03 tom Exp $
  5.  *
  6.  */
  7. #ifndef    _trace_h
  8. #define    _trace_h
  9.  
  10. #ifndef    NO_LEAKS
  11. #define NO_LEAKS 0
  12. #endif
  13.  
  14. #ifndef DOALLOC
  15. #define DOALLOC 0
  16. #endif
  17.  
  18. #ifndef    show_alloc
  19. extern    void    show_alloc (void);
  20. #endif
  21.  
  22. #if    DOALLOC
  23. extern    char *    doalloc (char *oldp, unsigned amount);
  24. extern    char *    do_calloc (unsigned nmemb, unsigned size);
  25. extern    void    dofree (void *oldp);
  26. extern    void    dopoison (void *oldp, long len);
  27. #undef    calloc
  28. #define    calloc(n,m)    do_calloc(n, m)
  29. #undef    malloc
  30. #define    malloc(n)    doalloc((char *)0,n)
  31. #undef    realloc
  32. #define    realloc(p,n)    doalloc(p,n)
  33. #undef    free
  34. #define    free(p)        dofree(p)
  35. #ifdef POISON
  36. #undef    poison
  37. #define    poison(p,s)    dopoison(p,s)
  38. #endif
  39. #endif    /* DOALLOC */
  40.  
  41. #if !(defined(__GNUC__) || defined(__attribute__))
  42. #define __attribute__(p)
  43. #endif
  44.  
  45. extern    void    fail_alloc (char *msg, char *ptr);
  46. extern    void    Trace ( const char *fmt, ... ) __attribute__ ((format(printf,1,2)));
  47. extern    void    Elapsed ( char * msg);
  48. extern    void    WalkBack (void);
  49.  
  50. #ifdef _estruct_h
  51. extern    char *    tb_visible (TBUFF *p);
  52. #endif
  53.  
  54. #undef TRACE
  55. #define TRACE(p) Trace p;
  56.  
  57. #endif    /* _trace_h */
  58.