Eneboo - Documentación para desarrolladores
src/libmysql_std/include/my_dbug.h
Ir a la documentación de este archivo.
00001 /* Copyright (C) 2000 MySQL AB
00002 
00003    This program is free software; you can redistribute it and/or modify
00004    it under the terms of the GNU General Public License as published by
00005    the Free Software Foundation; version 2 of the License.
00006 
00007    This program is distributed in the hope that it will be useful,
00008    but WITHOUT ANY WARRANTY; without even the implied warranty of
00009    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010    GNU General Public License for more details.
00011 
00012    You should have received a copy of the GNU General Public License
00013    along with this program; if not, write to the Free Software
00014    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
00015 
00016 #ifndef _dbug_h
00017 #define _dbug_h
00018 
00019 #ifdef  __cplusplus
00020 extern "C" {
00021 #endif
00022 #if !defined(DBUG_OFF) && !defined(_lint)
00023 extern  int _db_on_,_no_db_;
00024 extern  FILE *_db_fp_;
00025 extern  char *_db_process_;
00026 extern  int _db_keyword_(const char *keyword);
00027 extern  int _db_strict_keyword_(const char *keyword);
00028 extern  void _db_setjmp_(void);
00029 extern  void _db_longjmp_(void);
00030 extern  void _db_push_(const char *control);
00031 extern  void _db_pop_(void);
00032 extern  void _db_enter_(const char *_func_,const char *_file_,uint _line_,
00033                         const char **_sfunc_,const char **_sfile_,
00034                         uint *_slevel_, char ***);
00035 extern  void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
00036                          uint *_slevel_);
00037 extern  void _db_pargs_(uint _line_,const char *keyword);
00038 extern  void _db_doprnt_ _VARARGS((const char *format,...))
00039   ATTRIBUTE_FORMAT(printf, 1, 2);
00040 extern  void _db_dump_(uint _line_,const char *keyword,const char *memory,
00041                        uint length);
00042 extern  void _db_output_(uint flag);
00043 extern  void _db_end_(void);
00044 extern  void _db_lock_file(void);
00045 extern  void _db_unlock_file(void);
00046 
00047 #define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
00048         char **_db_framep_; \
00049         _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
00050                     &_db_framep_)
00051 #define DBUG_LEAVE \
00052         (_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
00053 #define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
00054 #define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
00055 #define DBUG_EXECUTE(keyword,a1) \
00056         do {if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}} while(0)
00057 #define DBUG_PRINT(keyword,arglist) \
00058         do {if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}} while(0)
00059 #define DBUG_PUSH(a1) _db_push_ (a1)
00060 #define DBUG_POP() _db_pop_ ()
00061 #define DBUG_PROCESS(a1) (_db_process_ = a1)
00062 #define DBUG_FILE (_db_fp_)
00063 #define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
00064 #define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
00065 #define DBUG_DUMP(keyword,a1,a2)\
00066         do {if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}} while(0)
00067 #define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr)
00068 #define DEBUGGER_OFF _no_db_=1;_db_on_=0;
00069 #define DEBUGGER_ON  _no_db_=0
00070 #define DBUG_END()  _db_end_ ()
00071 #define DBUG_LOCK_FILE { _db_lock_file(); }
00072 #define DBUG_UNLOCK_FILE { _db_unlock_file(); }
00073 #define DBUG_OUTPUT(A) { _db_output_(A); }
00074 #define DBUG_ASSERT(A) assert(A)
00075 #define DBUG_EXECUTE_IF(keyword,a1) \
00076         do {if (_db_on_) {if (_db_strict_keyword_ (keyword)) { a1 }}} while(0)
00077 #define IF_DBUG(A) A
00078 #else                                           /* No debugger */
00079 
00080 #define DBUG_ENTER(a1)
00081 #define DBUG_RETURN(a1) return(a1)
00082 #define DBUG_VOID_RETURN return
00083 #define DBUG_EXECUTE(keyword,a1) {}
00084 #define DBUG_EXECUTE_IF(keyword,a1) {}
00085 #define DBUG_PRINT(keyword,arglist) {}
00086 #define DBUG_PUSH(a1) {}
00087 #define DBUG_POP() {}
00088 #define DBUG_PROCESS(a1) {}
00089 #define DBUG_FILE (stderr)
00090 #define DBUG_SETJMP setjmp
00091 #define DBUG_LONGJMP longjmp
00092 #define DBUG_DUMP(keyword,a1,a2) {}
00093 #define DBUG_IN_USE 0
00094 #define DEBUGGER_OFF
00095 #define DEBUGGER_ON
00096 #define DBUG_END()
00097 #define DBUG_LOCK_FILE
00098 #define DBUG_UNLOCK_FILE
00099 #define DBUG_OUTPUT(A)
00100 #define DBUG_ASSERT(A) {}
00101 #define DBUG_LEAVE
00102 #define IF_DBUG(A)
00103 #endif
00104 #ifdef  __cplusplus
00105 }
00106 #endif
00107 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'