Changeset 4124 for trunk/include/win/debugtools.h
- Timestamp:
- Aug 30, 2000, 3:56:39 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/win/debugtools.h
r3095 r4124 127 127 extern const int dbch_##ch; 128 128 #define DEFAULT_DEBUG_CHANNEL(ch) \ 129 extern const int dbch_##ch;static const int *const DBCH_DEFAULT = &dbch_##ch;129 static const int *const DBCH_DEFAULT = &dbch_##ch; 130 130 131 131 #define DPRINTF dbg_printf … … 138 138 # define DECLARE_DEBUG_CHANNEL ODINDEBUGCHANNEL 139 139 # undef DEFAULT_DEBUG_CHANNEL 140 # define DEFAULT_DEBUG_CHANNEL ODINDEBUGCHANNEL 140 # define DEFAULT_DEBUG_CHANNEL ODINDEBUGCHANNEL1 141 141 # undef TRACE 142 142 # undef TRACE_ … … 186 186 #endif 187 187 188 #ifdef DEBUG 189 #ifdef __cplusplus 190 extern "C" { 191 #endif 192 LPCSTR debugstr_guid1( void *id ); 193 #define debugstr_guid(a) debugstr_guid1((void *)a) 194 195 #ifdef __cplusplus 196 } 197 #endif 198 199 static LPCSTR debugstr_an (LPCSTR src, int n) 200 { 201 LPSTR dst; 202 static char res[128]; 203 204 if (!src) return "(null)"; 205 if (n > sizeof(res)) return "(null)"; 206 207 if (n < 0) n = 0; 208 dst = res; 209 *dst++ = '"'; 210 while (n-- > 0 && *src) 211 { 212 BYTE c = *src++; 213 switch (c) 214 { 215 case '\n': *dst++ = '\\'; *dst++ = 'n'; break; 216 case '\r': *dst++ = '\\'; *dst++ = 'r'; break; 217 case '\t': *dst++ = '\\'; *dst++ = 't'; break; 218 case '"': *dst++ = '\\'; *dst++ = '"'; break; 219 case '\\': *dst++ = '\\'; *dst++ = '\\'; break; 220 default: 221 if (c >= ' ' && c <= 126) 222 *dst++ = c; 223 else 224 { 225 *dst++ = '\\'; 226 *dst++ = '0' + ((c >> 6) & 7); 227 *dst++ = '0' + ((c >> 3) & 7); 228 *dst++ = '0' + ((c >> 0) & 7); 229 } 230 } 231 } 232 *dst++ = '"'; 233 if (*src) 234 { 235 *dst++ = '.'; 236 *dst++ = '.'; 237 *dst++ = '.'; 238 } 239 *dst++ = '\0'; 240 return res; 241 } 242 243 /* ---------------------------------------------------------------------- */ 244 245 static LPCSTR debugstr_wn (LPCWSTR src, int n) 246 { 247 LPSTR dst; 248 static char res[128]; 249 250 if (!src) return "(null)"; 251 if (n > sizeof(res)) return "(null)"; 252 if (n < 0) n = 0; 253 254 dst = res; 255 *dst++ = 'L'; 256 *dst++ = '"'; 257 while (n-- > 0 && *src) 258 { 259 WORD c = *src++; 260 switch (c) 261 { 262 case '\n': *dst++ = '\\'; *dst++ = 'n'; break; 263 case '\r': *dst++ = '\\'; *dst++ = 'r'; break; 264 case '\t': *dst++ = '\\'; *dst++ = 't'; break; 265 case '"': *dst++ = '\\'; *dst++ = '"'; break; 266 case '\\': *dst++ = '\\'; *dst++ = '\\'; break; 267 default: 268 if (c >= ' ' && c <= 126) 269 *dst++ = c; 270 else 271 { 272 *dst++ = '\\'; 273 sprintf(dst,"%04x",c); 274 dst+=4; 275 } 276 } 277 } 278 *dst++ = '"'; 279 if (*src) 280 { 281 *dst++ = '.'; 282 *dst++ = '.'; 283 *dst++ = '.'; 284 } 285 *dst++ = '\0'; 286 return res; 287 } 288 289 #endif 188 290 189 291 #endif /* __WINE_DEBUGTOOLS_H */
Note:
See TracChangeset
for help on using the changeset viewer.