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.

203 lines
11 KiB

  1. /* ************************************************************************ */
  2. /* * DTI header file Created by AVP 3-94. Modified 9-94 * */
  3. /* ************************************************************************ */
  4. #ifndef TRIADS_H_INCLUDED
  5. #define TRIADS_H_INCLUDED
  6. #include "ams_mg.h"
  7. /* -------------------------- Defines for Triads ----------------------------- */
  8. #define TR_NUMSYMBOLS 40
  9. #define TR_OBJTYPE "Tr#3" /* Object type of current TR */
  10. #define TR_LANG "Eng." /* Object type of current TR */
  11. #define TR_VER "1.00" /* Object type of current TR */
  12. #define TR_ID_LEN 4 /* Length of ID string in TR */
  13. #define TR_FNAME_LEN 128 /* Pathname of dti len */
  14. #define TR_NUMINBYTE 4 /* Number of triad values in one byte */
  15. #define TR_GETVALUE(ptrd, a, b, c) (((*(ptrd))[(a)][(b)][(c)/4] >> (((c)%4)*2)) & 0x03) /* Get freq value from triads */
  16. #ifdef FOR_GERMAN
  17. #define DEF_TRIADS_MAPPING \
  18. { \
  19. /* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  20. /* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  21. /* 2 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  22. /* 3 */ 0, 0, 1, 0, 0, 0, 0, 0, 0, 40, \
  23. /* 4 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  24. /* 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  25. /* 6 */ 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, \
  26. /* 7 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
  27. /* 8 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, \
  28. /* 9 */ 27, 0, 0, 0, 0, 0, 0, 2, 3, 4, \
  29. /* 10 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, \
  30. /* 11 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, \
  31. /* 12 */ 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, \
  32. /* 13 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  33. /* 14 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  34. /* 15 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  35. /* 16 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  36. /* 17 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  37. /* 18 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  38. /* 19 */ 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, \
  39. /* 20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  40. /* 21 */ 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, \
  41. /* 22 */ 31, 0, 0, 32, 0, 0, 0, 0, 29, 0, \
  42. /* 23 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  43. /* 24 */ 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, \
  44. /* 25 */ 0, 0, 31, 0, 0, 0 \
  45. }
  46. #elif defined(FOR_SWED)
  47. #error Check coding -- it is MAC now!
  48. #define DEF_TRIADS_MAPPING \
  49. { \
  50. /* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  51. /* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  52. /* 2 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  53. /* 3 */ 0, 0, 1, 0, 0, 0, 0, 0, 0, 40, \
  54. /* 4 */ 0, 0, 0, 0, 0, 0, 99, 99, 0, 0, \
  55. /* 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  56. /* 6 */ 0, 0, 0, 0, 99, 2, 3, 4, 5, 6, \
  57. /* 7 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
  58. /* 8 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, \
  59. /* 9 */ 27, 0, 99, 0, 0, 0, 0, 2, 3, 4, \
  60. /* 10 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, \
  61. /* 11 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, \
  62. /* 12 */ 25, 26, 27, 0, 0, 0, 0, 0, 29, 28, \
  63. /* 13 */ 30, 31, 15, 33, 34, 2, 29, 35, 29, 2, \
  64. /* 14 */ 28, 30, 31, 36, 37, 6, 10, 10, 38, 32, \
  65. /* 15 */ 15, 16, 16, 33, 33, 16, 22, 34, 39, 34, \
  66. /* 16 */ 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, \
  67. /* 17 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  68. /* 18 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  69. /* 19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  70. /* 20 */ 0, 0, 0, 29, 2, 16, 0, 0, 0, 0, \
  71. /* 21 */ 0, 0, 0, 0, 0, 0, 26, 26, 0, 0, \
  72. /* 22 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, \
  73. /* 23 */ 37, 2, 6, 36, 9, 38, 32, 9, 16, 33, \
  74. /* 24 */ 0, 16, 22, 39, 34, 0, 0, 0, 0, 0, \
  75. /* 25 */ 0, 0, 0, 0, 0, 0 \
  76. }
  77. #elif defined(FOR_FRENCH)
  78. #define DEF_TRIADS_MAPPING \
  79. { \
  80. /* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  81. /* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  82. /* 2 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  83. /* 3 */ 0, 0, 1, 0, 0, 0, 0, 0, 0, 40, \
  84. /* 4 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  85. /* 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  86. /* 6 */ 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, \
  87. /* 7 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
  88. /* 8 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, \
  89. /* 9 */ 27, 0, 0, 0, 0, 0, 0, 2, 3, 4, \
  90. /* 10 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, \
  91. /* 11 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, \
  92. /* 12 */ 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, \
  93. /* 13 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  94. /* 14 */ 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  95. /* 15 */ 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, \
  96. /* 16 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  97. /* 17 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  98. /* 18 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  99. /* 19 */ 0, 0, 29, 0, 35, 0, 0, 0, 0, 30, \
  100. /* 20 */ 36, 31, 37, 28, 0, 0, 38, 32, 0, 0, \
  101. /* 21 */ 0, 0, 33, 0, 0, 0, 0, 34, 0, 39, \
  102. /* 22 */ 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, \
  103. /* 23 */ 0, 30, 36, 31, 37, 28, 0, 0, 38, 32, \
  104. /* 24 */ 0, 0, 0, 29, 33, 0, 0, 0, 0, 34, \
  105. /* 25 */ 0, 39, 0, 0, 0, 0 \
  106. }
  107. #else /* !FOR_GERMAN && !FOR_SWED && !FOR_FRENCH */
  108. #define DEF_TRIADS_MAPPING \
  109. { \
  110. /* 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  111. /* 1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  112. /* 2 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  113. /* 3 */ 0, 0, 1, 0, 0, 0, 0, 0, 0, 40, \
  114. /* 4 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  115. /* 5 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  116. /* 6 */ 0, 0, 0, 0, 0, 2, 3, 4, 5, 6, \
  117. /* 7 */ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, \
  118. /* 8 */ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, \
  119. /* 9 */ 27, 0, 0, 0, 0, 0, 0, 2, 3, 4, \
  120. /* 10 */ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, \
  121. /* 11 */ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, \
  122. /* 12 */ 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, \
  123. /* 13 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  124. /* 14 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  125. /* 15 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  126. /* 16 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  127. /* 17 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  128. /* 18 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  129. /* 19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  130. /* 20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  131. /* 21 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  132. /* 22 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  133. /* 23 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  134. /* 24 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
  135. /* 25 */ 0, 0, 0, 0, 0, 0 \
  136. }
  137. #endif /* FOR_GERMAN etc. */
  138. /* -------------------------- Types definitions ------------------------------ */
  139. typedef _UCHAR triad_el_type[TR_NUMSYMBOLS/TR_NUMINBYTE]; /* There are *some* tr in byte ! */
  140. typedef triad_el_type triad_type[TR_NUMSYMBOLS][TR_NUMSYMBOLS];
  141. typedef triad_type _PTR p_triad_type;
  142. typedef struct { /* Header of Triads file */
  143. _CHAR object_type[TR_ID_LEN]; /* Type file (now Tr#2) */
  144. _CHAR type[TR_ID_LEN]; /* Type of TR (Eng., ) */
  145. _CHAR version[TR_ID_LEN]; /* Version number */
  146. _ULONG tr_offset; /* File offset of TR part */
  147. _ULONG tr_len; /* Length of TR part of data */
  148. _ULONG tr_chsum; /* Checksum of TR part */
  149. } tr_header_type, _PTR p_tr_header_type;
  150. typedef struct { /* TR memory descriptor */
  151. _CHAR tr_fname[TR_FNAME_LEN]; /* File name of loaded TR */
  152. _CHAR object_type[TR_ID_LEN]; /* Type file (now Tr#1) */
  153. _CHAR type[TR_ID_LEN]; /* Type of TR (Eng., ..) */
  154. _CHAR version[TR_ID_LEN]; /* Version number */
  155. _ULONG h_tr; /* Handle of tr memory */
  156. p_UCHAR p_tr; /* Pointer to locked tr mem */
  157. _ULONG tr_chsum; /* CheckSum of tr memory */
  158. } tr_descr_type, _PTR p_tr_descr_type;
  159. /* -------------------------- Prototypes ------------------------------------- */
  160. _INT triads_load(p_CHAR tradsname, _INT what_to_load, p_VOID _PTR tp);
  161. _INT triads_unload(p_VOID _PTR tp);
  162. _INT triads_save(p_CHAR fname, _INT what_to_save, p_VOID tp);
  163. _INT triads_lock(p_VOID tp);
  164. _INT triads_unlock(p_VOID tp);
  165. /* ---------- Global constants definitions ----------------------------------- */
  166. #ifndef ParaLibs_j_c
  167. ROM_DATA_EXTERNAL _UCHAR triads_mapping[256];
  168. #endif
  169. /* --------------------------------------------------------------------------- */
  170. #endif //TRIADS_H_INCLUDED
  171. /* ************************************************************************ */
  172. /* * End Of All ... * */
  173. /* ************************************************************************ */