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.

291 lines
9.6 KiB

  1. /*
  2. readext.h Read Extract database file
  3. */
  4. #define T2_TYPEMASK 0x0E0
  5. #define T2_TYPEBLOCK 0x000
  6. #define T2_TYPEFUNC 0x0E0
  7. #define T2_TYPECB 0x0C0
  8. #define T2_TYPEMSG 0x0A0
  9. #define T2_TYPEINT 0x080
  10. #define T2_TYPEASM 0x060
  11. #define T2_TYPEASMCB 0x040
  12. #define T2_TYPETYPE 0x020
  13. // WARNING: no more bits are available for types
  14. #define T2_HEADER T2_TYPEBLOCK + 0x00
  15. #define T2_BEGINHEAD T2_HEADER
  16. #define T2_EXTRACTID T2_HEADER
  17. #define T2_EXTRACTVER T2_HEADER
  18. #define T2_EXTRACTDATE T2_HEADER
  19. #define T2_ENDHEAD T2_HEADER
  20. #define T2_BEGINBLOCK T2_TYPEBLOCK + 0x01
  21. #define T2_ENDBLOCK T2_TYPEBLOCK + 0x02
  22. #define T2_ENDCALLBACK T2_TYPEBLOCK + 0x05
  23. #define T2_DOCLEVEL T2_TYPEBLOCK + 0x03
  24. #define T2_SRCLINE T2_TYPEBLOCK + 0x04
  25. #define T2_BEGINHEADER T2_TYPEBLOCK + 0x05
  26. #define T2_ENDHEADER T2_TYPEBLOCK + 0x06
  27. #define T2_FUNCTYPE T2_TYPEFUNC + 0x1
  28. #define T2_FUNCNAME T2_TYPEFUNC + 0x2
  29. #define T2_FUNCDESC T2_TYPEFUNC + 0x3
  30. #define T2_PARMTYPE T2_TYPEFUNC + 0x4
  31. #define T2_PARMNAME T2_TYPEFUNC + 0x5
  32. #define T2_PARMDESC T2_TYPEFUNC + 0x6
  33. #define T2_FLAGNAMEPARM T2_TYPEFUNC + 0x7
  34. #define T2_FLAGDESCPARM T2_TYPEFUNC + 0x8
  35. #define T2_FLAGNAMERTN T2_TYPEFUNC + 0x9
  36. #define T2_FLAGDESCRTN T2_TYPEFUNC + 0xa
  37. #define T2_RTNDESC T2_TYPEFUNC + 0xb
  38. #define T2_COMMENT T2_TYPEFUNC + 0xc
  39. #define T2_XREF T2_TYPEFUNC + 0xd
  40. #define T2_USES T2_TYPEFUNC + 0x17
  41. #ifdef WARPAINT
  42. #define T2_INTTYPE T2_TYPEINT + 0x2
  43. #define T2_INTNAME T2_TYPEINT + 0x3
  44. #define T2_INTDESC T2_TYPEINT + 0x4
  45. #define T2_INTPARMTYPE T2_TYPEINT + 0x5
  46. #define T2_INTPARMNAME T2_TYPEINT + 0x6
  47. #define T2_INTPARMDESC T2_TYPEINT + 0x7
  48. #define T2_INTFLAGNAMEPARM T2_TYPEINT + 0xa
  49. #define T2_INTFLAGDESCPARM T2_TYPEINT + 0xb
  50. #define T2_INTRTNDESC T2_TYPEINT + 0xc
  51. #define T2_INTFLAGNAMERTN T2_TYPEINT + 0x8
  52. #define T2_INTFLAGDESCRTN T2_TYPEINT + 0x9
  53. #define T2_INTCOMMENT T2_TYPEINT + 0xd
  54. #define T2_INTXREF T2_TYPEINT + 0xe
  55. #define T2_INTUSES T2_TYPEINT + 0x17
  56. #define T2_INTREGNAME T2_TYPEINT + 0xf
  57. #define T2_INTREGDESC T2_TYPEINT + 0x10
  58. #define T2_INTFLAGNAMEREGRTN T2_TYPEINT + 0x11
  59. #define T2_INTFLAGDESCREGRTN T2_TYPEINT + 0x12
  60. #define T2_INTFLAGNAMEREG T2_TYPEINT + 0x13
  61. #define T2_INTFLAGDESCREG T2_TYPEINT + 0x14
  62. #endif
  63. #define T2_ASMTYPE T2_TYPEASM + 0x2
  64. #define T2_ASMNAME T2_TYPEASM + 0x3
  65. #define T2_ASMDESC T2_TYPEASM + 0x4
  66. #define T2_ASMPARMTYPE T2_TYPEASM + 0x5
  67. #define T2_ASMPARMNAME T2_TYPEASM + 0x6
  68. #define T2_ASMPARMDESC T2_TYPEASM + 0x7
  69. #define T2_ASMFLAGNAMEPARM T2_TYPEASM + 0xa
  70. #define T2_ASMFLAGDESCPARM T2_TYPEASM + 0xb
  71. #define T2_ASMRTNDESC T2_TYPEASM + 0xc
  72. #define T2_ASMFLAGNAMERTN T2_TYPEASM + 0x8
  73. #define T2_ASMFLAGDESCRTN T2_TYPEASM + 0x9
  74. #define T2_ASMCOMMENT T2_TYPEASM + 0xd
  75. #define T2_ASMXREF T2_TYPEASM + 0xe
  76. #define T2_ASMUSES T2_TYPEASM + 0x17
  77. #define T2_ASMREGNAME T2_TYPEASM + 0xf
  78. #define T2_ASMREGDESC T2_TYPEASM + 0x10
  79. #define T2_ASMFLAGNAMEREG T2_TYPEASM + 0x13
  80. #define T2_ASMFLAGDESCREG T2_TYPEASM + 0x14
  81. #define T2_ASMREGNAMERTN T2_TYPEASM + 0x15
  82. #define T2_ASMREGDESCRTN T2_TYPEASM + 0x16
  83. #define T2_ASMFLAGNAMEREGRTN T2_TYPEASM + 0x11
  84. #define T2_ASMFLAGDESCREGRTN T2_TYPEASM + 0x12
  85. #define T2_ASMCOND T2_TYPEASM + 0x18
  86. #define T2_ASMCBTYPE T2_TYPEASMCB + 0x2
  87. #define T2_ASMCBNAME T2_TYPEASMCB + 0x3
  88. #define T2_ASMCBDESC T2_TYPEASMCB + 0x4
  89. #define T2_ASMCBPARMTYPE T2_TYPEASMCB + 0x5
  90. #define T2_ASMCBPARMNAME T2_TYPEASMCB + 0x6
  91. #define T2_ASMCBPARMDESC T2_TYPEASMCB + 0x7
  92. #define T2_ASMCBFLAGNAMEPARM T2_TYPEASMCB + 0xa
  93. #define T2_ASMCBFLAGDESCPARM T2_TYPEASMCB + 0xb
  94. #define T2_ASMCBRTNDESC T2_TYPEASMCB + 0xc
  95. #define T2_ASMCBFLAGNAMERTN T2_TYPEASMCB + 0x8
  96. #define T2_ASMCBFLAGDESCRTN T2_TYPEASMCB + 0x9
  97. #define T2_ASMCBCOMMENT T2_TYPEASMCB + 0xd
  98. #define T2_ASMCBXREF T2_TYPEASMCB + 0xe
  99. #define T2_ASMCBUSES T2_TYPEASMCB + 0x17
  100. #define T2_ASMCBREGNAME T2_TYPEASMCB + 0xf
  101. #define T2_ASMCBREGDESC T2_TYPEASMCB + 0x10
  102. #define T2_ASMCBFLAGNAMEREG T2_TYPEASMCB + 0x13
  103. #define T2_ASMCBFLAGDESCREG T2_TYPEASMCB + 0x14
  104. #define T2_ASMCBREGNAMERTN T2_TYPEASMCB + 0x15
  105. #define T2_ASMCBREGDESCRTN T2_TYPEASMCB + 0x16
  106. #define T2_ASMCBFLAGNAMEREGRTN T2_TYPEASMCB + 0x11
  107. #define T2_ASMCBFLAGDESCREGRTN T2_TYPEASMCB + 0x12
  108. #define T2_ASMCBCOND T2_TYPEASMCB + 0x18
  109. #define T2_CBTYPE T2_TYPECB + 0x2
  110. #define T2_CBNAME T2_TYPECB + 0x3
  111. #define T2_CBDESC T2_TYPECB + 0x4
  112. #define T2_CBPARMTYPE T2_TYPECB + 0x5
  113. #define T2_CBPARMNAME T2_TYPECB + 0x6
  114. #define T2_CBPARMDESC T2_TYPECB + 0x7
  115. #define T2_CBFLAGNAMEPARM T2_TYPECB + 0xa
  116. #define T2_CBFLAGDESCPARM T2_TYPECB + 0xb
  117. #define T2_CBRTNDESC T2_TYPECB + 0xc
  118. #define T2_CBFLAGNAMERTN T2_TYPECB + 0x8
  119. #define T2_CBFLAGDESCRTN T2_TYPECB + 0x9
  120. #define T2_CBCOMMENT T2_TYPECB + 0xd
  121. #define T2_CBXREF T2_TYPECB + 0xe
  122. #define T2_CBUSES T2_TYPECB + 0x17
  123. #define T2_CBREGNAME T2_TYPECB + 0xf
  124. #define T2_CBREGDESC T2_TYPECB + 0x10
  125. #define T2_CBFLAGNAMEREG T2_TYPECB + 0x11
  126. #define T2_CBFLAGDESCREG T2_TYPECB + 0x12
  127. #define T2_MSGTYPE T2_TYPEMSG + 0x2
  128. #define T2_MSGNAME T2_TYPEMSG + 0x3
  129. #define T2_MSGDESC T2_TYPEMSG + 0x4
  130. #define T2_MSGPARMTYPE T2_TYPEMSG + 0x5
  131. #define T2_MSGPARMNAME T2_TYPEMSG + 0x6
  132. #define T2_MSGPARMDESC T2_TYPEMSG + 0x7
  133. #define T2_MSGFLAGNAMEPARM T2_TYPEMSG + 0xa
  134. #define T2_MSGFLAGDESCPARM T2_TYPEMSG + 0xb
  135. #define T2_MSGRTNDESC T2_TYPEMSG + 0xc
  136. #define T2_MSGFLAGNAMERTN T2_TYPEMSG + 0xa
  137. #define T2_MSGFLAGDESCRTN T2_TYPEMSG + 0x9
  138. #define T2_MSGCOMMENT T2_TYPEMSG + 0xd
  139. #define T2_MSGXREF T2_TYPEMSG + 0xe
  140. #define T2_MSGUSES T2_TYPEMSG + 0x17
  141. #define T2_MSGREGNAME T2_TYPEMSG + 0xf
  142. #define T2_MSGREGDESC T2_TYPEMSG + 0x10
  143. #define T2_MSGFLAGNAMEREG T2_TYPEMSG + 0x11
  144. #define T2_MSGFLAGDESCREG T2_TYPEMSG + 0x12
  145. // Struct Type definition
  146. #define T2_STRUCTNAME T2_TYPETYPE + 0x01
  147. #define T2_STRUCTDESC T2_TYPETYPE + 0x02
  148. #define T2_STRUCTFIELDTYPE T2_TYPETYPE + 0x03
  149. #define T2_STRUCTFIELDNAME T2_TYPETYPE + 0x04
  150. #define T2_STRUCTFIELDDESC T2_TYPETYPE + 0x05
  151. #define T2_STRUCTFLAGNAME T2_TYPETYPE + 0x06
  152. #define T2_STRUCTFLAGDESC T2_TYPETYPE + 0x07
  153. #define T2_STRUCTSTRUCTNAME T2_TYPETYPE + 0x08
  154. #define T2_STRUCTSTRUCTDESC T2_TYPETYPE + 0x09
  155. #define T2_STRUCTSTRUCTEND T2_TYPETYPE + 0x0a
  156. #define T2_STRUCTUNIONNAME T2_TYPETYPE + 0x0b
  157. #define T2_STRUCTUNIONDESC T2_TYPETYPE + 0x0c
  158. #define T2_STRUCTUNIONEND T2_TYPETYPE + 0x0d
  159. #define T2_STRUCTOTHERTYPE T2_TYPETYPE + 0x0e
  160. #define T2_STRUCTOTHERNAME T2_TYPETYPE + 0x0f
  161. #define T2_STRUCTOTHERDESC T2_TYPETYPE + 0x13
  162. #define T2_STRUCTTAGNAME T2_TYPETYPE + 0x10
  163. #define T2_STRUCTCOMMENT T2_TYPETYPE + 0x11
  164. #define T2_STRUCTXREF T2_TYPETYPE + 0x12
  165. // Union Type definition
  166. #define T2_UNIONNAME T2_TYPETYPE + 0x13
  167. #define T2_UNIONDESC T2_TYPETYPE + 0x14
  168. #define T2_UNIONSTRUCTEND T2_TYPETYPE + 0x15
  169. #define T2_UNIONUNIONEND T2_TYPETYPE + 0x16
  170. #define T2_UNIONFIELDTYPE T2_STRUCTFIELDTYPE
  171. #define T2_UNIONFIELDNAME T2_STRUCTFIELDNAME
  172. #define T2_UNIONFIELDDESC T2_STRUCTFIELDDESC
  173. #define T2_UNIONFLAGNAME T2_STRUCTFLAGNAME
  174. #define T2_UNIONFLAGDESC T2_STRUCTFLAGDESC
  175. #define T2_UNIONSTRUCTNAME T2_STRUCTSTRUCTNAME
  176. #define T2_UNIONSTRUCTDESC T2_STRUCTSTRUCTDESC
  177. #define T2_UNIONUNIONNAME T2_STRUCTUNIONNAME
  178. #define T2_UNIONUNIONDESC T2_STRUCTUNIONDESC
  179. #define T2_UNIONOTHERTYPE T2_STRUCTOTHERTYPE
  180. #define T2_UNIONOTHERNAME T2_STRUCTOTHERNAME
  181. #define T2_UNIONOTHERDESC T2_STRUCTOTHERDESC
  182. #define T2_UNIONTAGNAME T2_STRUCTTAGNAME
  183. #define T2_UNIONCOMMENT T2_STRUCTCOMMENT
  184. #define T2_UNIONXREF T2_STRUCTXREF
  185. /* general classifications */
  186. #define TG_BEGINBLOCK 0x61
  187. #define TG_ENDBLOCK 0x62
  188. #define TG_DOCLEVEL 0x63
  189. #define TG_SRCLINE 0x64
  190. #define TG_BEGINHEADER 0x65
  191. #define TG_ENDHEADER 0x66
  192. #define TG_TYPE 0x71
  193. #define TG_NAME 0x72
  194. #define TG_DESC 0x73
  195. #define TG_PARMTYPE 0x74
  196. #define TG_PARMNAME 0x75
  197. #define TG_PARMDESC 0x76
  198. #define TG_FLAGNAME 0x77
  199. #define TG_FLAGDESC 0x78
  200. #define TG_RTNDESC 0x7b
  201. #define TG_COMMENT 0x7c
  202. #define TG_XREF 0x7d
  203. #define TG_REGNAME 0x7e
  204. #define TG_REGDESC 0x7f
  205. #define TG_USES 0x80
  206. #define TG_COND 0x81
  207. #define TG_BEGINHEAD 0x40
  208. #define TG_EXTRACTID 0x41
  209. #define TG_EXTRACTVER 0x42
  210. #define TG_EXTRACTDATE 0x43
  211. #define TG_ENDHEAD 0x44
  212. #define TG_STRUCT 0x50
  213. #define TG_FIELDTYPE 0x51
  214. #define TG_FIELDNAME 0x52
  215. #define TG_FIELDDESC 0x53
  216. #define TG_UNION 0x54
  217. #define TG_OTHERTYPE 0x55
  218. #define TG_OTHERNAME 0x55
  219. #define TG_OTHERDESC 0x57
  220. #define TG_TAG 0x5F
  221. #define TYPE(l) ((int)(HIWORD((unsigned long)l) & T2_TYPEMASK ))
  222. extern void nextText(struct _EXTFile *pExt);
  223. extern char *lineText(char *pch);
  224. extern void stripNewline(char *pch);
  225. extern int getLine(struct _EXTFile *pExt);
  226. extern DWORD getTag(struct _EXTFile *pExt);
  227. extern DWORD _getTag(struct _EXTFile *pExt);
  228. extern int initreadext(void );
  229. extern int processText(struct _EXTFile *pExt,struct stLine * *place);
  230. extern int getFlag(struct _EXTFile *pExt,struct stFlag * *flag);
  231. extern int getParm(struct _EXTFile *pExt,struct stParm * *parm);
  232. extern int getCallback(struct _EXTFile *pExt,struct stBlock *pcbBlock);
  233. extern int getFuncBlock(struct _EXTFile *pExt,struct stBlock *pBlock);
  234. extern struct stBlock *newBlock(void );
  235. extern int getMsgBlock(struct _EXTFile *pExt,struct stBlock *pBlock);
  236. extern struct stBlock *getBlock(struct _EXTFile *pExt);