00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _FE_DEBUG_H_
00014 #define _FE_DEBUG_H_
00015
00016 extern int __print_end_timestamp;
00017 extern int __dprint_level;
00018 extern int __print_warn;
00019 extern int __print_info;
00020
00021
00022 #define USE_DPRINT
00023
00024
00025 #include <stdlib.h>
00026
00027 #ifdef USE_DPRINT
00028 #define DPRINT(x,fmt,args...) if ( __dprint_level >= x ) \
00029 printf( "%s:%s(), "fmt, __FILE__,__FUNCTION__, ## args )
00030 #else
00031 #define DPRINT(x,fmt,args...)
00032 #endif
00033
00034 #define ERROR(fmt,args...) {\
00035 printf( "ERROR:%s:%s(), "fmt, __FILE__,__FUNCTION__, ## args );\
00036 exit(1);}
00037
00038 #define WARN(fmt,args...) if ( __print_warn) \
00039 printf( "WARNING:%s:%s(), "fmt, __FILE__,__FUNCTION__, ## args )
00040
00041 #define MSG(fmt,args...) \
00042 printf( "MSG:%s:%s(), "fmt, __FILE__,__FUNCTION__, ## args )
00043
00044 #define INFO(fmt,args...) \
00045 if ( __print_info ) printf( "INFO: "fmt, ## args )
00046 #define INFO2(fmt,args...) \
00047 if ( __print_info) printf( fmt, ## args )
00048
00049 #define PRINTF(fmt,args...) \
00050 printf( "%s() "fmt, __FUNCTION__, ## args )
00051
00052 #endif // _FE_DEBUG_H_