Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
3.4 KiB

  1. /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
  2. This library is free software; you can redistribute it and/or
  3. modify it under the terms of the GNU Library General Public
  4. License as published by the Free Software Foundation; either
  5. version 2 of the License, or (at your option) any later version.
  6. This library is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  9. Library General Public License for more details.
  10. You should have received a copy of the GNU Library General Public
  11. License along with this library; if not, write to the Free
  12. Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  13. MA 02111-1307, USA */
  14. #ifndef _dbug_h
  15. #define _dbug_h
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #if !defined(DBUG_OFF) && !defined(_lint)
  20. extern int _db_on_,_no_db_;
  21. extern FILE *_db_fp_;
  22. extern char *_db_process_;
  23. extern int _db_keyword_(const char *keyword);
  24. extern void _db_setjmp_(void);
  25. extern void _db_longjmp_(void);
  26. extern void _db_push_(const char *control);
  27. extern void _db_pop_(void);
  28. extern void _db_enter_(const char *_func_,const char *_file_,uint _line_,
  29. const char **_sfunc_,const char **_sfile_,
  30. uint *_slevel_, char ***);
  31. extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
  32. uint *_slevel_);
  33. extern void _db_pargs_(uint _line_,const char *keyword);
  34. extern void _db_doprnt_ _VARARGS((const char *format,...));
  35. extern void _db_dump_(uint _line_,const char *keyword,const char *memory,
  36. uint length);
  37. extern void _db_lock_file();
  38. extern void _db_unlock_file();
  39. #define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
  40. char **_db_framep_; \
  41. _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
  42. &_db_framep_)
  43. #define DBUG_LEAVE \
  44. (_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
  45. #define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}
  46. #define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
  47. #define DBUG_EXECUTE(keyword,a1) \
  48. {if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}}
  49. #define DBUG_PRINT(keyword,arglist) \
  50. {if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}}
  51. #define DBUG_PUSH(a1) _db_push_ (a1)
  52. #define DBUG_POP() _db_pop_ ()
  53. #define DBUG_PROCESS(a1) (_db_process_ = a1)
  54. #define DBUG_FILE (_db_fp_)
  55. #define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
  56. #define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
  57. #define DBUG_DUMP(keyword,a1,a2)\
  58. {if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}}
  59. #define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr)
  60. #define DEBUGGER_OFF _no_db_=1;_db_on_=0;
  61. #define DEBUGGER_ON _no_db_=0
  62. #define DBUG_LOCK_FILE { _db_lock_file(); }
  63. #define DBUG_UNLOCK_FILE { _db_unlock_file(); }
  64. #define DBUG_ASSERT(A) assert(A)
  65. #else /* No debugger */
  66. #define DBUG_ENTER(a1)
  67. #define DBUG_RETURN(a1) return(a1)
  68. #define DBUG_VOID_RETURN return
  69. #define DBUG_EXECUTE(keyword,a1) {}
  70. #define DBUG_PRINT(keyword,arglist) {}
  71. #define DBUG_PUSH(a1) {}
  72. #define DBUG_POP() {}
  73. #define DBUG_PROCESS(a1) {}
  74. #define DBUG_FILE (stderr)
  75. #define DBUG_SETJMP setjmp
  76. #define DBUG_LONGJMP longjmp
  77. #define DBUG_DUMP(keyword,a1,a2) {}
  78. #define DBUG_IN_USE 0
  79. #define DEBUGGER_OFF
  80. #define DEBUGGER_ON
  81. #define DBUG_LOCK_FILE
  82. #define DBUG_UNLOCK_FILE
  83. #define DBUG_ASSERT(A) {}
  84. #endif
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif