Leaked source code of windows server 2003
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.

76 lines
3.2 KiB

  1. #ifndef SETFMTST_DEFINED
  2. #define SETFMTST_DEFINED
  3. #include "zqfromza.h"
  4. #include "lsdefs.h"
  5. /* M A X */
  6. /*----------------------------------------------------------------------------
  7. %%Macro: Max
  8. %%Contact: igorzv
  9. Returns the maximum of two values a and b.
  10. ----------------------------------------------------------------------------*/
  11. #define Max(a,b) ((a) < (b) ? (b) : (a))
  12. #define SetDnodeToFinish(plsc, plsdn) ((plsc)->lslistcontext.plsdnToFinish = plsdn)
  13. #define SetCurrentSubline(plsc, plssubl) ((plsc)->lslistcontext.plssublCurrent = plssubl)
  14. #define AdvanceCurrentCpLimSubl(plssubl, dcp) ((plssubl)->cpLim += dcp)
  15. #define AdvanceCurrentCpLim(plsc, dcp) AdvanceCurrentCpLimSubl(GetCurrentSubline(plsc), dcp)
  16. #define SetCurrentCpLimSubl(plssubl, cp) ((plssubl)->cpLim = cp)
  17. #define SetCurrentCpLim(plsc, cp) SetCurrentCpLimSubl(GetCurrentSubline(plsc), cp)
  18. #define SetCurrentUrSubl(plssubl, ur) ((plssubl)->urCur = ur)
  19. #define SetCurrentUr(plsc, ur) SetCurrentUrSubl(GetCurrentSubline(plsc), ur)
  20. #define SetCurrentVrSubl(plssubl, vr) ((plssubl)->vrCur = vr)
  21. #define SetCurrentVr(plsc, vr) SetCurrentVrSubl(GetCurrentSubline(plsc), vr)
  22. #define AdvanceCurrentUrSubl(plssubl, dur) if ((plssubl)->urCur >= uLsInfiniteRM - dur) \
  23. return lserrTooLongParagraph; \
  24. ((plssubl)->urCur += dur);
  25. #define AdvanceCurrentUr(plsc, dur) AdvanceCurrentUrSubl(GetCurrentSubline(plsc), dur)
  26. #define AdvanceCurrentVrSubl(plssubl, dvr) if ((plssubl)->vrCur >= uLsInfiniteRM - dvr) \
  27. return lserrTooLongParagraph; \
  28. ((plssubl)->vrCur += dvr);
  29. #define AdvanceCurrentVr(plsc, dvr) AdvanceCurrentVrSubl(GetCurrentSubline(plsc), dvr)
  30. #define SetCurrentDnodeSubl(plssubl, plsdn) ((plssubl)->plsdnLast = (plsdn)); \
  31. if ((plsdn) == NULL) ((plssubl)->plsdnFirst = NULL);
  32. #define SetCurrentDnode(plsc, plsdn) SetCurrentDnodeSubl(GetCurrentSubline(plsc), plsdn)
  33. #define SetBreakthroughLine(plsc, urRightMargin) \
  34. (plsc)->plslineCur->lslinfo.fTabInMarginExLine = fTrue; \
  35. (plsc)->lsadjustcontext.urRightMarginJustify = \
  36. (plsc)->urRightMarginBreak == 0 ? \
  37. (plsc)->lsadjustcontext.urRightMarginJustify + (urRightMargin) \
  38. : \
  39. ((plsc)->lsadjustcontext.urRightMarginJustify / \
  40. (plsc)->urRightMarginBreak )\
  41. * (urRightMargin); \
  42. (plsc)->urRightMarginBreak = (urRightMargin); \
  43. (plsc)->plslineCur->lssubl.urColumnMax = (urRightMargin); \
  44. #define IncreaseFormatDepth(plsc) ((plsc)->lslistcontext.nDepthFormatLineCurrent++, \
  45. (plsc)->plslineCur->lslinfo.nDepthFormatLineMax = \
  46. Max((plsc)->lslistcontext.nDepthFormatLineCurrent, \
  47. (plsc)->plslineCur->lslinfo.nDepthFormatLineMax))
  48. #define DecreaseFormatDepth(plsc) ((plsc)->lslistcontext.nDepthFormatLineCurrent--)
  49. #define SetCpLimDisplaySubl(plssubl, cp) ((plssubl)->cpLimDisplay = cp)
  50. #define SetCpLimDisplay(plsc, cp) SetCpLimDisplaySubl(GetCurrentSubline(plsc), cp)
  51. #define SetLastDnodeDisplaySubl(plssubl, plsdn) ((plssubl)->plsdnLastDisplay = plsdn)
  52. #define SetLastDnodeDisplay(plsc, plsdn) SetLastDnodeDisplaySubl(GetCurrentSubline(plsc), plsdn)
  53. #endif /* SETFMTST_DEFINED */