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.

426 lines
26 KiB

  1. /**INC+**********************************************************************/
  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. /* Changes: */
  40. /* */
  41. // $Log: Y:/logs/h/dcl/ndcgdata.h_v $
  42. //
  43. // Rev 1.4 14 Aug 1997 15:28:32 TH
  44. // SFR1133: Added STRUCT25
  45. //
  46. // Rev 1.3 29 Jul 1997 14:43:26 AK
  47. // SFR1033: Add DC_STRUCT30
  48. //
  49. // Rev 1.2 23 Jul 1997 10:48:00 mr
  50. // SFR1079: Merged \server\h duplicates to \h\dcl
  51. //
  52. // Rev 1.1 19 Jun 1997 21:53:00 OBK
  53. // SFR0000: Start of RNS codebase
  54. /* */
  55. /**INC-**********************************************************************/
  56. /****************************************************************************/
  57. /* Clear any previous definitions of the macros. */
  58. /****************************************************************************/
  59. #undef DC_DATA
  60. #undef DC_DATA_NULL
  61. #undef DC_DATA_ARRAY
  62. #undef DC_DATA_ARRAY_NULL
  63. #undef DC_DATA_ARRAY_UNINIT
  64. #undef DC_DATA_ARRAY_SET
  65. #undef DC_DATA_2D_ARRAY
  66. #undef DC_CONST_DATA
  67. #undef DC_CONST_DATA_ARRAY
  68. #undef DC_CONST_DATA_2D_ARRAY
  69. #undef DCI_DATA
  70. #undef DCI_DATA_NULL
  71. #undef DCI_DATA_ARRAY
  72. #undef DCI_DATA_ARRAY_NULL
  73. #undef DCI_DATA_ARRAY_UNINIT
  74. #undef DCI_DATA_ARRAY_SET
  75. #undef DCI_DATA_2D_ARRAY
  76. #undef DCI_CONST_DATA
  77. #undef DCI_CONST_DATA_ARRAY
  78. #undef DCI_CONST_DATA_2D_ARRAY
  79. /****************************************************************************/
  80. /* Now define the main (external) macros. */
  81. /****************************************************************************/
  82. #define DC_DATA(A,B,C) DCI_DATA(A,B,C)
  83. #define DC_DATA_NULL(A,B,C) DCI_DATA_NULL(A,B,C)
  84. #define DC_DATA_ARRAY(A,B,C,D) DCI_DATA_ARRAY(A,B,C,D)
  85. #define DC_DATA_ARRAY_NULL(A,B,C,D) DCI_DATA_ARRAY_NULL(A,B,C,D)
  86. #define DC_DATA_ARRAY_UNINIT(A,B,C) DCI_DATA_ARRAY_UNINIT(A,B,C)
  87. #define DC_DATA_ARRAY_SET(A,B,C,D) DCI_DATA_ARRAY_SET(A,B,C,D)
  88. #define DC_DATA_2D_ARRAY(A,B,C,D,E) DCI_DATA_2D_ARRAY(A,B,C,D,E)
  89. #define DC_CONST_DATA(A,B,C) DCI_CONST_DATA(A,B,C)
  90. #define DC_CONST_DATA_ARRAY(A,B,C,D) DCI_CONST_DATA_ARRAY(A,B,C,D)
  91. #define DC_CONST_DATA_2D_ARRAY(A,B,C,D,E) DCI_CONST_DATA_2D_ARRAY(A,B,C,D,E)
  92. /****************************************************************************/
  93. /****************************************************************************/
  94. /* Now map to the target macros */
  95. /****************************************************************************/
  96. /****************************************************************************/
  97. #if defined(DC_INCLUDE_DATA)
  98. /****************************************************************************/
  99. /* External declarations */
  100. /****************************************************************************/
  101. #define DCI_DATA(TYPE, Name, VAL) \
  102. DCI_EXTERN_DATA(TYPE, Name, VAL)
  103. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  104. DCI_EXTERN_DATA_NULL(TYPE, Name, VAL)
  105. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  106. DCI_EXTERN_DATA_ARRAY(TYPE, Name, Size, VAL)
  107. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  108. DCI_EXTERN_DATA_ARRAY(TYPE, Name, Size, VAL)
  109. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  110. DCI_EXTERN_DATA_ARRAY(TYPE, Name, Size, 0)
  111. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  112. DCI_EXTERN_DATA_ARRAY(TYPE, Name, Size, VAL)
  113. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  114. DCI_EXTERN_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  115. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  116. DCI_EXTERN_CONST_DATA(TYPE, Name, VAL)
  117. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  118. DCI_EXTERN_CONST_DATA_ARRAY(TYPE, Name, Size, VAL)
  119. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  120. DCI_EXTERN_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  121. #elif defined(DC_INIT_DATA)
  122. /****************************************************************************/
  123. /* Inline initialisation */
  124. /****************************************************************************/
  125. #if defined(VER_CPP) && defined(DC_IN_CLASS)
  126. #define DCI_DATA(TYPE, Name, VAL) \
  127. DCI_ASSIGN_DATA(TYPE, Name, VAL)
  128. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  129. DCI_SET_DATA_NULL(TYPE, Name, VAL)
  130. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  131. DCI_ASSIGN_DATA_ARRAY(TYPE, Name, Size, VAL)
  132. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  133. DCI_SET_DATA_ARRAY_NULL(TYPE, Name, Size, VAL)
  134. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  135. DCI_SET_DATA_ARRAY_NULL(TYPE, Name, Size, 0)
  136. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  137. DCI_SET_DATA_ARRAY_VAL(TYPE, Name, Size, VAL)
  138. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  139. DCI_ASSIGN_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  140. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  141. DCI_NO_DATA(TYPE, Name, VAL)
  142. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  143. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  144. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  145. DCI_NO_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  146. #else
  147. #define DCI_DATA(TYPE, Name, VAL) \
  148. DCI_NO_DATA(TYPE, Name, VAL)
  149. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  150. DCI_NO_DATA_NULL(TYPE, Name, VAL)
  151. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  152. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  153. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  154. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  155. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  156. DCI_NO_DATA_ARRAY(TYPE, Name, Size, 0)
  157. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  158. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  159. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  160. DCI_NO_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  161. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  162. DCI_NO_DATA(TYPE, Name, VAL)
  163. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  164. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  165. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  166. DCI_NO_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  167. #endif
  168. #elif defined(DC_DEFINE_DATA)
  169. /****************************************************************************/
  170. /* Definition but no initialisation */
  171. /****************************************************************************/
  172. #define DCI_DATA(TYPE, Name, VAL) \
  173. DCI_DEFINE_DATA(TYPE, Name, VAL)
  174. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  175. DCI_DEFINE_DATA_NULL(TYPE, Name, VAL)
  176. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  177. DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, VAL)
  178. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  179. DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, VAL)
  180. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  181. DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, NULL)
  182. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  183. DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, VAL)
  184. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  185. DCI_DEFINE_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  186. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  187. DCI_DEFINE_CONST_DATA(TYPE, Name, VAL)
  188. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  189. DCI_DEFINE_CONST_DATA_ARRAY(TYPE, Name, Size, VAL)
  190. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  191. DCI_DEFINE_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  192. #elif defined(DC_CONSTANT_DATA)
  193. /****************************************************************************/
  194. /* Definition but no initialisation */
  195. /****************************************************************************/
  196. #define DCI_DATA(TYPE, Name, VAL) \
  197. DCI_NO_DATA(TYPE, Name, VAL)
  198. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  199. DCI_NO_DATA_NULL(TYPE, Name, VAL)
  200. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  201. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  202. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  203. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  204. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  205. DCI_NO_DATA_ARRAY(TYPE, Name, Size, NULL)
  206. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  207. DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  208. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  209. DCI_NO_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  210. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  211. DCI_INIT_CONST_DATA(TYPE, Name, VAL)
  212. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  213. DCI_INIT_CONST_DATA_ARRAY(TYPE, Name, Size, VAL)
  214. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  215. DCI_INIT_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  216. #else
  217. /****************************************************************************/
  218. /* Data definition and initialisation */
  219. /****************************************************************************/
  220. #define DCI_DATA(TYPE, Name, VAL) \
  221. DCI_INIT_DATA(TYPE, Name, VAL)
  222. #define DCI_DATA_NULL(TYPE, Name, VAL) \
  223. DCI_INIT_DATA_NULL(TYPE, Name, VAL)
  224. #define DCI_DATA_ARRAY(TYPE, Name, Size, VAL) \
  225. DCI_INIT_DATA_ARRAY(TYPE, Name, Size, VAL)
  226. #define DCI_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  227. DCI_INIT_DATA_ARRAY(TYPE, Name, Size, VAL)
  228. #define DCI_DATA_ARRAY_UNINIT(TYPE, Name, Size) \
  229. DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, NULL)
  230. #define DCI_DATA_ARRAY_SET(TYPE, Name, Size, VAL) \
  231. DCI_INIT_DATA_ARRAY(TYPE, Name, Size, VAL)
  232. #define DCI_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  233. DCI_INIT_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  234. #define DCI_CONST_DATA(TYPE, Name, VAL) \
  235. DCI_INIT_CONST_DATA(TYPE, Name, VAL)
  236. #define DCI_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  237. DCI_INIT_CONST_DATA_ARRAY(TYPE, Name, Size, VAL)
  238. #define DCI_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  239. DCI_INIT_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  240. #endif
  241. /****************************************************************************/
  242. /****************************************************************************/
  243. /* Finally, the low-level macros required to do the real work. */
  244. /* */
  245. /* Avoid multiple inclusion of these. */
  246. /****************************************************************************/
  247. /****************************************************************************/
  248. #ifndef _H_NDCGDATA
  249. #define _H_NDCGDATA
  250. /****************************************************************************/
  251. /* Some utilities... */
  252. /****************************************************************************/
  253. #define DC_STRUCT1(a) {a}
  254. #define DC_STRUCT2(a,b) {a,b}
  255. #define DC_STRUCT3(a,b,c) {a,b,c}
  256. #define DC_STRUCT4(a,b,c,d) {a,b,c,d}
  257. #define DC_STRUCT5(a,b,c,d,e) {a,b,c,d,e}
  258. #define DC_STRUCT6(a,b,c,d,e,f) {a,b,c,d,e,f}
  259. #define DC_STRUCT7(a,b,c,d,e,f,g) {a,b,c,d,e,f,g}
  260. #define DC_STRUCT8(a,b,c,d,e,f,g,h) {a,b,c,d,e,f,g,h}
  261. #define DC_STRUCT9(a,b,c,d,e,f,g,h,i) {a,b,c,d,e,f,g,h,i}
  262. #define DC_STRUCT10(a,b,c,d,e,f,g,h,i,j) {a,b,c,d,e,f,g,h,i,j}
  263. #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}
  264. #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}
  265. #define DC_STRUCT13(a,b,c,d,e,f,g,h,i,j,k,l,m) \
  266. {a,b,c,d,e,f,g,h,i,j,k,l,m}
  267. #define DC_STRUCT14(a,b,c,d,e,f,g,h,i,j,k,l,m,n) \
  268. {a,b,c,d,e,f,g,h,i,j,k,l,m,n}
  269. #define DC_STRUCT15(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) \
  270. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}
  271. #define DC_STRUCT16(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
  272. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}
  273. #define DC_STRUCT17(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) \
  274. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}
  275. #define DC_STRUCT18(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) \
  276. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r}
  277. #define DC_STRUCT19(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s) \
  278. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s}
  279. #define DC_STRUCT20(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) \
  280. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t}
  281. #define DC_STRUCT21(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) \
  282. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}
  283. #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) \
  284. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v}
  285. #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) \
  286. {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w}
  287. #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) \
  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}
  289. #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) \
  290. {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}
  291. #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) \
  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,aa}
  293. #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, \
  294. aa,bb,cc,dd) \
  295. {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, \
  296. aa,bb,cc,dd}
  297. #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, \
  298. aa,bb,cc,dd,ee) \
  299. {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, \
  300. aa,bb,cc,dd,ee}
  301. #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, \
  302. aa,bb,cc,dd,ee,ff) \
  303. {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, \
  304. aa,bb,cc,dd,ee,ff}
  305. #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, \
  306. bb,cc,dd,ee,ff,gg,hh,ii) \
  307. {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, \
  308. aa,bb,cc,dd,ee,ff,gg,hh,ii}
  309. #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, \
  310. bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,PP,QQ,RR,SS,TT) \
  311. {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, \
  312. aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,PP,QQ,RR,SS,TT}
  313. #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, \
  314. bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo, \
  315. pp,qq,rr,ss,tt,uu,vv,ww,xx,yy,zz,ab,ac,ad,ae, \
  316. af,ag,ah,ai,aj,ak,al,am) \
  317. {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, \
  318. aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo, \
  319. pp,qq,rr,ss,tt,uu,vv,ww,xx,yy,zz,ab,ac,ad,ae, \
  320. af,ag,ah,ai,aj,ak,al,am}
  321. /****************************************************************************/
  322. /* The extern declarations macros... */
  323. /****************************************************************************/
  324. #define DCI_EXTERN_DATA(TYPE, Name, VAL) extern TYPE Name
  325. #define DCI_EXTERN_DATA_NULL(TYPE, Name, VAL) extern TYPE Name
  326. #define DCI_EXTERN_DATA_ARRAY(TYPE, Name, Size, VAL) extern TYPE Name[Size]
  327. #define DCI_EXTERN_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  328. extern TYPE Name[Size1][Size2]
  329. #define DCI_EXTERN_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  330. extern const TYPE Name[Size]
  331. #define DCI_EXTERN_CONST_DATA(TYPE, Name, VAL) extern const TYPE Name
  332. #define DCI_EXTERN_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  333. extern const TYPE Name[Size1][Size2]
  334. /****************************************************************************/
  335. /* The no-op macros... */
  336. /****************************************************************************/
  337. #define DCI_NO_DATA(TYPE, Name, VAL)
  338. #define DCI_NO_DATA_NULL(TYPE, Name, VAL)
  339. #define DCI_NO_DATA_ARRAY(TYPE, Name, Size, VAL)
  340. #define DCI_NO_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL)
  341. /****************************************************************************/
  342. /* The declaration macros... */
  343. /****************************************************************************/
  344. #define DCI_DEFINE_DATA(TYPE, Name, VAL) TYPE Name
  345. #define DCI_DEFINE_DATA_NULL(TYPE, Name, VAL) TYPE Name
  346. #define DCI_DEFINE_DATA_ARRAY(TYPE, Name, Size, VAL) TYPE Name[Size]
  347. #define DCI_DEFINE_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  348. TYPE Name[Size1][Size2]
  349. #define DCI_DEFINE_CONST_DATA(TYPE, Name, VAL) static const TYPE Name
  350. #define DCI_DEFINE_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  351. static const TYPE Name[Size]
  352. #define DCI_DEFINE_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  353. static const TYPE Name[Size1][Size2]
  354. /****************************************************************************/
  355. /* The define-and-assign macros... */
  356. /****************************************************************************/
  357. #define DCI_INIT_DATA(TYPE, Name, VAL) TYPE Name = VAL
  358. #define DCI_INIT_DATA_NULL(TYPE, Name, VAL) TYPE Name = VAL
  359. #define DCI_INIT_DATA_ARRAY(TYPE, Name, Size, VAL) TYPE Name[Size] = { VAL }
  360. #define DCI_INIT_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  361. TYPE Name[Size1][Size2] = { VAL }
  362. #if defined(VER_CPP) && !defined(DC_IN_CLASS)
  363. /****************************************************************************/
  364. /* The version for App Serving files outside of the class. */
  365. /****************************************************************************/
  366. #define DCI_INIT_CONST_DATA(TYPE, Name, VAL) \
  367. extern const TYPE SHCLASS Name = VAL
  368. #define DCI_INIT_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  369. extern const TYPE SHCLASS Name[Size] = VAL
  370. #define DCI_INIT_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  371. extern const TYPE SHCLASS Name[Size1][Size2] = VAL
  372. #else /* ! VER_CPP */
  373. /****************************************************************************/
  374. /* The vanilla C version */
  375. /****************************************************************************/
  376. #define DCI_INIT_CONST_DATA(TYPE, Name, VAL) const TYPE SHCLASS Name = VAL
  377. #define DCI_INIT_CONST_DATA_ARRAY(TYPE, Name, Size, VAL) \
  378. const TYPE SHCLASS Name[Size] = VAL
  379. #define DCI_INIT_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) \
  380. const TYPE SHCLASS Name[Size1][Size2] = VAL
  381. #endif /* VER_CPP */
  382. /****************************************************************************/
  383. /* The procedural code initialisation macros... */
  384. /****************************************************************************/
  385. #define DCI_ASSIGN_DATA(TYPE, Name, VAL) Name = VAL
  386. #define DCI_ASSIGN_DATA_NULL(TYPE, Name, VAL) Error!
  387. #define DCI_ASSIGN_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) Error!
  388. #define DCI_ASSIGN_DATA_ARRAY(TYPE, Name, Size, VAL) Error!
  389. #define DCI_ASSIGN_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, VAL) Error!
  390. /****************************************************************************/
  391. /* The mem-cpy and -set initialisation macros... */
  392. /****************************************************************************/
  393. #define DCI_SET_DATA_NULL(TYPE, Name, VAL) DC_MEMSET(&Name, 0, sizeof(TYPE))
  394. #define DCI_SET_DATA_ARRAY_NULL(TYPE, Name, Size, VAL) \
  395. DC_MEMSET(&Name, 0, Size*sizeof(TYPE))
  396. #define DCI_SET_DATA_ARRAY_VAL(TYPE, Name, Size, VAL) \
  397. DC_MEMSET(&Name, VAL, Size*sizeof(TYPE))
  398. #endif /*H_NDCGDATA*/