home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December (DVD) / PCWorld_2007-12_DVD.iso / komunikace / mysql / mysql-essential-5.0.45-win32.msi / product.cab / fili070 < prev    next >
Encoding:
Text File  |  2007-07-06  |  3.8 KB  |  108 lines

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