00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _FALCON_TRACE_H_
00017 #define _FALCON_TRACE_H_
00018
00019 #ifdef NDEBUG
00020
00021 #define TRACE_ON(...)
00022 #define TRACE_OFF
00023 #define TRACE(...)
00024 #define MESSAGE(...)
00025
00026 #else
00027
00028 #include <stdio.h>
00029 #include <falcon/setup.h>
00030
00031 #define TRACE_ON( name ) _falcon_trace_fp = fopen( name, "w" );
00032 #define TRACE_OFF fclose(_falcon_trace_fp); _falcon_trace_fp = 0;
00033
00034 #define TRACE( fmt, ... ) if( _falcon_trace_fp != 0 ) fprintf( _falcon_trace_fp, "%s:%d: " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ );
00035 #define MESSAGE( fmt ) if( _falcon_trace_fp != 0 ) fprintf( _falcon_trace_fp, "%s:%d: " fmt "\n", __FILE__, __LINE__ );
00036 #define TRACEVAR( type, var ) if( _falcon_trace_fp != 0 ) fprintf( _falcon_trace_fp, "%s:%d: %s=%" type "\n", __FILE__, __LINE__, #var, var );
00037
00038 extern FALCON_DYN_SYM FILE* _falcon_trace_fp;
00039
00040 #endif
00041
00042 #endif
00043
00044