00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef _DI_h_
00032 #define _DI_h_ 1
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00038 #ifndef WITHOUT_NANA
00039
00040
00041
00042
00043
00044
00045 #ifndef _nana_config_h_
00046 #include <nana-config.h>
00047 #endif
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 #ifndef DI_LEVEL
00058 #define DI_LEVEL 1
00059 #endif
00060
00061
00062
00063
00064
00065
00066
00067
00068 #ifndef DI_DEFAULT_GUARD
00069 #define DI_DEFAULT_GUARD 1
00070 #endif
00071
00072
00073
00074
00075
00076
00077 #ifndef DI_DEFAULT_PARAMS
00078 #define DI_DEFAULT_PARAMS
00079 #endif
00080
00081
00082
00083
00084
00085 #ifndef DI_DEFAULT_HANDLER
00086
00087 #define DI_DEFAULT_HANDLER(e,f,l,p) \
00088 @@echo e has failed at f:l with p\n@@ \
00089 @@where@@
00090
00091 #endif
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 #ifndef DI_MAKE_VALID_BREAKPOINT
00102 static volatile int _di_target;
00103
00104 #define DI_MAKE_VALID_BREAKPOINT(e) _di_target = 0
00105 #endif
00106
00107
00108
00109
00110
00111
00112
00113
00114 #if DI_LEVEL == 2
00115 #ifdef _NANA_FILTER_
00116 #define _DIGHPS(e,g,h,p,s) \
00117 @@break @__FILE__:__LINE__@@ \
00118 @@condition $bpnum (!(e))@@ \
00119 @@command $bpnum@@ \
00120 @@silent@@ \
00121 h(s,f,l,p) \
00122 @@end@@
00123 #else
00124 #define _DIGHPS(e,g,h,p,s) DI_MAKE_VALID_BREAKPOINT(e)
00125 #endif
00126
00127 #elif DI_LEVEL == 1
00128
00129 #ifdef _NANA_FILTER_
00130 #define _DIGHPS(e,g,h,p,s) \
00131 @@break @__FILE__:__LINE__@@ \
00132 @@condition $bpnum (g) && (!(e))@@ \
00133 @@command $bpnum@@ \
00134 @@silent@@ \
00135 h(s,f,l,p) \
00136 @@end@@
00137 #else
00138 #define _DIGHPS(e,g,h,p,s) DI_MAKE_VALID_BREAKPOINT(e)
00139 #endif
00140
00141 #elif DI_LEVEL == 0
00142 #define _DIGHPS(e,g,h,p,s)
00143 #endif
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155 #if DI_LEVEL == 2
00156 #ifdef _NANA_FILTER_
00157 #define DSG(e,g) \
00158 @@break @__FILE__:__LINE__@@ \
00159 @@command@@ \
00160 @@silent@@ \
00161 @@set e@@ \
00162 @@cont@@ \
00163 @@end@@
00164 #else
00165 #define DSG(e,g) DI_MAKE_VALID_BREAKPOINT(e)
00166 #endif
00167
00168 #elif DI_LEVEL == 1
00169 #ifdef _NANA_FILTER_
00170 #define DSG(e,g) \
00171 @@break @__FILE__:__LINE__ if g@@ \
00172 @@command@@ \
00173 @@silent@@ \
00174 @@set e@@ \
00175 @@cont@@ \
00176 @@end@@
00177 #else
00178 #define DSG(e,g) DI_MAKE_VALID_BREAKPOINT(e)
00179 #endif
00180
00181 #elif DI_LEVEL == 0
00182 #define DSG(e,g)
00183 #else
00184 error DI_LEVEL should be 0 or 1 or 2
00185 #endif
00186
00187 #define DS(e) DSG(e,DI_DEFAULT_GUARD)
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200 #define DI(e) \
00201 _DIGHPS(e,DI_DEFAULT_GUARD,DI_DEFAULT_HANDLER,DI_DEFAULT_PARAMS,"DI("#e")")
00202 #define DIG(e,g) \
00203 _DIGHPS(e,g,DI_DEFAULT_HANDLER,DI_DEFAULT_PARAMS,"DI("#e")")
00204 #define DIH(e,h) \
00205 _DIGHPS(e,DI_DEFAULT_GUARD,h,DI_DEFAULT_PARAMS,"DI("#e")")
00206 #define DIP(e,p) \
00207 _DIGHPS(e,DI_DEFAULT_GUARD,DI_DEFAULT_HANDLER,p,"DI("#e")")
00208 #define DIGH(e,g,h) \
00209 _DIGHPS(e,g,h,DI_DEFAULT_PARAMS,"DI("#e")")
00210 #define DIGP(e,g,p) \
00211 _DIGHPS(e,g,DI_DEFAULT_HANDLER,p,"DI("#e")")
00212 #define DIHP(e,h,p) \
00213 _DIGHPS(e,DI_DEFAULT_GUARD,h,p,"DI("#e")")
00214 #define DIGHP(e,g,h,p) \
00215 _DIGHPS(e,g,h,p,"DI("#e")")
00216
00217 #define DN(e) \
00218 _DIGHPS((!(e)),DI_DEFAULT_GUARD,DI_DEFAULT_HANDLER,DI_DEFAULT_PARAMS,"DN("#e")")
00219 #define DNG(e,g) \
00220 _DIGHPS((!(e)),g,DI_DEFAULT_HANDLER,DI_DEFAULT_PARAMS,"DN("#e")")
00221 #define DNH(e,h) \
00222 _DIGHPS((!(e)),DI_DEFAULT_GUARD,h,DI_DEFAULT_PARAMS,"DN("#e")")
00223 #define DNP(e,p) \
00224 _DIGHPS((!(e)),DI_DEFAULT_GUARD,DI_DEFAULT_HANDLER,p,"DN("#e")")
00225 #define DNGH(e,g,h) \
00226 _DIGHPS((!(e)),g,h,DI_DEFAULT_PARAMS,"DN("#e")")
00227 #define DNGP(e,g,p) \
00228 _DIGHPS((!(e)),g,DI_DEFAULT_HANDLER,p,"DN("#e")")
00229 #define DNHP(e,h,p) \
00230 _DIGHPS((!(e)),DI_DEFAULT_GUARD,h,p,"DN("#e")")
00231 #define DNGHP(e,g,h,p) \
00232 _DIGHPS((!(e)),g,h,p,"DN("#e")")
00233
00234 #else
00235
00236 #define DI(e)
00237 #define DIG(e,g)
00238 #define DIH(e,h)
00239 #define DIP(e,p)
00240 #define DIGH(e,g,h)
00241 #define DIGP(e,g,p)
00242 #define DIHP(e,h,p)
00243 #define DIGHP(e,g,h,p)
00244
00245 #define DN(e)
00246 #define DNG(e,g)
00247 #define DNH(e,h)
00248 #define DNP(e,p)
00249 #define DNGH(e,g,h)
00250 #define DNGP(e,g,p)
00251 #define DNHP(e,h,p)
00252 #define DNGHP(e,g,h,p)
00253
00254 #define DS(e)
00255 #define DSG(e,g)
00256
00257
00258 #endif
00259 #ifdef __cplusplus
00260 }
00261 #endif
00262
00263 #endif
00264
00265
00266