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.

124 lines
4.3 KiB

  1. /************************************************************/
  2. /* Windows Write, Copyright 1985-1992 Microsoft Corporation */
  3. /************************************************************/
  4. #include "machdefs.h"
  5. #define cfcPage ((typeFC)cbSector)
  6. #define ibpNil 255
  7. #define lruMax ((unsigned) 65535)
  8. #define fnMax 5
  9. #define fnInsert (fnNil - 1)
  10. #define fnScratch 0
  11. #define osfnNil (-1)
  12. #define rfnNil rfnMax /* Stored in 7 bits */
  13. #define rfnFree (rfnMax + 1)
  14. #define wMW ('M' + ('W' << 8))
  15. #define wSY ('S' + ('Y' << 8))
  16. #define wHP ('H' + ('P' << 8))
  17. #define cwSector (cbSector / sizeof (int))
  18. #define cbpMustKeep 6 /* assume no bp will be dislodged for this
  19. many calls to IbpEnsureValid */
  20. #define cbOpenFileBuf 128
  21. #ifdef SAND
  22. #define wMagic 0177062
  23. #define wMagicOld 0137061
  24. #else /* not SAND */
  25. #define wMagic 0137061
  26. #endif /* not SAND */
  27. #define wMagicTool ((0253 << 8) + 0)
  28. #define fcMax ((typeFC) 2147483647)
  29. #define fpeNoSuch (-5)
  30. #define fpeDiskFull (-7)
  31. struct BPS
  32. {
  33. typePN pn;
  34. int fn;
  35. typeTS ts; /* time stamp - used in LRU algorithm */
  36. unsigned fDirty : 1;
  37. unsigned cch : 15;
  38. CHAR ibpHashNext; /* link for external chained hashing
  39. collision resolution */
  40. };
  41. struct FCB
  42. {
  43. typeFC fcMac; /* includes FIB, but not FKP's */
  44. unsigned char fFormatted : 1;
  45. unsigned char fDelete : 1;
  46. unsigned char fReferenced : 1;
  47. unsigned char dty : 4;
  48. unsigned char fOpened: 1; /* Whether file has been opened before */
  49. unsigned char rfn : 7;
  50. unsigned char fSearchPath: 1; /* Search path when first opened */
  51. int mdExt;
  52. int mdFile;
  53. typePN pnChar;
  54. typePN pnPara;
  55. typePN pnFntb;
  56. typePN pnSep;
  57. typePN pnSetb;
  58. typePN pnBftb;
  59. typePN pnFfntb; /* font family name table offset */
  60. typePN pnMac; /* # of pages actually in existence */
  61. typeFC (**hgfcChp)[];
  62. typeFC (**hgfcPap)[];
  63. CHAR (**hszFile)[];
  64. CHAR (**hszSsht)[];
  65. CHAR rgbOpenFileBuf[ cbOpenFileBuf ]; /* OpenFile's work space */
  66. #ifdef SAND
  67. int version; /* version byte */
  68. int vref; /* volume reference number */
  69. #endif /* SAND */
  70. unsigned int fDisableRead: 1; /* disable reading of file */
  71. };
  72. #define cbFCB (sizeof (struct FCB))
  73. #define cwFCB (sizeof (struct FCB) / sizeof (int))
  74. struct ERFN
  75. { /* Real file (opened in os) */
  76. int osfn;
  77. int fn;
  78. typeTS ts; /* time stamp - used in LRU algorithm */
  79. };
  80. #define cchToolHeader 14
  81. struct FIB
  82. {
  83. int wIdent; /* Word-specific magic number */
  84. int dty;
  85. int wTool;
  86. int cReceipts; /* Number of external receipts allowed */
  87. int cbReceipt; /* Length of each receipt */
  88. int bReceipts; /* One word offset from beginning of file
  89. to beginning of receipts */
  90. int isgMac; /* Number of code segments included */
  91. /* End of Multi-Tool standard header */
  92. typeFC fcMac;
  93. typePN pnPara;
  94. typePN pnFntb;
  95. typePN pnSep;
  96. typePN pnSetb;
  97. typePN pnBftb; /* Also pnPgtb */
  98. typePN pnFfntb; /* font family name table */
  99. CHAR szSsht[66]; /* Style sheet name */
  100. typePN pnMac;
  101. CHAR rgbJunk[cbSector - (cchToolHeader + sizeof (typeFC)
  102. + 7 * sizeof (typePN) + 66)];
  103. };
  104. #define cchFIB (sizeof (struct FIB))
  105. #define CONVFROMWORD (TRUE + 2) /* used by FWriteFn to convert Word file
  106. characters to Write ANSI set */
  107.