Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

706 lines
25 KiB

  1. /*----------------------------------------------------------------------------
  2. %%File: msodbglg.h
  3. %%Unit: Debug
  4. %%Contact: daleg
  5. Debugging macros and functions.
  6. The debug log mechanism automatically creates and manages a log file
  7. "debug.log". By controlling a single variable, vwDebugLogLvl, we
  8. can route printf()-style output to a log file, or to the Comm port
  9. AND the log file.
  10. The log is created and written to whenever the run-time log level,
  11. vwDebugLogLvl >= wTraceLvl. wTraceLvl is the declared, or compile-
  12. time log level, passed as an argument to MsoDebugLog(). It will NOT print
  13. if vwDebugLogLvl is LESS than the declared trace level. If
  14. vwDebugLogLvl is an ODD number, anything written to the log file
  15. will also appear on the port used by OutputDebugString().
  16. NOTE:
  17. THE SPRINTF STRING MUST NOT EXPAND BEYOND 256 CHARACTERS!
  18. USAGE:
  19. There are several macros, debugXX0() thru debugXX6(), etc.,
  20. that are the main interface to MsoDebugLog(), where "XX" is the
  21. subsystem mneumonic. EACH SUBSYSTEM GROUP SHOULD HAVE ITS OWN SET
  22. OF MACROS. Thus the Event Monitor group adds debugEM0 thru
  23. debugEM6() and the Hyperlink group might add debugHL0 thru
  24. debugHL6, etc. EACH SUBSYSTEM GETS ITS OWN LOG FILTER BIT,
  25. DEFINED BELOW (see fDebugFilterEm), which allows developers to
  26. see their logging info without having to wade through other logging
  27. output.
  28. MsoDebugLog() has a variable number of arguments, and is
  29. similar to the standard C sprintf() routine, and in fact calls it.
  30. The macros remove the need to enclose calls to MsoDebugLog() with
  31. #ifdef's, but C does not allow variable numbers of arguments in
  32. macros. To overcome this (and also due to problems with CsConst'ing
  33. the format strings), each debugxx() macro has a fixed number of
  34. arguments, where xx indicates the number of arguments past the format
  35. string.
  36. Examples:
  37. debugXX0((fTrace ? 0 : 6), "Value is NOT chosen\n");
  38. debugXX1(6, "NEW SECTION: %d\n", wSection);
  39. debugXX4(2, "Paragraph %d (CP %ld thru %ld) has style %d\n",
  40. iaftag, lpaftag->cpFirst, (lpaftag + 1)->cpFirst, istd);
  41. The first argument to the macros is the wTraceLvl, the declared
  42. trace-level. In the three examples above, we are saying: the first
  43. should not print unless vwDebugLogLvl >= (fTrace ? 0 : 6),
  44. the second unless vwDebugLogLvl >= 6, and the third unless
  45. vwDebugLogLvl >= 2.
  46. CHOICE OF DECLARED TRACE LEVELS:
  47. In general, low declared trace levels should be used within discrete
  48. subsystems that are *not* shared, and high levels should be used
  49. within shared code. Note that only EVEN numbers are used. The
  50. reason will be explained below.
  51. THE HIGHER THE LEVEL NUMBER, THE MORE GOO YOU ARE GOING TO OUTPUT.
  52. Level Generally used when:
  53. ------------------------------------------------------
  54. -1 Warning messages.
  55. 0 Messages to be seen by testers.
  56. 2 Message to be seen by rigorous testers.
  57. 4 Structural changes, such as dialog boxes appearing,
  58. Windows created, features beginning.
  59. 6 Normal logging of a subsystem.
  60. 8 Detailed logging of a subsystem.
  61. 10 Major subsystem I/O, such as scanning CHRs, or
  62. reading buffers.
  63. 12 Minor subsystem I/O, such as reading characters.
  64. ...
  65. 20 Shared subsystem, such as FormatLine, CachePara
  66. or something else that we would call frequently,
  67. and be buried under detail.
  68. RUN-TIME USAGE:
  69. Set vwDebugLogLvl to an ODD number, if you wish output via
  70. OutputDebugString() as well as the log file. Set vwDebugLogLvl to an
  71. EVEN number if you wish output only to the log file.
  72. Set vwDebugLogLvl to a low level using the dialog box. For
  73. higher levels (e.g. to debug FormatLine()), you should set a
  74. breakpoint in the debugger, and set vwDebugLogLvl when in the
  75. targeted routine.
  76. Example (from Word):
  77. 1. We set vwDebugLogLvl to 2 from the dialog box in the
  78. "Preferences" memu. We also set a breakpoint within
  79. TkLexText().
  80. 2. We run the AutoFormatter, and when we hit the breakpoint,
  81. we set vwDebugLogLvl from the watch window to 8,
  82. so we will get a lot of output.
  83. 3. When we approach the interesting point of a problem, we
  84. change the vwDebugLogLvl to 9, so it will appear on
  85. the OutputDebugStringA() terminal.
  86. ----------------------------------------------------------------------------*/
  87. #ifndef MSODBGLG_H
  88. #define MSODBGLG_H
  89. #include <stdarg.h>
  90. #if defined(STANDALONE) && !defined(MSOEXTERN_C_BEGIN)
  91. #define MSOEXTERN_C_BEGIN
  92. #define MSOEXTERN_C_END
  93. #endif // STANDALONE
  94. MSOEXTERN_C_BEGIN // ***************** Begin extern "C" ********************
  95. #ifndef UNIX
  96. #if _MSC_VER <= 600
  97. #ifndef __cdecl
  98. #define __cdecl _cdecl
  99. #endif /* !__cdecl */
  100. #endif /* MSC_VER <= 600 */
  101. #else
  102. #define __cdecl
  103. #define sprintf ansi_sprintf
  104. #define vsprintf ansi_vsprintf
  105. int ansi_sprintf(char *lpchBuf, const char *sz, ...);
  106. int ansi_vsprintf(char *lpchBuf, const char *sz, va_list ap);
  107. #define CommSz printf
  108. #endif /* !UNIX */
  109. // Define filters for MsoDebugLog()
  110. // These values can overlap for different applications.
  111. // However, Office reserves the lower 0x00FF bits.
  112. #define fDebugFilterEm 0x0001U // App Event Monitor
  113. #define fDebugFilterWc 0x0002U // Web Client
  114. #define fDebugFilterAcb 0x0004U // Active ClipBoard
  115. #define fDebugFilterEc 0x0008U // Exec Command (DOIT)
  116. #define fDebugFilterMsoEm 0x0010U // MSO Event Monitor
  117. #if defined(WORD_BUILD)
  118. #define fDebugFilterPrint 0x0100U // Print
  119. #define fDebugFilterReconcil 0x0200U // Reconcile
  120. #define fDebugFilterHtmlIn 0x0400U // HTML in
  121. #elif defined(EXCEL_BUILD)
  122. #define fDebugFilterUnused1 0x0100U // Use me 1st in Excel
  123. #elif defined(PPT_BUILD)
  124. #define fDebugFilterUnused1 0x0100U // Use me 1st in PPT
  125. #elif defined(ACCESS_BUILD)
  126. #define fDebugFilterUnused1 0x0100U // Use me 1st in Access
  127. #endif
  128. #define fDebugFilterAll 0xFFFFU
  129. #ifdef STANDALONE
  130. #undef wsprintfA
  131. #define wsprintfA sprintf
  132. #undef wvsprintfA
  133. #define wvsprintfA vsprintf
  134. #include <stdio.h>
  135. #endif /* STANDALONE */
  136. #ifdef DEBUG
  137. #ifndef WORD_BUILD
  138. extern int vwDebugLogFilter; // Debug trace filter
  139. extern int vwDebugLogLvl; // Debug trace level
  140. #endif /* !WORD_BUILD */
  141. #ifdef STANDALONE
  142. #ifndef MSOAPI_
  143. #define MSOAPI_(t) t __stdcall
  144. #endif /* !MSOAPI_ */
  145. #ifndef MSOCDECLAPI_
  146. #define MSOCDECLAPI_(t) t __cdecl
  147. #endif /* !MSOCDECLAPI_ */
  148. #endif // STANDALONE
  149. // Return the sz, or if null, return "(null)"
  150. #define SzOrNull(sz) \
  151. ((sz) != NULL ? (sz) : "(null)")
  152. MSOCDECLAPI_(void) MsoDebugLog( // Print debug msg
  153. int wTraceLvl,
  154. unsigned int grfFilter,
  155. const unsigned char *sz,
  156. ...
  157. );
  158. MSOCDECLAPI_(void) MsoAssertSzProcVar( // Assert with sprintf
  159. const char *szFile,
  160. int line,
  161. const char *sz,
  162. ...
  163. );
  164. MSOCDECLAPI_(int) MsoFReportSzProcVar( // ReportSz w/ sprintf
  165. const char *szFile,
  166. int line,
  167. const char *sz,
  168. ...
  169. );
  170. MSOCDECLAPI_(void) MsoCommSzVar(const char *sz, ...); // CommSz with sprintf
  171. MSOAPI_(void) MsoDebugLogAp( // Print debug msg
  172. int wTraceLvl,
  173. unsigned int grfFilter,
  174. const unsigned char *sz,
  175. va_list ap
  176. );
  177. MSOAPI_(void) MsoDebugLogPch( // Print large msg
  178. int wTraceLvl,
  179. unsigned int grfFilter,
  180. char *pch,
  181. int cchLen,
  182. int fIsRgxch
  183. );
  184. MSOAPI_(void) MsoAssertSzProcAp( // AssertSz using ap
  185. const char *szFile,
  186. int line,
  187. const char *sz,
  188. va_list ap
  189. );
  190. MSOAPI_(int) MsoFReportSzProcAp( // ReportSz using ap
  191. const char *szFile,
  192. int line,
  193. const char *sz,
  194. va_list ap
  195. );
  196. MSOAPI_(void) MsoCommSzAp(const char *sz, va_list ap); // CommSz using ap
  197. MSOAPI_(int) MsoFDebugLogCloseFile(void); // Close log file
  198. MSOAPI_(int *) MsoPwDebugLogLvl(int **ppwDebugLogFilter);// Return ptr to vars
  199. // These *debug* routines are XCHAR (WCHAR on unicode builds and char on ANSI)
  200. #ifndef ANSI_XCHAR
  201. #ifdef cbXchar
  202. MSOAPI_(XCHAR *) MsoXszFromRgxchDebug( // Convert pwch to wz
  203. XCHAR *rgxch,
  204. int cch
  205. );
  206. MSOAPI_(char *) MsoSzFromRgxchDebug( // Convert pwch to sz
  207. const XCHAR *rgxch,
  208. int cch
  209. );
  210. MSOAPI_(char *) MsoSzFromXszDebug(const XCHAR *xsz); // Convert wz to sz
  211. #endif /* cbXchar */
  212. #else /* ANSI_XCHAR */
  213. MSOAPI_(char *) MsoXszFromRgxchDebug( // Convert pwch to wz
  214. char *rgxch,
  215. int cch
  216. );
  217. MSOAPI_(char *) MsoSzFromRgxchDebug( // Convert pwch to sz
  218. const char *rgxch,
  219. int cch
  220. );
  221. #define MsoSzFromXszDebug(xsz) (xsz)
  222. #endif /* !ANSI_XCHAR */
  223. // NOTE: debugvar has to be called with 2 parenthesis...
  224. #define debugvar(a) MsoDebugLog a
  225. #define Debug(e) e
  226. #define DebugElse(s, t) s
  227. #define debuglog0(wLevel, grfFilter, sz) \
  228. do { \
  229. static const unsigned char szDebug[] = sz; \
  230. MsoDebugLog(wLevel, grfFilter, szDebug); \
  231. } while (0)
  232. #define debuglog1(wLevel, grfFilter, sz, a) \
  233. do { \
  234. static const unsigned char szDebug[] = sz; \
  235. MsoDebugLog(wLevel, grfFilter, szDebug, a); \
  236. } while (0)
  237. #define debuglog2(wLevel, grfFilter, sz, a, b) \
  238. do { \
  239. static const unsigned char szDebug[] = sz; \
  240. MsoDebugLog(wLevel, grfFilter, szDebug, a, b); \
  241. } while (0)
  242. #define debuglog3(wLevel, grfFilter, sz, a, b, c) \
  243. do { \
  244. static const unsigned char szDebug[] = sz; \
  245. MsoDebugLog(wLevel, grfFilter, szDebug, a, b, c); \
  246. } while (0)
  247. #define debuglog4(wLevel, grfFilter, sz, a, b, c, d) \
  248. do { \
  249. static const unsigned char szDebug[] = sz; \
  250. MsoDebugLog(wLevel, grfFilter, szDebug, a, b, c, d); \
  251. } while (0)
  252. #define debuglog5(wLevel, grfFilter, sz, a, b, c, d, e) \
  253. do { \
  254. static const unsigned char szDebug[] = sz; \
  255. MsoDebugLog(wLevel, grfFilter, szDebug, a, b, c, d, e); \
  256. } while (0)
  257. #define debuglog6(wLevel, grfFilter, sz, a, b, c, d, e, f) \
  258. do { \
  259. static const unsigned char szDebug[] = sz; \
  260. MsoDebugLog(wLevel, grfFilter, szDebug, a, b, c, d, e, f); \
  261. } while (0)
  262. #define debuglogPch(wLevel, grfFilter, pch, cch) \
  263. MsoDebugLogPch(wLevel, grfFilter, pch, cch, fFalse)
  264. #define debuglogPwch(wLevel, grfFilter, pwch, cwch) \
  265. MsoDebugLogPch(wLevel, grfFilter, (char *)pwch, cwch, fTrue)
  266. #ifndef DEBUGASSERTSZ
  267. #define DEBUGASSERTSZ VSZASSERT
  268. #endif /* !DEBUGASSERTSZ */
  269. #ifndef VSZASSERT
  270. #define VSZASSERT static unsigned char vszAssertFile[] = __FILE__;
  271. #endif /* !VSZASSERT */
  272. #ifndef Assert
  273. #define Assert(f) AssertSz0((f), #f)
  274. #define AssertDo(f) Assert((f) != 0)
  275. #endif /* !Assert */
  276. #ifndef AssertSz
  277. #define AssertSz(f, sz) AssertSz0(f, sz)
  278. #endif /* !AssertSz */
  279. #define AssertSz0(f, sz) \
  280. do { \
  281. static const char szAssert[] = sz; \
  282. if (!(f)) \
  283. MsoAssertSzProcVar \
  284. (vszAssertFile, __LINE__, szAssert); \
  285. } while (0)
  286. #define AssertSz1(f, sz, a) \
  287. do { \
  288. static const char szAssert[] = sz; \
  289. if (!(f)) \
  290. MsoAssertSzProcVar \
  291. (vszAssertFile, __LINE__, szAssert, a); \
  292. } while (0)
  293. #define AssertSz2(f, sz, a, b) \
  294. do { \
  295. static const char szAssert[] = sz; \
  296. if (!(f)) \
  297. MsoAssertSzProcVar \
  298. (vszAssertFile, __LINE__, szAssert, a, b); \
  299. } while (0)
  300. #define AssertSz3(f, sz, a, b, c) \
  301. do { \
  302. static const char szAssert[] = sz; \
  303. if (!(f)) \
  304. MsoAssertSzProcVar \
  305. (vszAssertFile, __LINE__, szAssert, a, b, c); \
  306. } while (0)
  307. #define AssertSz4(f, sz, a, b, c, d) \
  308. do { \
  309. static const char szAssert[] = sz; \
  310. if (!(f)) \
  311. MsoAssertSzProcVar \
  312. (vszAssertFile, __LINE__, szAssert, a, b, c, d); \
  313. } while (0)
  314. #define AssertSz5(f, sz, a, b, c, d, e) \
  315. do { \
  316. static const char szAssert[] = sz; \
  317. if (!(f)) \
  318. MsoAssertSzProcVar \
  319. (vszAssertFile, __LINE__, szAssert, a, b, c, d, e); \
  320. } while (0)
  321. #ifndef WORD_BUILD
  322. #ifdef OFFICE_BUILD
  323. #define AssertLszProc(szMsg, szFile, line) \
  324. do { \
  325. if (MsoFAssertsEnabled() && \
  326. !MsoFAssert(szFile, line, (const CHAR*)(szMsg))) \
  327. MsoDebugBreakInline(); \
  328. } while (0)
  329. #define FReportLszProc(szMsg, szFile, line) \
  330. MsoFReport(szFile, line, szMsg)
  331. #else /* !OFFICE_BUILD */
  332. int AssertLszProc(
  333. const char *szExtra,
  334. const char *szFile,
  335. int line
  336. );
  337. #endif /* !OFFICE_BUILD */
  338. #endif /* !WORD_BUILD */
  339. #ifndef ReportSz
  340. #define ReportSz(sz) MsoReportSz(sz)
  341. #endif /* !ReportSz */
  342. #define MsoReportSz(sz) \
  343. do { \
  344. static const char szXXXXXXXFar[] = sz; \
  345. if (!MsoFReportSzProcVar(vszAssertFile, __LINE__, szXXXXXXXFar)) \
  346. MsoDebugBreakInline(); \
  347. } while (0)
  348. #define ReportSz0If(f, sz) \
  349. if (!(f)) \
  350. { \
  351. static const char szReport[] = sz; \
  352. if (!MsoFReportSzProcVar \
  353. (vszAssertFile, __LINE__, szReport)) \
  354. MsoDebugBreakInline(); \
  355. } \
  356. else
  357. #define ReportSz1If(f, sz, a) \
  358. if (!(f)) \
  359. { \
  360. static const char szReport[] = sz; \
  361. if (!MsoFReportSzProcVar \
  362. (vszAssertFile, __LINE__, szReport, a)) \
  363. MsoDebugBreakInline(); \
  364. } \
  365. else
  366. #define ReportSz2If(f, sz, a, b) \
  367. if (!(f)) \
  368. { \
  369. static const char szReport[] = sz; \
  370. if (!MsoFReportSzProcVar \
  371. (vszAssertFile, __LINE__, szReport, a, b)) \
  372. MsoDebugBreakInline(); \
  373. } \
  374. else
  375. #define ReportSz3If(f, sz, a, b, c) \
  376. if (!(f)) \
  377. { \
  378. static const char szReport[] = sz; \
  379. if (!MsoFReportSzProcVar \
  380. (vszAssertFile, __LINE__, szReport, a, b, c)) \
  381. MsoDebugBreakInline(); \
  382. } \
  383. else
  384. #define CommSz0(sz) \
  385. do { \
  386. static const char szComm[] = sz; \
  387. MsoCommSzVar(szComm); \
  388. } while (0)
  389. #define CommSz1(sz, a) \
  390. do { \
  391. static const char szComm[] = sz; \
  392. MsoCommSzVar(szComm, a); \
  393. } while (0)
  394. #define CommSz2(sz, a, b) \
  395. do { \
  396. static const char szComm[] = sz; \
  397. MsoCommSzVar(szComm, a, b); \
  398. } while (0)
  399. #define CommSz3(sz, a, b, c) \
  400. do { \
  401. static const char szComm[] = sz; \
  402. MsoCommSzVar(szComm, a, b, c); \
  403. } while (0)
  404. #define CommSz4(sz, a, b, c, d) \
  405. do { \
  406. static const char szComm[] = sz; \
  407. MsoCommSzVar(szComm, a, b, c, d); \
  408. } while (0)
  409. #define CommSz5(sz, a, b, c, d, e) \
  410. do { \
  411. static const char szComm[] = sz; \
  412. MsoCommSzVar(szComm, a, b, c, d, e); \
  413. } while (0)
  414. #ifndef NotReached
  415. #define NotReached() AssertSz0(fFalse, "NotReached declaration was reached")
  416. #endif /* !NotReached */
  417. #else /* !DEBUG */
  418. #define debugvar(a)
  419. #define Debug(e)
  420. #define DebugElse(s, t) t
  421. #define debuglog0(wLevel, grfFilter, sz)
  422. #define debuglog1(wLevel, grfFilter, sz, a)
  423. #define debuglog2(wLevel, grfFilter, sz, a, b)
  424. #define debuglog3(wLevel, grfFilter, sz, a, b, c)
  425. #define debuglog4(wLevel, grfFilter, sz, a, b, c, d)
  426. #define debuglog5(wLevel, grfFilter, sz, a, b, c, d, e)
  427. #define debuglog6(wLevel, grfFilter, sz, a, b, c, d, e, f)
  428. #define debuglogPch(wLevel, grfFilter, pch, cch)
  429. #define debuglogPwch(wLevel, grfFilter, pwch, cwch)
  430. #ifndef DEBUGASSERTSZ
  431. #define DEBUGASSERTSZ
  432. #endif /* !DEBUGASSERTSZ */
  433. #ifndef VSZASSERT
  434. #define VSZASSERT
  435. #endif /* !VSZASSERT */
  436. #ifndef Assert
  437. #define Assert(f)
  438. #define AssertDo(f) (f)
  439. #endif /* !Assert */
  440. #ifndef AssertSz
  441. #define AssertSz(f, sz)
  442. #endif /* !AssertSz */
  443. #define AssertSz0(f, sz)
  444. #define AssertSz1(f, sz, a)
  445. #define AssertSz2(f, sz, a, b)
  446. #define AssertSz3(f, sz, a, b, c)
  447. #define AssertSz4(f, sz, a, b, c, d)
  448. #define AssertSz5(f, sz, a, b, c, d, e)
  449. #define ReportSz(sz)
  450. #define MsoReportSz(sz)
  451. #define ReportSz0If(f, sz)
  452. #define ReportSz1If(f, sz, a)
  453. #define ReportSz2If(f, sz, a, b)
  454. #define ReportSz3If(f, sz, a, b, c)
  455. #define CommSz0(sz)
  456. #define CommSz1(sz, a)
  457. #define CommSz2(sz, a, b)
  458. #define CommSz3(sz, a, b, c)
  459. #define CommSz4(sz, a, b, c, d)
  460. #define CommSz5(sz, a, b, c, d, e)
  461. #ifndef NotReached
  462. #define NotReached()
  463. #endif /* !NotReached */
  464. #endif /* DEBUG */
  465. // Generic debug log macros - WARNING: THIS WILL BE SEEN BY EVERYONE
  466. #define debug0(wLevel, sz) \
  467. debuglog0(wLevel, fDebugFilterAll, sz)
  468. #define debug1(wLevel, sz, a) \
  469. debuglog1(wLevel, fDebugFilterAll, sz, a)
  470. #define debug2(wLevel, sz, a, b) \
  471. debuglog2(wLevel, fDebugFilterAll, sz, a, b)
  472. #define debug3(wLevel, sz, a, b, c) \
  473. debuglog3(wLevel, fDebugFilterAll, sz, a, b, c)
  474. #define debug4(wLevel, sz, a, b, c, d) \
  475. debuglog4(wLevel, fDebugFilterAll, sz, a, b, c, d)
  476. #define debug5(wLevel, sz, a, b, c, d, e) \
  477. debuglog5(wLevel, fDebugFilterAll, sz, a, b, c, d, e)
  478. #define debug6(wLevel, sz, a, b, c, d, e, f) \
  479. debuglog6(wLevel, fDebugFilterAll, sz, a, b, c, d, e, f)
  480. #define debugPch(wLevel, pch, cch)\
  481. debuglogPch(wLevel, fDebugFilterAll, pch, cch)
  482. #define debugPwch(wLevel, pwch, cwch)\
  483. debuglogPwch(wLevel, fDebugFilterAll, pwch, cwch)
  484. // Application Event Monitor debug log macros
  485. #define debugEM0(wLevel, sz) \
  486. debuglog0(wLevel, fDebugFilterEm, sz)
  487. #define debugEM1(wLevel, sz, a) \
  488. debuglog1(wLevel, fDebugFilterEm, sz, a)
  489. #define debugEM2(wLevel, sz, a, b) \
  490. debuglog2(wLevel, fDebugFilterEm, sz, a, b)
  491. #define debugEM3(wLevel, sz, a, b, c) \
  492. debuglog3(wLevel, fDebugFilterEm, sz, a, b, c)
  493. #define debugEM4(wLevel, sz, a, b, c, d) \
  494. debuglog4(wLevel, fDebugFilterEm, sz, a, b, c, d)
  495. #define debugEM5(wLevel, sz, a, b, c, d, e) \
  496. debuglog5(wLevel, fDebugFilterEm, sz, a, b, c, d, e)
  497. #define debugEM6(wLevel, sz, a, b, c, d, e, f) \
  498. debuglog6(wLevel, fDebugFilterEm, sz, a, b, c, d, e, f)
  499. #define debugEMPch(wLevel, pch, cch)\
  500. debuglogPch(wLevel, fDebugFilterEm, pch, cch)
  501. #define debugEMPwch(wLevel, pwch, cwch)\
  502. debuglogPwch(wLevel, fDebugFilterEm, pwch, cwch)
  503. // Application Rule Engine debug log macros
  504. #define debugRL0(wLevel, sz) \
  505. debuglog0(wLevel, vlpruls->grfDebugLogFilter, sz)
  506. #define debugRL1(wLevel, sz, a) \
  507. debuglog1(wLevel, vlpruls->grfDebugLogFilter, sz, a)
  508. #define debugRL2(wLevel, sz, a, b) \
  509. debuglog2(wLevel, vlpruls->grfDebugLogFilter, sz, a, b)
  510. #define debugRL3(wLevel, sz, a, b, c) \
  511. debuglog3(wLevel, vlpruls->grfDebugLogFilter, sz, a, b, c)
  512. #define debugRL4(wLevel, sz, a, b, c, d) \
  513. debuglog4(wLevel, vlpruls->grfDebugLogFilter, sz, a, b, c, d)
  514. #define debugRL5(wLevel, sz, a, b, c, d, e) \
  515. debuglog5(wLevel, vlpruls->grfDebugLogFilter, sz, a, b, c, d, e)
  516. #define debugRL6(wLevel, sz, a, b, c, d, e, f) \
  517. debuglog6(wLevel,vlpruls->grfDebugLogFilter, sz, a, b, c, d, e, f)
  518. #define debugRLPch(wLevel, pch, cch)\
  519. debuglogPch(wLevel, vlpruls->grfDebugLogFilter, pch, cch)
  520. #define debugRLPwch(wLevel, pwch, cwch)\
  521. debuglogPwch(wLevel, vlpruls->grfDebugLogFilter, pwch, cwch)
  522. // Web Client debug log macros
  523. #define debugWC0(wLevel, sz) \
  524. debuglog0(wLevel, fDebugFilterWc, sz)
  525. #define debugWC1(wLevel, sz, a) \
  526. debuglog1(wLevel, fDebugFilterWc, sz, a)
  527. #define debugWC2(wLevel, sz, a, b) \
  528. debuglog2(wLevel, fDebugFilterWc, sz, a, b)
  529. #define debugWC3(wLevel, sz, a, b, c) \
  530. debuglog3(wLevel, fDebugFilterWc, sz, a, b, c)
  531. #define debugWC4(wLevel, sz, a, b, c, d) \
  532. debuglog4(wLevel, fDebugFilterWc, sz, a, b, c, d)
  533. #define debugWC5(wLevel, sz, a, b, c, d, e) \
  534. debuglog5(wLevel, fDebugFilterWc, sz, a, b, c, d, e)
  535. #define debugWC6(wLevel, sz, a, b, c, d, e, f) \
  536. debuglog6(wLevel, fDebugFilterWc, sz, a, b, c, d, e, f)
  537. #define debugWCPch(wLevel, pch, cch)\
  538. debuglogPch(wLevel, fDebugFilterWc, pch, cch)
  539. #define debugWCPwch(wLevel, pwch, cwch)\
  540. debuglogPwch(wLevel, fDebugFilterWc, pwch, cwch)
  541. // Active Clip Board (C & C) debug log macros
  542. #define debugACB0(wLevel, sz) \
  543. debuglog0(wLevel, fDebugFilterAcb, sz)
  544. #define debugACB1(wLevel, sz, a) \
  545. debuglog1(wLevel, fDebugFilterAcb, sz, a)
  546. #define debugACB2(wLevel, sz, a, b) \
  547. debuglog2(wLevel, fDebugFilterAcb, sz, a, b)
  548. #define debugACB3(wLevel, sz, a, b, c) \
  549. debuglog3(wLevel, fDebugFilterAcb, sz, a, b, c)
  550. #define debugACB4(wLevel, sz, a, b, c, d) \
  551. debuglog4(wLevel, fDebugFilterAcb, sz, a, b, c, d)
  552. #define debugACB5(wLevel, sz, a, b, c, d, e) \
  553. debuglog5(wLevel, fDebugFilterAcb, sz, a, b, c, d, e)
  554. #define debugACB6(wLevel, sz, a, b, c, d, e, f) \
  555. debuglog6(wLevel, fDebugFilterAcb, sz, a, b, c, d, e, f)
  556. #define debugACBPch(wLevel, pch, cch)\
  557. debuglogPch(wLevel, fDebugFilterAcb, pch, cch)
  558. #define debugACBPwch(wLevel, pwch, cwch)\
  559. debuglogPwch(wLevel, fDebugFilterAcb, pwch, cwch)
  560. // Toolbar debug log macros
  561. #define debugEC0(wLevel, sz) \
  562. debuglog0(wLevel, fDebugFilterEc, sz)
  563. #define debugEC1(wLevel, sz, a) \
  564. debuglog1(wLevel, fDebugFilterEc, sz, a)
  565. #define debugEC2(wLevel, sz, a, b) \
  566. debuglog2(wLevel, fDebugFilterEc, sz, a, b)
  567. #define debugEC3(wLevel, sz, a, b, c) \
  568. debuglog3(wLevel, fDebugFilterEc, sz, a, b, c)
  569. #define debugEC4(wLevel, sz, a, b, c, d) \
  570. debuglog4(wLevel, fDebugFilterEc, sz, a, b, c, d)
  571. #define debugEC5(wLevel, sz, a, b, c, d, e) \
  572. debuglog5(wLevel, fDebugFilterEc, sz, a, b, c, d, e)
  573. #define debugEC6(wLevel, sz, a, b, c, d, e, f) \
  574. debuglog6(wLevel, fDebugFilterEc, sz, a, b, c, d, e, f)
  575. #define debugECPch(wLevel, pch, cch)\
  576. debuglogPch(wLevel, fDebugFilterEc, pch, cch)
  577. #define debugECPwch(wLevel, pwch, cwch)\
  578. debuglogPwch(wLevel, fDebugFilterEc, pwch, cwch)
  579. // MSO Internal Event Monitor debug log macros
  580. #define debugMsoEM0(wLevel, sz) \
  581. debuglog0(wLevel, fDebugFilterMsoEm, sz)
  582. #define debugMsoEM1(wLevel, sz, a) \
  583. debuglog1(wLevel, fDebugFilterMsoEm, sz, a)
  584. #define debugMsoEM2(wLevel, sz, a, b) \
  585. debuglog2(wLevel, fDebugFilterMsoEm, sz, a, b)
  586. #define debugMsoEM3(wLevel, sz, a, b, c) \
  587. debuglog3(wLevel, fDebugFilterMsoEm, sz, a, b, c)
  588. #define debugMsoEM4(wLevel, sz, a, b, c, d) \
  589. debuglog4(wLevel, fDebugFilterMsoEm, sz, a, b, c, d)
  590. #define debugMsoEM5(wLevel, sz, a, b, c, d, e) \
  591. debuglog5(wLevel, fDebugFilterMsoEm, sz, a, b, c, d, e)
  592. #define debugMsoEM6(wLevel, sz, a, b, c, d, e, f) \
  593. debuglog6(wLevel, fDebugFilterMsoEm, sz, a, b, c, d, e, f)
  594. #define debugMsoEMPch(wLevel, pch, cch)\
  595. debuglogPch(wLevel, fDebugFilterMsoEm, pch, cch)
  596. #define debugMsoEMPwch(wLevel, pwch, cwch)\
  597. debuglogPwch(wLevel, fDebugFilterMsoEm, pwch, cwch)
  598. #if defined(DEBUG) || defined(STANDALONE)
  599. #define DebugStandalone(e) e
  600. #else /* !(DEBUG || STANDALONE) */
  601. #define DebugStandalone(e)
  602. #endif /* DEBUG || STANDALONE */
  603. MSOEXTERN_C_END // ****************** End extern "C" *********************
  604. #endif // !MSODBGLG_H