Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

debug.h

Go to the documentation of this file.
00001 /*
00002  *    gui - [gega user interface] the flexible solution for user interface problems
00003  *    Copyright (C) 2002  Gergely Gati
00004  *
00005  *    This program is free software; you can redistribute it and/or modify
00006  *    it under the terms of the GNU General Public License as published by
00007  *    the Free Software Foundation; version 2 of the License.
00008  *
00009  *    This program is distributed in the hope that it will be useful,
00010  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *    GNU General Public License for more details.
00013  *
00014  *    You should have received a copy of the GNU General Public License
00015  *    along with this program; if not, write to the Free Software
00016  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  *
00018  *    Gergely Gati
00019  *      email:           g.gati@freemail.hu
00020  *      AIM screenname:  GatiGergely
00021  *      ICQ number:      93131690
00022  *
00023  */
00024 #ifndef __DEBUG_H
00025 #define __DEBUG_H
00026 
00027 #define MEM_MACRO
00028 //#define MEM_OVER
00029 //#define MEM_VERBOSE
00030 
00031 
00032 #define DEBUG_LEVEL 1
00033 
00034 /***********************************************************************
00035 *                               Includes                               *
00036 ***********************************************************************/
00037 
00038 #include <stdio.h>
00039 
00040 /***********************************************************************
00041 *                                Macros                                *
00042 ***********************************************************************/
00043 
00044 /*
00045  *  The following values are valid for DEBUG_LEVEL:
00046  *
00047  *  0 - No debug output of any kind.
00048  *  1 - Only errors are displayed.
00049  *  2 - Only errors and warnings are displayed.
00050  *  3 - Errors, warnings and messages are displayed.
00051  *  4 - Errors, warnings, messages and trace messages are displayed.
00052  *  5 - Everything is displayed including the begin and end statements.
00053  */
00054 
00055 
00056 #if DEBUG_LEVEL >= 1
00057 #define debug_Error(text, args...) printf("*** Error %s() line %d : " ## text ## "\n" , __FUNCTION__,__LINE__ , ## args)
00058 #else
00059 #define debug_Error(text, args...)
00060 #endif
00061 
00062 #if DEBUG_LEVEL >= 2
00063 #define debug_Warning(text, args...) printf("### Warning %s() line %d : " ## text ## "\n" , __FUNCTION__,__LINE__ , ## args)
00064 #else
00065 #define debug_Warning(text, args...)
00066 #endif
00067 
00068 #if DEBUG_LEVEL >= 3
00069 #define debug_Message(text, args...) printf("$$$ Message %s() line %d : " ## text ## "\n" , __FUNCTION__,__LINE__ , ## args)
00070 #else
00071 #define debug_Message(text, args...)
00072 #endif
00073 
00074 #if DEBUG_LEVEL >= 4
00075 #define debug_Trace() printf("+++ %s(): line %d\n",__FUNCTION__,__LINE__)
00076 #else
00077 #define debug_Trace()
00078 #endif
00079 
00080 #if DEBUG_LEVEL >= 5
00081 #define debug_Begin() printf(">>> %s() [\n", __FUNCTION__)
00082 #define debug_End()   printf("<<< %s() ]\n", __FUNCTION__)
00083 #else
00084 #define debug_Begin()
00085 #define debug_End()
00086 #endif
00087 
00088 #endif

Generated on Tue Jan 7 12:11:18 2003 for THEGUI by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002