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.

95 lines
3.8 KiB

  1. /*
  2. ** helpfile.h
  3. **
  4. ** This file defines the help file format.
  5. **
  6. **
  7. ** +---------------------+
  8. ** | Header |
  9. ** +---------------------+
  10. ** | Topic index |
  11. ** +---------------------+
  12. ** | Context strings |
  13. ** +---------------------+
  14. ** | Context map |
  15. ** +---------------------+
  16. ** | Keyphrase table |
  17. ** +---------------------+
  18. ** | Huffman decode tree |
  19. ** +---------------------+
  20. ** | Filename Map |
  21. ** +---------------------+
  22. ** | Compressed topics |
  23. ** +---------------------+
  24. **
  25. ** Header: described by the structure below.
  26. **
  27. ** Topic index: an array of dwords indexed by topic number that gives the file
  28. ** position of the topic. Note: topic n+1 follows topic n so the index can be
  29. ** used to compute the size of a topic as well.
  30. **
  31. ** Context Strings: An array of (null terminated) strings which map to context
  32. ** numbers in the following Context Map. These strings are used to for topic
  33. ** look-up when no predefined Context Number has been assigned.
  34. **
  35. ** Context map: an array of words which maps a context to a topic. This allows
  36. ** the order of context numbers to differ from the order of topics in the help
  37. ** file, and allows more than one context to map to the same topic.
  38. **
  39. ** Keyphrase table: table of strings used to compress the topic text.
  40. **
  41. ** Huffman decode tree: tree representing the character mapping used in huffman
  42. ** copression of the help text.
  43. **
  44. ** Filename Map: Table of filenames and Topic Index ranges used to redirect
  45. ** certain topics to other help files. Used in combined help files.
  46. **
  47. ** Compressed Topics: The compressed text for all topics. When the help file is
  48. ** built, the topics are first keyphrase and runlength compressed, and are the
  49. ** Huffman encoded. So to decode a topic, it must first be Huffman decoded, and
  50. ** then keyphrase and runlength expanded. Keyphrase and runlength encoding
  51. ** cookies are described below. Huffman decoding is discussed in dehuff.asm.
  52. */
  53. /*
  54. ** Numbers for each of the sections of the help file
  55. */
  56. #define HS_INDEX 0 /* topic index */
  57. #define HS_CONTEXTSTRINGS 1 /* Context Strings */
  58. #define HS_CONTEXTMAP 2 /* context to topic map */
  59. #define HS_KEYPHRASE 3 /* keyphrase table */
  60. #define HS_HUFFTREE 4 /* huffman decode tree */
  61. #define HS_TOPICS 5 /* compressed topic text */
  62. #define HS_NEXT 8 /* position of cat'ed helpfile */
  63. #define wMagicHELP 0x4e4c /* New Help file magic word */
  64. #define wMagicHELPOld 0x928b /* Old Help file magic word */
  65. #define wHelpVers 2 /* helpfile version */
  66. #define wfCase 0x0001 /* set= Preserve case */
  67. #define wfLock 0x0002 /* set= file locked */
  68. /*
  69. ** Keyphrase and run length encoding cookies. Each compressed keyphrase or
  70. ** character run is replaced by one of these cookies with appropriate
  71. ** parameters.
  72. **
  73. ** Keyphrase cookies are followed by a one byte keyphrase index.
  74. ** Runspace is followed by a one byte count of spaces.
  75. ** Run is followed by a character and a count of repititions.
  76. ** Quote is followed by a character.
  77. */
  78. #define C_MIN 0x10 /* Bottom of cookie range */
  79. #define C_KEYPHRASE0 0x10 /* 1st keyphrase cookie */
  80. #define C_KEYPHRASE1 0x11 /* 2nd keyphrase cookie */
  81. #define C_KEYPHRASE2 0x12 /* 3rd keyphrase cookie */
  82. #define C_KEYPHRASE3 0x13 /* 3rd keyphrase cookie */
  83. #define C_KEYPHRASE_SPACE0 0x14 /* 1st keyphrase + space cookie */
  84. #define C_KEYPHRASE_SPACE1 0x15 /* 2nd keyphrase + space cookie */
  85. #define C_KEYPHRASE_SPACE2 0x16 /* 3rd keyphrase + space cookie */
  86. #define C_KEYPHRASE_SPACE3 0x17 /* 3rd keyphrase + space cookie */
  87. #define C_RUNSPACE 0x18 /* Cookie for runs of spaces */
  88. #define C_RUN 0x19 /* Cookie for runs of non-space */
  89. #define C_QUOTE 0x1a /* Cookie to quote non-cookies */
  90. #define C_MAX 0x1a /* top of cookie range */