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.

97 lines
1.7 KiB

  1. #include <memory.h>
  2. typedef INT X;
  3. typedef INT Y;
  4. typedef INT DX;
  5. typedef INT DY;
  6. #define fTrue 1
  7. #define fFalse 0
  8. // PoinT structure
  9. typedef struct _pt
  10. {
  11. X x;
  12. Y y;
  13. } PT;
  14. // DEL structure
  15. typedef struct _del
  16. {
  17. DX dx;
  18. DY dy;
  19. } DEL;
  20. // ReCt structure
  21. typedef struct _rc
  22. {
  23. X xLeft;
  24. Y yTop;
  25. X xRight;
  26. Y yBot;
  27. } RC;
  28. #ifdef DEBUG
  29. #define VSZASSERT static char *vszAssert = __FILE__;
  30. #define Assert(f) { if (!(f)) { AssertFailed(vszAssert, __LINE__); } }
  31. #define SideAssert(f) { if (!(f)) { AssertFailed(vszAssert, __LINE__); } }
  32. #else
  33. #define Assert(f)
  34. #define SideAssert(f) (f)
  35. #define VSZASSERT
  36. #endif
  37. VOID *PAlloc(INT cb);
  38. VOID FreeP();
  39. INT CchString();
  40. CHAR *PszCopy(CHAR *pszFrom, CHAR *rgchTo);
  41. INT CchSzLen(CHAR *sz);
  42. INT CchLpszLen(CHAR FAR *lpsz);
  43. INT CchDecodeInt(CHAR *rgch, INT w);
  44. VOID Error(CHAR *sz);
  45. VOID ErrorIds(INT ids);
  46. INT WMin(INT w1, INT w2);
  47. INT WMax(INT w1, INT w2);
  48. INT WParseLpch(CHAR FAR **plpch);
  49. BOOL FInRange(INT w, INT wFirst, INT wLast);
  50. INT PegRange(INT w, INT wFirst, INT wLast);
  51. VOID NYI();
  52. INT CchString(CHAR *sz, INT ids);
  53. VOID InvertRc(RC *prc);
  54. VOID OffsetPt(PT *ppt, DEL *pdel, PT *pptDest);
  55. BOOL FRectAllVisible(HDC hdc, RC *prc);
  56. #ifdef DEBUG
  57. VOID AssertFailed(CHAR *szFile, INT li);
  58. #endif
  59. #define bltb(pb1, pb2, cb) memcpy(pb2, pb1, cb)
  60. /*
  61. short APIENTRY MulDiv(short, short, short);
  62. */
  63. extern HWND hwndApp;
  64. extern HANDLE hinstApp;
  65. BOOL FWriteIniString(INT idsTopic, INT idsItem, CHAR *szValue);
  66. BOOL FWriteIniInt(INT idsTopic, INT idsItem, INT w);
  67. BOOL FGetIniString(INT idsTopic, INT idsItem, CHAR *sz, CHAR *szDefault, INT cchMax);
  68. INT GetIniInt(INT idsTopic, INT idsItem, INT wDefault);
  69. VOID CrdRcFromPt(PT *ppt, RC *prc);