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.

149 lines
4.7 KiB

  1. ### vadimg: this AWK script constructs an APIMON-style API table
  2. ### from the input generated by winapi.awk.
  3. BEGIN {
  4. }
  5. {
  6. if ($2 == "HWND") {
  7. szRet = "T_HWND";
  8. } else if ($2 == "LPSTR" || $2 == "LPCSTR") {
  9. szRet = "T_LPSTR";
  10. } else if ($2 == "LPWSTR" || $2 == "LPCWSTR") {
  11. szRet = "T_LPWSTR";
  12. } else if ($2 == "HACCEL") {
  13. szRet = "T_HACCEL";
  14. } else if ($2 == "HANDLE") {
  15. szRet = "T_HANDLE";
  16. } else if ($2 == "HBITMAP") {
  17. szRet = "T_HBITMAP";
  18. } else if ($2 == "HBRUSH") {
  19. szRet = "T_HBRUSH";
  20. } else if ($2 == "HCURSOR") {
  21. szRet = "T_HCURSOR";
  22. } else if ($2 == "HDC") {
  23. szRet = "T_HDC";
  24. } else if ($2 == "HDCLPPOINT") {
  25. szRet = "T_HDCLPPOINT";
  26. } else if ($2 == "HDESK") {
  27. szRet = "T_HDESK";
  28. } else if ($2 == "HDWP") {
  29. szRet = "T_HDWP";
  30. } else if ($2 == "HENHMETAFILE") {
  31. szRet = "T_HENHMETAFILE";
  32. } else if ($2 == "HFONT") {
  33. szRet = "T_HFONT";
  34. } else if ($2 == "HGDIOBJ") {
  35. szRet = "T_HGDIOBJ";
  36. } else if ($2 == "HGLOBAL") {
  37. szRet = "T_HGLOBAL";
  38. } else if ($2 == "HGLRC") {
  39. szRet = "T_HGLRC";
  40. } else if ($2 == "HHOOK") {
  41. szRet = "T_HHOOK";
  42. } else if ($2 == "HICON") {
  43. szRet = "T_HICON";
  44. } else if ($2 == "HINSTANCE") {
  45. szRet = "T_HINSTANCE";
  46. } else if ($2 == "HKL") {
  47. szRet = "T_HKL";
  48. } else if ($2 == "HMENU") {
  49. szRet = "T_HMENU";
  50. } else if ($2 == "HMETAFILE") {
  51. szRet = "T_HMETAFILE";
  52. } else if ($2 == "HPALETTE") {
  53. szRet = "T_HPALETTE";
  54. } else if ($2 == "HPEN") {
  55. szRet = "T_HPEN";
  56. } else if ($2 == "HRGN") {
  57. szRet = "T_HRGN";
  58. } else if ($2 == "HWINSTA") {
  59. szRet = "T_HWINSTA";
  60. } else if ($2 == "HWND") {
  61. szRet = "T_HWND";
  62. } else {
  63. szRet = "T_DWORD";
  64. }
  65. printf "{ \"%s\", %s", $1, szRet;
  66. nArgs = NF - 2;
  67. if (nArgs > 8) {
  68. nArgs = 8;
  69. }
  70. if (nArgs > 0) {
  71. printf ", %d, {", nArgs;
  72. for (i = 3; i <= 10 && i <= NF; i++) {
  73. szSpace = ", ";
  74. szToken = "";
  75. if (i == 3) {
  76. szSpace = "";
  77. }
  78. if ($i == "HWND") {
  79. szToken = "T_HWND";
  80. } else if ($i == "LPSTR" || $i == "LPCSTR") {
  81. szToken = "T_LPSTR";
  82. } else if ($i == "LPWSTR" || $i == "LPCWSTR") {
  83. szToken = "T_LPWSTR";
  84. } else if ($i == "HACCEL") {
  85. szToken = "T_HACCEL";
  86. } else if ($i == "HANDLE") {
  87. szToken = "T_HANDLE";
  88. } else if ($i == "HBITMAP") {
  89. szToken = "T_HBITMAP";
  90. } else if ($i == "HBRUSH") {
  91. szToken = "T_HBRUSH";
  92. } else if ($i == "HCURSOR") {
  93. szToken = "T_HCURSOR";
  94. } else if ($i == "HDC") {
  95. szToken = "T_HDC";
  96. } else if ($i == "HDCLPPOINT") {
  97. szToken = "T_HDCLPPOINT";
  98. } else if ($i == "HDESK") {
  99. szToken = "T_HDESK";
  100. } else if ($i == "HDWP") {
  101. szToken = "T_HDWP";
  102. } else if ($i == "HENHMETAFILE") {
  103. szToken = "T_HENHMETAFILE";
  104. } else if ($i == "HFONT") {
  105. szToken = "T_HFONT";
  106. } else if ($i == "HGDIOBJ") {
  107. szToken = "T_HGDIOBJ";
  108. } else if ($i == "HGLOBAL") {
  109. szToken = "T_HGLOBAL";
  110. } else if ($i == "HGLRC") {
  111. szToken = "T_HGLRC";
  112. } else if ($i == "HHOOK") {
  113. szToken = "T_HHOOK";
  114. } else if ($i == "HICON") {
  115. szToken = "T_HICON";
  116. } else if ($i == "HINSTANCE") {
  117. szToken = "T_HINSTANCE";
  118. } else if ($i == "HKL") {
  119. szToken = "T_HKL";
  120. } else if ($i == "HMENU") {
  121. szToken = "T_HMENU";
  122. } else if ($i == "HMETAFILE") {
  123. szToken = "T_HMETAFILE";
  124. } else if ($i == "HPALETTE") {
  125. szToken = "T_HPALETTE";
  126. } else if ($i == "HPEN") {
  127. szToken = "T_HPEN";
  128. } else if ($i == "HRGN") {
  129. szToken = "T_HRGN";
  130. } else if ($i == "HWINSTA") {
  131. szToken = "T_HWINSTA";
  132. } else if ($i == "HWND") {
  133. szToken = "T_HWND";
  134. } else {
  135. szToken = "T_DWORD";
  136. }
  137. printf "%s%s", szSpace, szToken;
  138. }
  139. printf "} },\n"
  140. }
  141. ### printf ", 0, },\n";
  142. }