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.

335 lines
9.8 KiB

  1. /*
  2. * @doc EXTERNAL,INTERNAL test ; foobar
  3. *
  4. * @print NORMAL API DECLARATION:
  5. * @print -----------------------
  6. *
  7. * @api int | testNormalApiBlock | This function is to test a
  8. * standard API defintion. Only tests standard type stuff: parameters,
  9. * comments, return flags, xrefs, the doc tag.
  10. *
  11. * @parm int | FirstParm | This parameter has no flags, but it does
  12. * have two paragraphs.
  13. *
  14. * This is the second paragraph for the first parameter in this function.
  15. * @parm int | SecondParm | This parameter may take the following
  16. * flags:
  17. * @flag F1_FIRST_FLAG | Specifies door number one. This flag should
  18. * have lots of paragraphs within its description.
  19. *
  20. * This is the second paragraph for flag number one.
  21. *
  22. * @flag F1_SECOND_FLAG | The second flag for parameter two.
  23. * @flag F1_THIRD_FLAG | This is the third valid flag value for
  24. * parameter two.
  25. *
  26. * @parm int | ThirdParm | Contains one of the following flag values:
  27. * @flag F2_FOOBAR | This flag currently ignored.
  28. *
  29. * @print Testing comments within text...
  30. * @flag F2_BARFOO | // If this line appears, then comments are broken.
  31. * The second flag. This line must appear, else embedded
  32. * comments are broken.
  33. *
  34. * @comm This is the comment text block's first paragraph. It is not
  35. * too long.
  36. *
  37. * The second paragraph begins with this sentence. This is a test of
  38. * the emergency broadcast system. In the event of an actual emergency,
  39. * the attention signal you just heard would have been followed by
  40. * information from the authorities.
  41. *
  42. * @rdesc This is the return description. It has three flags. The
  43. * paragraph of the return description can be as long as required, and
  44. * may include multiple paragraphs.
  45. *
  46. * This is the second paragraph for the return description.
  47. *
  48. * @flag RFLAG_ONE | Return flag number one.
  49. * @flag RFLAG_TWO | Return flag number two.
  50. * @flag RFLAG_THREE|Return flag three.
  51. *
  52. * @xref testAsmBlock,testWarpedProcedure testNormalApiBlock
  53. *
  54. * @print Doing callback for api block..
  55. * @print ------------------------------
  56. *
  57. * @cb void | testCallbackOne | The normal API block's test
  58. * callback.
  59. *
  60. * @parm int | FirstParm | This parameter has no flags.
  61. * @parm int | SecondParm | This parameter may take the following
  62. * flags:
  63. * @flag F1_FIRST_FLAG | Specifies door number one. This flag should
  64. * have lots of paragraphs within its description.
  65. *
  66. * This is the second paragraph for flag number one.
  67. *
  68. * @flag F1_SECOND_FLAG | The second flag for parameter two.
  69. * @flag F1_THIRD_FLAG | This is the third valid flag value for
  70. * parameter two.
  71. *
  72. * @parm int | ThirdParm | Contains one of the following flag values:
  73. * @flag F2_FOOBAR | This flag currently ignored.
  74. *
  75. * @print Testing comments within text...
  76. * @flag F2_BARFOO | // If this line appears, then comments are broken.
  77. * The second flag. This line must appear, else embedded
  78. * comments are broken.
  79. *
  80. * @comm This is the comment text block's first paragraph. It is not
  81. * too long.
  82. *
  83. * The second paragraph begins with this sentence. This is a test of
  84. * the emergency broadcast system. In the event of an actual emergency,
  85. * the attention signal you just heard would have been followed by
  86. * information from the authorities.
  87. *
  88. * @rdesc This is the return description. It has three flags. The
  89. * paragraph of the return description can be as long as required, and
  90. * may include multiple paragraphs.
  91. *
  92. * This is the second paragraph for the return description.
  93. *
  94. * @flag RFLAG_ONE | Return flag number one.
  95. * @flag RFLAG_TWO | Return flag number two.
  96. * @flag RFLAG_THREE|Return flag three.
  97. *
  98. * @print Doing second callback (just for fun.)
  99. *
  100. * @cb void | testAPISecondCallback | This is the second callback
  101. * for test function number one.
  102. *
  103. * @parm int | cbParmOne | Callback parameter number one. Specifies
  104. * the foobar value.
  105. *
  106. * @rdesc Returns one of the following flags:
  107. * @flag HELLO_THERE_FLAG|Used to make the entire windows system into
  108. * a gigantic "Hello World" program. One might view Windows that way
  109. * anyway!
  110. *
  111. * @comm Comment for callback number two.
  112. *
  113. */
  114. int foobar1() {
  115. printf("Hello there!\n");
  116. }
  117. /*
  118. * @doc EXTERNAL TEST
  119. *
  120. * @func WORD |
  121. * testWarpedProcedure
  122. * | Tests the parser with twisted expressions. This is a @func, as well.
  123. * @parm HWND |
  124. * hwnd |
  125. * Identifies the window. Has two flags!
  126. * @flag FLAG_ONE|Flag number one. Crunched fields.
  127. * @flag FLAG_TWO
  128. * |
  129. * This is Flag two's text description. Expanded fields.
  130. * @rdesc Returns the desired window word.
  131. * @flag RETURN_FLAG | Return flag for normal api call.
  132. * @comm Window word space must be initialized before use when the
  133. * class is declared.
  134. *
  135. * @cb int FAR PASCAL |
  136. * ResInit |
  137. * Callback giving the entry point into the DLL.
  138. *
  139. * @parm WORD | wParam | Word parameter.
  140. * @flag FOOFLAG | Callback wParam flag value.
  141. * @flag FOOFLAG2 | Callback second paramter flag.
  142. *
  143. * @rdesc Callback return description.
  144. *
  145. * @flag THISFLAG | Callback return flag desc.
  146. *
  147. * @comm Callback comment
  148. *
  149. * @api LPSTR | testSecondFuncInBlock | Second API call within the
  150. * same comment block declarations. Verify the @doc tag for this comment!
  151. * @rdesc This function does nothing but return "Hello there".
  152. * @comm Second api's comment.
  153. *
  154. */
  155. int foobar2() {
  156. printf("Hello there again!\n");
  157. }
  158. /*
  159. * @doc EXTERNAL TEST
  160. *
  161. * @print Testing ASM callback within normal API block.
  162. *
  163. * @api void | testAsmCallbackInApi | This function tests an ASM
  164. * callback within a normal API block.
  165. *
  166. * @parm int | iParamOne | Parameter one.
  167. *
  168. * @flag PARM_ONE_FLAG_ONE | First flag, parameter one.
  169. *
  170. * @parm long | lParamTwo | Parameter two.
  171. *
  172. * @rdesc API return description.
  173. *
  174. * @flag RTN_FLAG_ONE | First returned flag.
  175. *
  176. * @xref hello_there
  177. *
  178. * @asmcb AsmCallback | This is an assembler block callback within an
  179. * API description.
  180. *
  181. * @reg AX | First register.
  182. *
  183. * @flag AX_FLAG_ONE | Does this correctly allow flags?
  184. *
  185. * @reg BX | First register.
  186. *
  187. * @uses AX, BX, CX
  188. *
  189. * @rdesc Return codes from this function are as follows:
  190. *
  191. * @reg FLAGS | The following:
  192. *
  193. * @flag CARRY | If set, then foo is TRUE.
  194. *
  195. * @reg AX | Contains the AX return value.
  196. *
  197. * @reg BX | Contains the BX return value.
  198. *
  199. * @parm LPSTR | lpszFoobar | This should end up in the API parameter
  200. * list?
  201. *
  202. */
  203. /*
  204. * @doc EXTERNAL TEST
  205. *
  206. * @print Testing ASM block...
  207. *
  208. * @asm testAsmBlock | Fiddle a global selector
  209. * into something more palatable.
  210. *
  211. * @print Doing first register declaration...
  212. * @reg DX:AX | Contains the selector to be fiddled.
  213. *
  214. * @reg BX | Contains one of the following flags. This has three flags:
  215. * @flag FLAG1 | First flag in BX.
  216. * @flag FLAG2 | Second flag in BX.
  217. * @flag FLAG3 | Third flag in BX.
  218. *
  219. * @reg CX | Last register used by <f testAsmBlock>. One flag value.
  220. * @flag CX_FLAG_1 | The only possible value for CX.
  221. *
  222. * @comm This is the comment text.
  223. *
  224. * @print Doing return value, with flags...
  225. *
  226. * @xref testNormalApiBlock
  227. *
  228. * @rdesc The function success codes are returned.
  229. * @reg AX | Contains one of the following flags (four):
  230. * @flag RETFLAG_1 | What is behind door number one?
  231. * @flag RETFLAG_2 | Or is it door number two?
  232. * @flag RETFLAG_3 | Or perhaps door three?
  233. * @flag RETFLAG_4 | The suspense is really getting to me.
  234. *
  235. * @cb void | testCallbackASM | Callback function in the ASM block.
  236. * This is a parameterized callback.
  237. *
  238. * @parm HWND | hwnd | Parameter one to callback.
  239. * @parm WORD | wParam | Contains one of the following two flag
  240. * values:
  241. * @flag FLAG_ONE | The generic first flag.
  242. * @flag FLAG_TWO | Can't do without the Everpresent Flag Two.
  243. *
  244. * @rdesc Return description for the callback. This has no flags.
  245. * @comm Comment for <f testCallbackASM>.
  246. *
  247. */
  248. char foobar3() {
  249. printf("This is getting to be old hat.\n");
  250. }
  251. /*********
  252. *********
  253. ********* @doc EXTERNAL TEST
  254. ********* @api void | testMessedUpFuzzChars |
  255. This is a test description. It is indented alot, and has
  256. ********* lots of fuzz characters.
  257. ********************************************
  258. See if it comes out ok.
  259. *********
  260. *********/
  261. char foobar4() {
  262. }
  263. /*
  264. * @doc EXTERNAL TEST
  265. * @msg TEST_MESSAGE_BLOCK | This tests the message block type. It
  266. * has a number of paramters.
  267. *
  268. * @parm int | FirstParm | This parameter has no flags.
  269. * @parm int | SecondParm | This parameter may take the following
  270. * flags:
  271. * @flag F1_FIRST_FLAG | Specifies door number one. This flag should
  272. * have lots of paragraphs within its description.
  273. *
  274. * This is the second paragraph for flag number one.
  275. *
  276. * @flag F1_SECOND_FLAG | The second flag for parameter two.
  277. * @flag F1_THIRD_FLAG | This is the third valid flag value for
  278. * parameter two.
  279. *
  280. * @parm int | ThirdParm | Contains one of the following flag values:
  281. * @flag F2_FOOBAR | This flag currently ignored.
  282. *
  283. * @print Testing comments within text...
  284. * @flag F2_BARFOO | // If this line appears, then comments are broken.
  285. * The second flag. This line must appear, else embedded
  286. * comments are broken.
  287. *
  288. * @comm This is the comment text block's first paragraph. It is not
  289. * too long.
  290. *
  291. * The second paragraph begins with this sentence. This is a test of
  292. * the emergency broadcast system. In the event of an actual emergency,
  293. * the attention signal you just heard would have been followed by
  294. * information from the authorities.
  295. *
  296. * @rdesc This is the return description. It has three flags. The
  297. * paragraph of the return description can be as long as required, and
  298. * may include multiple paragraphs.
  299. *
  300. * This is the second paragraph for the return description.
  301. *
  302. * @flag RFLAG_ONE | Return flag number one.
  303. * @flag RFLAG_TWO | Return flag number two.
  304. * @flag RFLAG_THREE|Return flag three.
  305. *
  306. * @xref testAsmBlock,testWarpedProcedure testNormalApiBlock
  307. *
  308. */