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.

422 lines
27 KiB

  1. /****************************************************************************/
  2. /* ndcgdata.h */
  3. /* */
  4. /* Common include file for all data.c modules (Windows NT specific) */
  5. /* */
  6. /* Copyright(c) Microsoft 1996-1997. */
  7. /* */
  8. /* The macros in this file allow all aspects of data declaration to be kept */
  9. /* together. The behaviour of this file is controlled by #defines that can */
  10. /* be set prior to inclusion of this. */
  11. /* */
  12. /* - DC_INIT_DATA Set in XX_Init routines to do inline initialisation if*/
  13. /* required. */
  14. /* - DC_INCLUDE_DATA Set where a header file is included in order to get */
  15. /* external declarations. */
  16. /* - DC_DEFINE_DATA Set where a header file is included in order to get */
  17. /* definition without initialisation. */
  18. /* - DC_CONSTANT_DATA Set to get global initialisation of const data items */
  19. /* - (default) Gets data definition with initialisation. */
  20. /* */
  21. /****************************************************************************/
  22. /* */
  23. /* In order to allow for the flexibility required in different environments */
  24. /* (be that different OSs, C vs C++, or whatever) the structure of the file */
  25. /* is as follows. */
  26. /* */
  27. /* First there is an environment-specific mapping from the macros used in */
  28. /* the code to internal macros. This mapping also takes the above #defines */
  29. /* into consideration in performing this expansion. */
  30. /* */
  31. /* Secondly, the low-level macros that actually perform the expansion are */
  32. /* defined. These should be platform-independent. */
  33. /* */
  34. /* The intention of this structure is to avoid the confusions caused by the */
  35. /* old version where, for example, code compiled with DC_INIT_DATA */
  36. /* explicitly did NOT initialise the data. */
  37. /* */
  38. /****************************************************************************/
  39. /****************************************************************************/
  40. /* Clear any previous definitions of the macros. */
  41. /****************************************************************************/
  42. #undef DC_DATA
  43. #undef DC_DATA_NULL
  44. #undef DC_DATA_ARRAY
  45. #undef DC_DATA_ARRAY_NULL
  46. #undef DC_DATA_ARRAY_UNINIT
  47. #undef DC_DATA_ARRAY_SET
  48. #undef DC_DATA_2D_ARRAY
  49. #undef DC_CONST_DATA
  50. #undef DC_CONST_DATA_ARRAY
  51. #undef DC_CONST_DATA_2D_ARRAY
  52. #undef DCI_DATA
  53. #undef DCI_DATA_NULL
  54. #undef DCI_DATA_ARRAY
  55. #undef DCI_DATA_ARRAY_NULL
  56. #undef DCI_DATA_ARRAY_UNINIT
  57. #undef DCI_DATA_ARRAY_SET
  58. #undef DCI_DATA_2D_ARRAY
  59. #undef DCI_CONST_DATA
  60. #undef DCI_CONST_DATA_ARRAY
  61. #undef DCI_CONST_DATA_2D_ARRAY
  62. /****************************************************************************/
  63. /* Now define the main (external) macros. */
  64. /****************************************************************************/
  65. #define DC_DATA(A,B,C) DCI_DATA(A,B,C)
  66. #define DC_DATA_NULL(A,B,C) DCI_DATA_NULL(A,B,C)
  67. #define DC_DATA_ARRAY(A,B,C,D) DCI_DATA_ARRAY(A,B,C,D)
  68. #define DC_DATA_ARRAY_NULL(A,B,C,D) DCI_DATA_ARRAY_NULL(A,B,C,D)
  69. #define DC_DATA_ARRAY_UNINIT(A,B,C) DCI_DATA_ARRAY_UNINIT(A,B,C)
  70. #define DC_DATA_ARRAY_SET(A,B,C,D) DCI_DATA_ARRAY_SET(A,B,C,D)
  71. #define DC_DATA_2D_ARRAY(A,B,C,D,E) DCI_DATA_2D_ARRAY(A,B,C,D,E)
  72. #define DC_CONST_DATA(A,B,C) DCI_CONST_DATA(A,B,C)
  73. #define DC_CONST_DATA_ARRAY(A,B,C,D) DCI_CONST_DATA_ARRAY(A,B,C,D)
  74. #define DC_CONST_DATA_2D_ARRAY(A,B,C,D,E) DCI_CONST_DATA_2D_ARRAY(A,B,C,D,E)
  75. /****************************************************************************/
  76. /****************************************************************************/
  77. /* Now map to the target macros */
  78. /****************************************************************************/
  79. /****************************************************************************/
  80. #if defined(DC_INCLUDE_DATA)
  81. /****************************************************************************/
  82. /* External declarations */
  83. /****************************************************************************/
  84. #define DCI_DATA(TYPE, Name, VAL) \
  85. DCI_EXTERN_DATA(TYPE, Name, VAL)
  86. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  87. DCI_EXTERN_DATA_NULL(TYPE, Name, VAL)
  88. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  89. DCI_EXTERN_DATA_ARRAY(TYPE, Name, Size, VAL)
  90. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  91. DCI_EXTERN_DATA_ARRAY(TYPE, Name, Size, VAL)
  92. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  93. DCI_EXTERN_DATA_ARRAY(TYPE, Name, Size, 0)
  94. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  95. DCI_EXTERN_DATA_ARRAY(TYPE, Name, Size, VAL)
  96. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  97. DCI_EXTERN_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  98. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  99. DCI_EXTERN_CONST_DATA(TYPE, Name, VAL)
  100. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  101. DCI_EXTERN_CONST_DATA_ARRAY(TYPE, Name, Size, VAL)
  102. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  103. DCI_EXTERN_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  104. #elif defined(DC_INIT_DATA)
  105. /****************************************************************************/
  106. /* Inline initialisation */
  107. /****************************************************************************/
  108. #if defined(__cplusplus)
  109. #define DCI_DATA(TYPE, Name, VAL) \
  110. DCI_ASSIGN_DATA(TYPE, Name, VAL)
  111. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  112. DCI_SET_DATA_NULL(TYPE, Name, VAL)
  113. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  114. DCI_ASSIGN_DATA_ARRAY(TYPE, Name, Size, VAL)
  115. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  116. DCI_SET_DATA_ARRAY_NULL(TYPE, Name, Size, VAL)
  117. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  118. DCI_NO_DATA_ARRAY(TYPE, Name, Size, 0)
  119. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  120. DCI_SET_DATA_ARRAY_VAL(TYPE, Name, Size, VAL)
  121. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  122. DCI_ASSIGN_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  123. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  124. DCI_NO_DATA(TYPE, Name, VAL)
  125. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  126. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  127. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  128. DCI_NO_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  129. #else
  130. #define DCI_DATA(TYPE, Name, VAL) \
  131. DCI_NO_DATA(TYPE, Name, VAL)
  132. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  133. DCI_NO_DATA_NULL(TYPE, Name, VAL)
  134. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  135. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  136. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  137. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  138. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  139. DCI_NO_DATA_ARRAY(TYPE, Name, Size, 0)
  140. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  141. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  142. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  143. DCI_NO_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  144. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  145. DCI_NO_DATA(TYPE, Name, VAL)
  146. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  147. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  148. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  149. DCI_NO_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  150. #endif
  151. #elif defined(DC_DEFINE_DATA)
  152. /****************************************************************************/
  153. /* Definition but no initialisation */
  154. /****************************************************************************/
  155. #define DCI_DATA(TYPE, Name, VAL) \
  156. DCI_DEFINE_DATA(TYPE, Name, VAL)
  157. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  158. DCI_DEFINE_DATA_NULL(TYPE, Name, VAL)
  159. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  160. DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, VAL)
  161. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  162. DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, VAL)
  163. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  164. DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, NULL)
  165. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  166. DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, VAL)
  167. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  168. DCI_DEFINE_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  169. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  170. DCI_DEFINE_CONST_DATA(TYPE, Name, VAL)
  171. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  172. DCI_DEFINE_CONST_DATA_ARRAY(TYPE, Name, Size, VAL)
  173. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  174. DCI_DEFINE_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  175. #elif defined(DC_CONSTANT_DATA)
  176. /****************************************************************************/
  177. /* Definition but no initialisation */
  178. /****************************************************************************/
  179. #define DCI_DATA(TYPE, Name, VAL) \
  180. DCI_NO_DATA(TYPE, Name, VAL)
  181. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  182. DCI_NO_DATA_NULL(TYPE, Name, VAL)
  183. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  184. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  185. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  186. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  187. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  188. DCI_NO_DATA_ARRAY(TYPE, Name, Size, NULL)
  189. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  190. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  191. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  192. DCI_NO_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  193. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  194. DCI_INIT_CONST_DATA(TYPE, Name, VAL)
  195. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  196. DCI_INIT_CONST_DATA_ARRAY(TYPE, Name, Size, VAL)
  197. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  198. DCI_INIT_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  199. #else
  200. /****************************************************************************/
  201. /* Data definition and initialisation */
  202. /****************************************************************************/
  203. #define DCI_DATA(TYPE, Name, VAL) \
  204. DCI_INIT_DATA(TYPE, Name, VAL)
  205. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  206. DCI_INIT_DATA_NULL(TYPE, Name, VAL)
  207. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  208. DCI_INIT_DATA_ARRAY(TYPE, Name, Size, VAL)
  209. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  210. DCI_INIT_DATA_ARRAY(TYPE, Name, Size, VAL)
  211. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  212. DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, NULL)
  213. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  214. DCI_INIT_DATA_ARRAY(TYPE, Name, Size, VAL)
  215. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  216. DCI_INIT_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  217. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  218. DCI_INIT_CONST_DATA(TYPE, Name, VAL)
  219. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  220. DCI_INIT_CONST_DATA_ARRAY(TYPE, Name, Size, VAL)
  221. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  222. DCI_INIT_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  223. #endif
  224. /****************************************************************************/
  225. /****************************************************************************/
  226. /* Finally, the low-level macros required to do the real work. */
  227. /* */
  228. /* Avoid multiple inclusion of these. */
  229. /****************************************************************************/
  230. /****************************************************************************/
  231. #ifndef _H_NDCGDATA
  232. #define _H_NDCGDATA
  233. /****************************************************************************/
  234. /* Some utilities... */
  235. /****************************************************************************/
  236. #define DC_STRUCT1(a) {a}
  237. #define DC_STRUCT2(a,b) {a,b}
  238. #define DC_STRUCT3(a,b,c) {a,b,c}
  239. #define DC_STRUCT4(a,b,c,d) {a,b,c,d}
  240. #define DC_STRUCT5(a,b,c,d,e) {a,b,c,d,e}
  241. #define DC_STRUCT6(a,b,c,d,e,f) {a,b,c,d,e,f}
  242. #define DC_STRUCT7(a,b,c,d,e,f,g) {a,b,c,d,e,f,g}
  243. #define DC_STRUCT8(a,b,c,d,e,f,g,h) {a,b,c,d,e,f,g,h}
  244. #define DC_STRUCT9(a,b,c,d,e,f,g,h,i) {a,b,c,d,e,f,g,h,i}
  245. #define DC_STRUCT10(a,b,c,d,e,f,g,h,i,j) {a,b,c,d,e,f,g,h,i,j}
  246. #define DC_STRUCT11(a,b,c,d,e,f,g,h,i,j,k) {a,b,c,d,e,f,g,h,i,j,k}
  247. #define DC_STRUCT12(a,b,c,d,e,f,g,h,i,j,k,l) {a,b,c,d,e,f,g,h,i,j,k,l}
  248. #define DC_STRUCT13(a,b,c,d,e,f,g,h,i,j,k,l,m) \
  249. {a,b,c,d,e,f,g,h,i,j,k,l,m}
  250. #define DC_STRUCT14(a,b,c,d,e,f,g,h,i,j,k,l,m,n) \
  251. {a,b,c,d,e,f,g,h,i,j,k,l,m,n}
  252. #define DC_STRUCT15(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) \
  253. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}
  254. #define DC_STRUCT16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
  255. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}
  256. #define DC_STRUCT17(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) \
  257. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}
  258. #define DC_STRUCT18(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) \
  259. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r}
  260. #define DC_STRUCT19(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s) \
  261. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s}
  262. #define DC_STRUCT20(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) \
  263. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}
  264. #define DC_STRUCT21(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) \
  265. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}
  266. #define DC_STRUCT22(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v) \
  267. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v}
  268. #define DC_STRUCT23(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w) \
  269. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w}
  270. #define DC_STRUCT24(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) \
  271. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}
  272. #define DC_STRUCT25(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) \
  273. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}
  274. #define DC_STRUCT26(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) \
  275. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
  276. #define DC_STRUCT27(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa) \
  277. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa}
  278. #define DC_STRUCT28(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb) \
  279. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb}
  280. #define DC_STRUCT29(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc) \
  281. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc}
  282. #define DC_STRUCT30(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  283. aa,bb,cc,dd) \
  284. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  285. aa,bb,cc,dd}
  286. #define DC_STRUCT31(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  287. aa,bb,cc,dd,ee) \
  288. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  289. aa,bb,cc,dd,ee}
  290. #define DC_STRUCT32(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  291. aa,bb,cc,dd,ee,ff) \
  292. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  293. aa,bb,cc,dd,ee,ff}
  294. #define DC_STRUCT33(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  295. aa,bb,cc,dd,ee,ff,gg) \
  296. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  297. aa,bb,cc,dd,ee,ff,gg}
  298. #define DC_STRUCT34(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  299. aa,bb,cc,dd,ee,ff,gg,hh) \
  300. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  301. aa,bb,cc,dd,ee,ff,gg,hh}
  302. #define DC_STRUCT35(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa, \
  303. bb,cc,dd,ee,ff,gg,hh,ii) \
  304. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  305. aa,bb,cc,dd,ee,ff,gg,hh,ii}
  306. #define DC_STRUCT36(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa, \
  307. bb,cc,dd,ee,ff,gg,hh,ii,jj) \
  308. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  309. aa,bb,cc,dd,ee,ff,gg,hh,ii,jj}
  310. #define DC_STRUCT37(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa, \
  311. bb,cc,dd,ee,ff,gg,hh,ii,jj,kk) \
  312. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  313. aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk}
  314. #define DC_STRUCT38(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa, \
  315. bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll) \
  316. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  317. aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll}
  318. #define DC_STRUCT46(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa, \
  319. bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,PP,QQ,RR,SS,TT) \
  320. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  321. aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,PP,QQ,RR,SS,TT}
  322. #define DC_STRUCT64(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa, \
  323. bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo, \
  324. pp,qq,rr,ss,tt,uu,vv,ww,xx,yy,zz,ab,ac,ad,ae, \
  325. af,ag,ah,ai,aj,ak,al,am) \
  326. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, \
  327. aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo, \
  328. pp,qq,rr,ss,tt,uu,vv,ww,xx,yy,zz,ab,ac,ad,ae, \
  329. af,ag,ah,ai,aj,ak,al,am}
  330. /****************************************************************************/
  331. /* The extern declarations macros... */
  332. /****************************************************************************/
  333. #define DCI_EXTERN_DATA(TYPE, Name, VAL) extern TYPE Name
  334. #define DCI_EXTERN_DATA_NULL(TYPE, Name, VAL) extern TYPE Name
  335. #define DCI_EXTERN_DATA_ARRAY(TYPE, Name, Size, VAL) extern TYPE Name[Size]
  336. #define DCI_EXTERN_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  337. extern TYPE Name[Size1][Size2]
  338. #define DCI_EXTERN_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  339. extern const TYPE Name[Size]
  340. #define DCI_EXTERN_CONST_DATA(TYPE, Name, VAL) extern const TYPE Name
  341. #define DCI_EXTERN_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  342. extern const TYPE Name[Size1][Size2]
  343. /****************************************************************************/
  344. /* The no-op macros... */
  345. /****************************************************************************/
  346. #define DCI_NO_DATA(TYPE, Name, VAL)
  347. #define DCI_NO_DATA_NULL(TYPE, Name, VAL)
  348. #define DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  349. #define DCI_NO_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  350. /****************************************************************************/
  351. /* The declaration macros... */
  352. /****************************************************************************/
  353. #define DCI_DEFINE_DATA(TYPE, Name, VAL) TYPE Name
  354. #define DCI_DEFINE_DATA_NULL(TYPE, Name, VAL) TYPE Name
  355. #define DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, VAL) TYPE Name[Size]
  356. #define DCI_DEFINE_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  357. TYPE Name[Size1][Size2]
  358. #define DCI_DEFINE_CONST_DATA(TYPE, Name, VAL) static const TYPE Name
  359. #define DCI_DEFINE_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  360. static const TYPE Name[Size]
  361. #define DCI_DEFINE_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  362. static const TYPE Name[Size1][Size2]
  363. /****************************************************************************/
  364. /* The define-and-assign macros... */
  365. /****************************************************************************/
  366. #define DCI_INIT_DATA(TYPE, Name, VAL) TYPE Name = VAL
  367. #define DCI_INIT_DATA_NULL(TYPE, Name, VAL) TYPE Name = VAL
  368. #define DCI_INIT_DATA_ARRAY(TYPE, Name, Size, VAL) TYPE Name[Size] = { VAL }
  369. #define DCI_INIT_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  370. TYPE Name[Size1][Size2] = { VAL }
  371. /****************************************************************************/
  372. /* The vanilla C version */
  373. /****************************************************************************/
  374. #define DCI_INIT_CONST_DATA(TYPE, Name, VAL) const TYPE SHCLASS Name = VAL
  375. #define DCI_INIT_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  376. const TYPE SHCLASS Name[Size] = VAL
  377. #define DCI_INIT_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  378. const TYPE SHCLASS Name[Size1][Size2] = VAL
  379. /****************************************************************************/
  380. /* The procedural code initialisation macros... */
  381. /****************************************************************************/
  382. #define DCI_ASSIGN_DATA(TYPE, Name, VAL) Name = VAL
  383. #define DCI_ASSIGN_DATA_NULL(TYPE, Name, VAL) Error!
  384. #define DCI_ASSIGN_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) Error!
  385. #define DCI_ASSIGN_DATA_ARRAY(TYPE, Name, Size, VAL) Error!
  386. #define DCI_ASSIGN_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) Error!
  387. /****************************************************************************/
  388. /* The mem-cpy and -set initialisation macros... */
  389. /****************************************************************************/
  390. #define DCI_SET_DATA_NULL(TYPE, Name, VAL) memset(&Name, 0, sizeof(TYPE))
  391. #define DCI_SET_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  392. memset(&Name, 0, Size*sizeof(TYPE))
  393. #define DCI_SET_DATA_ARRAY_VAL(TYPE, Name, Size, VAL) \
  394. memset(&Name, VAL, Size*sizeof(TYPE))
  395. #endif /*H_NDCGDATA*/