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.

1349 lines
63 KiB

  1. /*****************************************************************************
  2. * *
  3. * BTKTCMAP.C *
  4. * *
  5. * Copyright (C) Microsoft Corporation 1990 - 1994. *
  6. * All Rights reserved. *
  7. * *
  8. ******************************************************************************
  9. * *
  10. * Module Intent *
  11. * *
  12. * Functions for SZ (0-terminated string) keys. *
  13. * *
  14. ******************************************************************************
  15. * *
  16. * Current Owner: BinhN *
  17. * *
  18. *****************************************************************************/
  19. static char s_aszModule[] = __FILE__; /* For error report */
  20. #include <mvopsys.h>
  21. #ifdef _MAC
  22. #include <winnls.h>
  23. #endif
  24. #include <orkin.h>
  25. #include <string.h>
  26. #include <misc.h>
  27. #include <iterror.h>
  28. #include <wrapstor.h>
  29. #include <mvdbcs.h>
  30. #include <mvsearch.h>
  31. #include <_mvutil.h>
  32. #include "common.h"
  33. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  34. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  35. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  36. // When ligature tables are implemented again, take this out !!!!!!!!!!
  37. //#define NOCHARTABLES_FIXME
  38. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  39. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  40. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  41. /**************************************
  42. * MASKS TO DEAL WITH KEYWORD SORTING *
  43. * (SHOULD MATCH WITH wmvc\keyword.c) *
  44. **************************************/
  45. #define PRIMARY_SORT_MASK 0x0Fff
  46. #define SECONDARY_SORT_MASK 0xF000
  47. /*****************************************************************************
  48. * *
  49. * Tables for StringJCompare() - Japanese "50-on" sorting *
  50. * *
  51. *****************************************************************************/
  52. static unsigned char pbPriHi[] = {
  53. 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
  54. 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
  55. 0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,
  56. 0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,0x23,0x24,0x25,0x26,0x27,0x28,
  57. 0x29,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,
  58. 0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x2A,0x2B,0x2C,0x2D,0x2E,
  59. 0x2F,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,
  60. 0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x30,0x31,0x32,0x33,0x12,
  61. 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
  62. 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
  63. 0x13,0x38,0x3C,0x3D,0x37,0x43,0xB8,0x87,0x88,0x89,0x8A,0x8B,0xAA,0xAC,0xAE,0x98,
  64. 0x44,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90,0x91,0x92,0x93,0x94,0x95,
  65. 0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,
  66. 0xA6,0xA7,0xA8,0xA9,0xAA,0xAC,0xAE,0xAF,0xB0,0xB1,0xB2,0xB3,0xB4,0xB9,0x3F,0x40,
  67. 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
  68. 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
  69. 0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,
  70. 0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,
  71. 0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,
  72. 0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,0xC1,
  73. 0x13,0x37,0x38,0x1F,0x21,0x43,0x23,0x24,0x28,0x14,0x3F,0x40,0x34,0x2F,0x34,0x2D,
  74. 0x33,0x2e,0x45,0x46,0x41,0x42,0x39,0x47,0x3A,0x3B,0x3B,0x44,0x35,0x34,0x22,0x47,
  75. 0x47,0x36,0x31,0x36,0x36,0x1A,0x1A,0x15,0x15,0x1B,0x1C,0x3E,0x3E,0x2A,0x2C,0x30,
  76. 0x32,0x3B,0x3B,0x3B,0x3B,0x3C,0x3D,0x3E,0x3E,0x3E,0x3E,0x1E,0x20,0x34,0x34,0xC1,
  77. 0x34,0x26,0x36,0x25,0x27,0x36,0x36,0x36,0x36,0x36,0x36,0x34,0x36,0x36,0x36,0x2B,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,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,
  165. 0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,
  166. 0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,
  167. 0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,
  168. 0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,
  169. 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
  170. 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xC7,0x47,
  171. 0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
  172. 0x47,0x47,0x47,0x47,0x47,0x47,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0xC7,0x47,0xC7,
  173. 0x3E,0x3E,0x36,0x47,0x36,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,
  174. 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xC7,0xC7,0xC7
  175. };
  176. static unsigned char pbPriLo[] = {
  177. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  178. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  179. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  180. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  181. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  182. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  183. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  184. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  185. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  186. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  187. 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  188. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  189. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  190. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,
  191. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  192. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  193. 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
  194. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
  195. 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  196. 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  197. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x02,0x00,
  198. 0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x28,0xFF,0x03,0x04,0xFF,0xFF,0x09,0x00,0x29,
  199. 0x2A,0x2B,0x00,0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x08,0x00,0x00,0x00,
  200. 0x00,0x05,0x06,0x07,0x08,0x00,0x00,0x01,0x02,0x03,0x04,0x00,0x00,0x04,0x07,0x7F,
  201. 0x08,0x00,0x3C,0x00,0x00,0x3F,0x40,0x27,0x36,0x8E,0x8D,0x03,0x06,0x07,0x09,0x00,
  202. 0x00,0x2B,0x2C,0x00,0x00,0x00,0x00,0x00,0x01,0x8C,0x8B,0x87,0x89,0x88,0x86,0x85,
  203. 0x80,0x7F,0x82,0x81,0x84,0x83,0x08,0x05,0x19,0x17,0x18,0x1A,0x06,0xAD,0xAE,0xAF,
  204. 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0x21,0x22,0x45,0x46,0x43,0x44,0x30,0x2E,
  205. 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0x2C,0x2D,0x2D,0x1B,0x1C,0x1D,0x1F,0xCF,
  206. 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0x29,0x47,0x4A,0x1E,0x20,0x3D,
  207. 0x3A,0x41,0x42,0x24,0x39,0x26,0x37,0x32,0x34,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
  208. 0x0C,0x05,0x91,0x90,0x8F,0x01,0x02,0x06,0xF8,0xF9,0xFA,0xFB,0x8A,0xFD,0xFE,0xFF,
  209. 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
  210. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
  211. 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  212. 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  213. 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x00,
  214. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
  215. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  216. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
  217. 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  218. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9B,0x9C,0x9D,0x9E,0xFF,
  219. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,
  220. 0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,
  221. 0x00,0xFF,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,
  222. 0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0xFF,0xFF,0xFF,
  223. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  224. 0xFF,0xFF,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
  225. 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
  226. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
  227. 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  228. 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  229. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0x00,0xFF,0x00,
  230. 0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0x00,
  231. 0xFF,0x00,0xFF,0xFF,0x00,0xFF,0x00,0xFF,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,
  232. 0x00,0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00,0xFF,0xFF,0x7F,
  233. 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  234. 0xFF,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x11,
  235. 0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,
  236. 0x22,0x23,0x24,0x25,0x26,0x27,0x28,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0x11,
  237. 0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,
  238. 0x22,0x23,0x24,0x25,0x26,0x27,0x28,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
  239. 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
  240. 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
  241. 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
  242. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
  243. 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  244. 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  245. 0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,
  246. 0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,0x30,
  247. 0x31,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
  248. 0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x7F,
  249. 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  250. 0x30,0x31,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x5F,
  251. 0x61,0x63,0x65,0x69,0x67,0x6B,0x73,0x6F,0x77,0x7B,0x60,0x62,0x64,0x66,0x6A,0x68,
  252. 0x6E,0x76,0x72,0x7A,0x7E,0x6D,0x74,0x71,0x78,0x7C,0x6C,0x75,0x70,0x79,0x7D,0xBF,
  253. 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
  254. 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
  255. 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
  256. 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
  257. 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
  258. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
  259. 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  260. 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  261. 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
  262. 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
  263. 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
  264. 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
  265. 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
  266. 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
  267. 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
  268. 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
  269. 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
  270. 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
  271. 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
  272. 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
  273. 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
  274. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
  275. 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  276. 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  277. 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
  278. 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
  279. 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
  280. 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
  281. 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
  282. 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
  283. 0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
  284. 0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
  285. 0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
  286. 0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
  287. 0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
  288. 0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF,
  289. 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
  290. 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
  291. 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
  292. 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
  293. 0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,
  294. 0x5B,0x5C,0x5D,0x5E,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x5E,0x17,
  295. 0x0E,0x10,0x19,0x0F,0x13,0x0C,0x15,0x1A,0x1B,0x0D,0x12,0x11,0x14,0x18,0x16,0x22,
  296. 0x23,0x24,0x20,0x21,0x26,0x25,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x1C,0x7F,
  297. 0x09,0x0A,0x0A,0x27,0x0B,0x07,0x08,0x09,0x0A,0x0B,0x04,0x05,0x06,0x1F,0x1E,0x1D,
  298. 0x3B,0x3E,0x33,0x35,0x23,0x25,0x48,0x2A,0x28,0x49,0x38,0x2F,0x31,0x9D,0x9E,0x9F
  299. };
  300. static unsigned char pbSecWgt[] = {
  301. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  302. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  303. 0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  304. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  305. 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  306. 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,
  307. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  308. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  309. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  310. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  311. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  312. 0x14,0x04,0x04,0x04,0x04,0x04,0x04,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
  313. 0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  314. 0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,
  315. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  316. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  317. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  318. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  319. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  320. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  321. 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x40,0x00,0x40,
  322. 0x40,0x40,0x08,0x09,0x08,0x09,0x00,0x00,0x08,0x00,0x00,0x54,0x54,0x00,0x40,0x00,
  323. 0x00,0x00,0x40,0x00,0x00,0x40,0x44,0x40,0x44,0x40,0x40,0x00,0x00,0x40,0x40,0x40,
  324. 0x40,0x00,0x00,0x00,0x00,0x40,0x40,0x00,0x00,0x00,0x00,0x40,0x40,0x00,0x00,0x00,
  325. 0x00,0x40,0x00,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,
  326. 0x40,0x00,0x00,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  327. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  328. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  329. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  330. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  331. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  332. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  333. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  334. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  335. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  336. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  337. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,
  338. 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  339. 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,
  340. 0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,
  341. 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
  342. 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x60,
  343. 0x64,0x60,0x64,0x60,0x64,0x60,0x64,0x60,0x64,0x64,0x65,0x60,0x61,0x60,0x61,0x64,
  344. 0x65,0x60,0x61,0x60,0x61,0x60,0x61,0x60,0x61,0x60,0x61,0x60,0x61,0x60,0x61,0x60,
  345. 0x61,0x60,0x64,0x65,0x60,0x61,0x60,0x61,0x60,0x60,0x60,0x60,0x60,0x60,0x61,0x62,
  346. 0x60,0x61,0x62,0x60,0x61,0x62,0x60,0x61,0x62,0x60,0x61,0x62,0x60,0x60,0x60,0x60,
  347. 0x60,0x60,0x64,0x60,0x64,0x60,0x64,0x60,0x60,0x60,0x60,0x60,0x60,0x64,0x20,0x20,
  348. 0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  349. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  350. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  351. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  352. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  353. 0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x44,0x44,0x45,0x40,0x41,0x40,0x41,
  354. 0x44,0x45,0x40,0x41,0x40,0x41,0x40,0x41,0x40,0x41,0x40,0x41,0x40,0x41,0x40,0x41,
  355. 0x40,0x41,0x40,0x44,0x45,0x40,0x41,0x40,0x41,0x40,0x40,0x40,0x40,0x40,0x40,0x41,
  356. 0x42,0x40,0x41,0x42,0x40,0x41,0x42,0x40,0x41,0x42,0x40,0x41,0x42,0x40,0x40,0x00,
  357. 0x40,0x40,0x40,0x40,0x44,0x40,0x44,0x40,0x44,0x40,0x40,0x40,0x40,0x40,0x40,0x44,
  358. 0x00,0x00,0x40,0x40,0x45,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,
  359. 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  360. 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  361. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  362. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  363. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  364. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  365. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  366. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  367. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  368. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  369. 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  370. 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  371. 0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  372. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  373. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  374. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  375. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  376. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  377. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  378. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  379. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  380. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  381. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  382. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  383. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  384. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  385. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  386. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  387. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  388. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  389. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  390. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  391. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  392. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  393. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  394. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  395. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  396. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  397. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  398. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  399. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  400. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  401. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  402. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  403. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  404. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  405. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  406. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  407. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  408. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  409. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  410. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  411. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  412. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  413. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  414. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  415. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  416. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  417. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  418. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  419. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  420. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  421. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  422. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
  423. };
  424. static unsigned char pbSecFlg[] = {
  425. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  426. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  427. 0x20,0x20,0x22,0x20,0x20,0x20,0x20,0x22,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  428. 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  429. 0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
  430. 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x20,0x20,0x20,0x20,0x20,
  431. 0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
  432. 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x20,0x20,0x20,0x20,0x00,
  433. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  434. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  435. 0x20,0x20,0x20,0x20,0x20,0x20,0x35,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,
  436. 0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x35,0x35,0x37,0x35,0x35,0x35,0x35,0x35,0x35,
  437. 0x35,0x35,0x37,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
  438. 0x35,0x35,0x35,0x35,0x37,0x37,0x37,0x35,0x35,0x35,0x35,0x35,0x37,0x35,0x20,0x20,
  439. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  440. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  441. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  442. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  443. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  444. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  445. 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x20,
  446. 0x20,0x20,0x05,0x05,0x05,0x05,0x00,0x00,0x04,0x00,0x00,0x37,0x37,0x00,0x20,0x00,
  447. 0x00,0x00,0x20,0x00,0x00,0x22,0x22,0x22,0x22,0x20,0x20,0x00,0x00,0x20,0x20,0x20,
  448. 0x20,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00,0x00,0x20,0x20,0x00,0x00,0x00,
  449. 0x00,0x20,0x00,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,
  450. 0x20,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  451. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  452. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  453. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  454. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  455. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  456. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  457. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  458. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  459. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  460. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  461. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,
  462. 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  463. 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
  464. 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x00,0x00,0x00,0x00,0x00,0x00,
  465. 0x00,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,
  466. 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x00,0x00,0x00,0x00,0x37,
  467. 0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x35,0x35,0x35,0x35,0x37,
  468. 0x37,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
  469. 0x35,0x37,0x37,0x37,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
  470. 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
  471. 0x35,0x37,0x37,0x37,0x37,0x37,0x37,0x35,0x35,0x35,0x35,0x35,0x37,0x37,0x15,0x15,
  472. 0x35,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  473. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  474. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  475. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  476. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  477. 0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x35,0x35,0x35,0x35,
  478. 0x37,0x37,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
  479. 0x35,0x35,0x37,0x37,0x37,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,
  480. 0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x00,
  481. 0x35,0x35,0x35,0x37,0x37,0x37,0x37,0x37,0x37,0x35,0x35,0x35,0x35,0x35,0x37,0x37,
  482. 0x15,0x15,0x35,0x35,0x37,0x37,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,
  483. 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  484. 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,
  485. 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  486. 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  487. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  488. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  489. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  490. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  491. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  492. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  493. 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  494. 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  495. 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  496. 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00,
  497. 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
  498. 0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  499. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  500. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  501. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  502. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  503. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  504. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  505. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  506. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  507. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  508. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  509. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  510. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  511. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  512. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  513. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  514. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  515. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  516. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  517. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  518. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  519. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  520. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  521. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  522. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  523. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  524. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  525. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  526. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  527. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  528. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  529. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  530. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  531. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  532. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  533. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  534. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  535. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  536. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  537. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  538. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  539. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  540. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  541. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  542. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  543. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  544. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  545. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  546. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
  547. };
  548. static unsigned char pbgMasks[] = {
  549. 0x03, 0x01, 0x00, 0x02
  550. , 0x04, 0x02, 0x02, 0x01
  551. , 0x18, 0x04, 0x03, 0x02
  552. , 0x20, 0x18, 0x05, 0x01
  553. , 0x40, 0x20, 0x06, 0x01
  554. , 0x00, 0x00, 0x00, 0x00
  555. };
  556. static unsigned char pbIgnore[] = {
  557. 0x1F, 0x07, 0x00, 0x02
  558. , 0x20, 0x08, 0x00, 0x01
  559. , 0x20, 0x10, 0x00, 0x40
  560. , 0x40, 0x20, 0x00, 0x08
  561. , 0x00, 0x00, 0x00, 0x00
  562. };
  563. #define isDbcsJ( c, next) ((c >= 0x80 && c <= 0xA0) || (c >= 0xE0 && c <= 0xFF))
  564. DWORD g_dwFlags;
  565. typedef struct tagCOMPSTRINGINFO{
  566. unsigned priwt;
  567. unsigned char secwt;
  568. unsigned char secflg;
  569. } COMPSTRINGINFO;
  570. typedef struct tagSTRINFO_J
  571. {
  572. LPBYTE pbPriHi;
  573. LPBYTE pbPriLo;
  574. LPBYTE pbSecWgt;
  575. LPBYTE pbSecFlg;
  576. LPBYTE pbMasks;
  577. LPBYTE pbMaps;
  578. LPBYTE pbIgnore;
  579. LPBYTE pbC1JPN;
  580. LPBYTE pbC2JPN;
  581. LPBYTE pbC3JPN;
  582. }
  583. STRINFO_J;
  584. // Prototypes for Japanese sorting functions
  585. PUBLIC int PASCAL FAR StringJCompare (DWORD dwFlags, LPBYTE lpstr1, int cch1,
  586. LPBYTE lpstr2, int cch2);
  587. PRIVATE int PASCAL NEAR GetSortWeightJ(LPBYTE FAR*plpstr1,int cch1,
  588. COMPSTRINGINFO FAR *pcompstrinfo);
  589. /***************************************************************************
  590. *
  591. * @doc INTERNAL
  592. *
  593. * @func BK FAR PASCAL | BkScanCMapInternal |
  594. * Scan an internal node for a key and return child BK.
  595. *
  596. * @parm BK | bk |
  597. * BK of internal node to scan
  598. *
  599. * @parm KEY | key |
  600. * key to search for
  601. *
  602. * @parm SHORT | wLevel |
  603. * level of btree bk lives on
  604. *
  605. * @parm QBTHR | qbthr |
  606. * btree header containing cache, and btree specs
  607. *
  608. * @parm QW | qiKey |
  609. * address of an int or NULL to not get it
  610. *
  611. * @rdesc bk of subtree that might contain key; bkNil on error
  612. * args OUT: qbthr->qCache - bk's block will be cached
  613. * qiKey - index into rgbBlock of first key >= key
  614. *
  615. * Side Effects: bk's block will be cached
  616. *
  617. ***************************************************************************/
  618. PUBLIC BK FAR PASCAL BkScanCMapInternal(BK bk, KEY key, SHORT wLevel,
  619. QBTHR qbthr, QW qiKey, PHRESULT phr)
  620. {
  621. QCB qcb; // Pointer to cache block
  622. QB q; // Pointer to block buffer
  623. SHORT cKeys; // Number of keys in the block
  624. SZ szSaved = NULL;
  625. int fCompare;
  626. int KeyLength;
  627. int length;
  628. if ((qcb = QFromBk(bk, wLevel, qbthr, phr)) == NULL)
  629. {
  630. return bkNil;
  631. }
  632. q = qcb->db.rgbBlock; // Block buffer
  633. cKeys = qcb->db.cKeys; // Number of keys in the block
  634. bk = (BK)GETLONG(q); // Get leaf block number
  635. q += sizeof(DWORD);
  636. KeyLength = (int) STRLEN((SZ)key);
  637. while (cKeys-- > 0)
  638. {
  639. length = (int) STRLEN((SZ)q);
  640. if (PRIMARYLANGID(LANGIDFROMLCID(qbthr->bth.lcid)) == LANG_JAPANESE)
  641. fCompare = StringJCompare(0L, (SZ)key, KeyLength, (SZ)q, length);
  642. else
  643. fCompare = StrFntMappedLigatureComp((SZ)key, (SZ)q,
  644. qbthr->lrglpCharTab);
  645. if (fCompare >= 0)
  646. {
  647. q += length + 1;
  648. bk = (BK)GETLONG(q);
  649. q += sizeof(DWORD);
  650. }
  651. else
  652. break;
  653. }
  654. if (qiKey != NULL)
  655. {
  656. *qiKey = (WORD)(q - (QB)qcb->db.rgbBlock);
  657. }
  658. return bk;
  659. }
  660. /***************************************************************************
  661. *
  662. * @doc INTERNAL
  663. *
  664. * @func HRESULT FAR PASCAL | RcScanCMapLeaf |
  665. * Scan a leaf node for a key and copy the associated data.
  666. *
  667. * @parm BK | bk |
  668. * the leaf block
  669. *
  670. * @parm KEY | key |
  671. * the key we're looking for
  672. *
  673. * @parm SHORT | wLevel |
  674. * the level of leaves (unnecessary)
  675. *
  676. * @parm QBTHR | qbthr |
  677. * the btree header
  678. *
  679. * @parm QV | qRec |
  680. * if found, record gets copied into this buffer
  681. *
  682. * @parm QTPOS | qbtpos |
  683. * pos of first key >= key goes here
  684. *
  685. * @rdesc ERR_SUCESS if found; ERR_NOTEXIST if not found
  686. * If we are scanning for a key greater than any key in this
  687. * block, the pos returned will be invalid and will point just
  688. * past the last valid key in this block.
  689. *
  690. ***************************************************************************/
  691. PUBLIC HRESULT FAR PASCAL RcScanCMapLeaf(BK bk, KEY key, SHORT wLevel,
  692. QBTHR qbthr, QV qRec, QBTPOS qbtpos)
  693. {
  694. QCB qcb;
  695. SZ sz;
  696. int fRet;
  697. HRESULT rc;
  698. SHORT i;
  699. SHORT cKeys; // Number of keys in the block
  700. SZ szSaved = NULL;
  701. int KeyLength, length, lengthSaved = 0;
  702. HRESULT errb;
  703. if ((qcb = QFromBk(bk, wLevel, qbthr, &errb)) == NULL)
  704. {
  705. return errb;
  706. }
  707. rc = E_NOTEXIST;
  708. sz = qcb->db.rgbBlock + 2 * sizeof(BK);
  709. cKeys = qcb->db.cKeys;
  710. KeyLength = (int) STRLEN((SZ)key);
  711. for (i= 0; i < cKeys; i++)
  712. {
  713. length = (int) STRLEN((SZ)sz);
  714. #ifdef NOCHARTABLES_FIXME
  715. fRet=STRCMP((SZ)key, (SZ)sz);
  716. #else
  717. if (PRIMARYLANGID(LANGIDFROMLCID(qbthr->bth.lcid)) == LANG_JAPANESE)
  718. fRet = StringJCompare(0L, (SZ)key, KeyLength, (SZ)sz, length);
  719. else
  720. fRet = StrFntMappedLigatureComp((SZ)key, (SZ)sz,
  721. qbthr->lrglpCharTab);
  722. #endif
  723. if (fRet > 0) /* still looking for key */
  724. {
  725. sz += length + 1;
  726. sz += CbSizeRec(sz, qbthr);
  727. }
  728. else if (fRet < 0) /* key not found */
  729. {
  730. if (szSaved)
  731. {
  732. sz = szSaved;
  733. /* Return 1st match match */
  734. if (qRec != NULL) {
  735. sz = (QB)sz + lengthSaved + 1;
  736. QVCOPY(qRec, sz, (LONG)CbSizeRec(sz, qbthr));
  737. }
  738. rc = S_OK;
  739. }
  740. break;
  741. }
  742. else /* matched the key */
  743. {
  744. /* We only save the location of the 1st element in the list */
  745. if (szSaved == NULL)
  746. {
  747. szSaved = sz;
  748. lengthSaved = length;
  749. }
  750. if (STRICMP((SZ)key, (SZ)sz) == 0)
  751. {
  752. /* This is a real match */
  753. if (qRec != NULL) {
  754. sz = (QB)sz + length + 1;
  755. QVCOPY(qRec, sz, (LONG)CbSizeRec(sz, qbthr));
  756. }
  757. rc = S_OK;
  758. break;
  759. }
  760. sz += length + 1;
  761. sz += CbSizeRec(sz, qbthr);
  762. }
  763. }
  764. if (qbtpos != NULL)
  765. {
  766. qbtpos->bk = bk;
  767. qbtpos->cKey = i;
  768. qbtpos->iKey = (int)((QB)sz - (QB)qcb->db.rgbBlock);
  769. }
  770. return rc;
  771. }
  772. /***********************************************************************
  773. * @func int PASCAL FAR | StrFntMappedLigatureComp |
  774. * The function will compare two special zero-terminated strings.
  775. * The strings contain information about their font maps given by
  776. * 1 <x + 1>
  777. * - 1 : next byte will be the font map index
  778. * - x + 1 : font map index + 1
  779. *
  780. * @parm SZ | sz1|
  781. * String 1
  782. *
  783. * @parm SZ | sz2 |
  784. * String 2
  785. *
  786. * @parm LPCHARTAB FAR *| qrglpCharTab |
  787. * Font mapping and ligature information
  788. *
  789. * @rdesc
  790. * < 0 : if sz1 < sz2
  791. * = 0 : if sz1 = sz2
  792. * > 0 : if sz1 > sz2
  793. *
  794. * @comm The function still may fail in the case of comparing
  795. * a[essetz]s with as[essetz]
  796. ***********************************************************************/
  797. PUBLIC int EXPORT_API PASCAL FAR StrFntMappedLigatureComp(SZ sz1, SZ sz2,
  798. LPCHARTAB FAR *qrglpCharTab )
  799. {
  800. LPCMAP lpCMap1; // Pointer to font map for string 1
  801. LPCMAP lpCMap2; // Pointer to font map for string 2
  802. LPBYTE lpbLigature1; // Pointer to ligature table for string 1
  803. LPBYTE lpbLigature2; // Pointer to ligature table for string 2
  804. LPBYTE lpb; // Scratch variable
  805. BYTE ch1;
  806. BYTE ch2;
  807. BYTE chLig1; // 2nd ligature bytes
  808. BYTE chLig2; // 2nd ligature bytes
  809. int fRet; // Returned value
  810. BYTE cDelimiter1 = 0;
  811. BYTE cDelimiter2 = 0;
  812. char chDiff1 = 0;
  813. char chDiff2 = 0;
  814. int fRet2 = 0; // Secondary returned value
  815. /* Get the default character map & ligature table */
  816. lpCMap1 = lpCMap2 = qrglpCharTab[0]->lpCMapTab;
  817. lpbLigature1 = lpbLigature2 = qrglpCharTab[0]->lpLigature;
  818. for (;; sz1++, sz2++)
  819. {
  820. ch1 = *sz1;
  821. ch2 = *sz2;
  822. #if 0 // do not enable. for Diff purposes only
  823. if (ch1 == DELIMITER)
  824. {
  825. cDelimiter1++;
  826. if (cDelimiter1 >= 2)
  827. {
  828. ch1 = 0;
  829. }
  830. }
  831. if (ch2 == DELIMITER)
  832. {
  833. cDelimiter2++;
  834. if (cDelimiter2 >= 2)
  835. {
  836. ch2 = 0;
  837. }
  838. }
  839. #endif // 0
  840. if ((lpCMap1[ch1].Class & SPECIAL_CHAR_MAP) == CLASS_TERMINATOR)
  841. ch1 = 0;
  842. if ((lpCMap1[ch2].Class & SPECIAL_CHAR_MAP) == CLASS_TERMINATOR)
  843. ch2 = 0;
  844. while (ch1 == EMBEDFONT_BYTE_TAG) // Change font map
  845. {
  846. sz1++; // Skip the font info
  847. lpCMap1 = qrglpCharTab[ch1 = *sz1++ - 1]->lpCMapTab; // Get the new font map
  848. lpbLigature1 = qrglpCharTab[ch1]->lpLigature; // Get the new ligature
  849. ch1 = *sz1;
  850. }
  851. while (ch2 == EMBEDFONT_BYTE_TAG) // Change font map
  852. {
  853. sz2++; // Skip the font info
  854. lpCMap2 = qrglpCharTab[ch2 = *sz2++ - 1]->lpCMapTab; // Get the new font map
  855. lpbLigature2 = qrglpCharTab[ch2]->lpLigature; // Get the new ligature
  856. ch2 = *sz2;
  857. }
  858. if (ch1 == 0 || ch2 == 0)
  859. break;
  860. /* A sort order = 0 means that you want to ignore this letter */
  861. if (lpCMap1[ch1].SortOrder == 0)
  862. {
  863. // Skip this letter.
  864. if (lpCMap1[ch2].SortOrder != 0)
  865. {
  866. if (chDiff1 == 0)
  867. {
  868. chDiff1 = -1;
  869. chDiff2 = 1;
  870. }
  871. sz2--; // Compensate the increment
  872. }
  873. else if (ch1 != ch2)
  874. {
  875. // To fix the case of : (oui and !oui
  876. if (chDiff1 == 0)
  877. chDiff1 = ch1;
  878. if (chDiff2 == 0)
  879. chDiff2 = ch2;
  880. }
  881. continue;
  882. }
  883. if (lpCMap2[ch2].SortOrder == 0)
  884. {
  885. // Skip this letter.
  886. if (lpCMap1[ch1].SortOrder != 0)
  887. {
  888. if (chDiff2 == 0)
  889. {
  890. chDiff2 = -1;
  891. chDiff1 = 1;
  892. }
  893. sz1--; // Compensate the increment
  894. }
  895. continue;
  896. }
  897. /* Do this before ligature so that we can catch the case of
  898. * ligature being greater than equivalent bytes
  899. */
  900. if (fRet2 == 0)
  901. fRet2 = (lpCMap1[ch1].SortOrder & SECONDARY_SORT_MASK)
  902. - (lpCMap2[ch2].SortOrder & SECONDARY_SORT_MASK);
  903. /**************************************************
  904. * WE NOW HAVE TO CHECK FOR LIGATURES SORTING ORDER.
  905. ***************************************************/
  906. chLig1 = 0;
  907. chLig2 = 0;
  908. if (lpbLigature1 && lpCMap1[ch1].Class == CLASS_LIGATURE)
  909. {
  910. for (lpb = lpbLigature1; *lpb; lpb += 3)
  911. {
  912. if (*lpb == ch1)
  913. {
  914. ch1 = lpb[1];
  915. chLig1 = lpb[2];
  916. break;
  917. }
  918. }
  919. }
  920. if (lpbLigature2 && lpCMap2[ch2].Class == CLASS_LIGATURE)
  921. {
  922. for (lpb = lpbLigature2; *lpb; lpb += 3)
  923. {
  924. if (*lpb == ch2)
  925. {
  926. ch2 = lpb[1];
  927. chLig2 = lpb[2];
  928. break;
  929. }
  930. }
  931. }
  932. /* Now we have to check for ligature compared with non ligature */
  933. if (chLig1 != 0 && chLig2 == 0)
  934. {
  935. chLig2 = *(++sz2);
  936. }
  937. if (chLig2 != 0 && chLig1 == 0)
  938. {
  939. chLig1 = *(++sz1);
  940. }
  941. if (fRet = (lpCMap1[ch1].SortOrder & PRIMARY_SORT_MASK)
  942. - (lpCMap2[ch2].SortOrder & PRIMARY_SORT_MASK))
  943. return(fRet);
  944. if (fRet = (lpCMap1[chLig1].SortOrder & PRIMARY_SORT_MASK) -
  945. (lpCMap2[chLig2].SortOrder & PRIMARY_SORT_MASK))
  946. return (fRet);
  947. // REVIEW: how to handle ligature secondary sort
  948. if (fRet = (lpCMap1[chLig1].SortOrder & SECONDARY_SORT_MASK) -
  949. (lpCMap2[chLig2].SortOrder & SECONDARY_SORT_MASK))
  950. return (fRet);
  951. if (fRet2 == 0)
  952. {
  953. fRet2 = (lpCMap1[ch1].SortOrder & SECONDARY_SORT_MASK)
  954. - (lpCMap2[ch2].SortOrder & SECONDARY_SORT_MASK);
  955. }
  956. }
  957. if (ch1 != ch2)
  958. {
  959. if ((ch1 == 0 && lpCMap2[ch2].SortOrder == 0) ||
  960. (ch2 == 0 && lpCMap1[ch1].SortOrder == 0))
  961. {
  962. if (chDiff1 != chDiff2)
  963. return (chDiff1 - chDiff2);
  964. }
  965. return(ch1 - ch2);
  966. }
  967. // REVIEW: Check case where chDiff1==chDiff2 and fRet2 != 0
  968. // REVIEW: Merge this with btree compare
  969. return ((fRet = chDiff1 - chDiff2) == 0 ? fRet2 : fRet);
  970. }
  971. PUBLIC VOID EXPORT_API PASCAL FAR BtreeSetCMap (HANDLE hbt,
  972. LPCHARTAB FAR * lrglpCharTab)
  973. {
  974. QBTHR qbthr;
  975. if (hbt == NULL || lrglpCharTab == NULL)
  976. return;
  977. qbthr = _GLOBALLOCK(hbt);
  978. qbthr->lrglpCharTab = lrglpCharTab;
  979. _GLOBALUNLOCK(hbt);
  980. return;
  981. }
  982. PUBLIC LPVOID EXPORT_API PASCAL FAR BtreeGetCMap (HANDLE hbt)
  983. {
  984. QBTHR qbthr;
  985. LPVOID lpv;
  986. if (hbt == NULL)
  987. return NULL;
  988. qbthr = _GLOBALLOCK(hbt);
  989. lpv = (LPVOID)qbthr->lrglpCharTab;
  990. _GLOBALUNLOCK(hbt);
  991. return lpv;
  992. }
  993. /***********************************************************************
  994. * @func int | PASCAL FAR | StringJCompare |
  995. * Compares two Japanese strings for sorting order.
  996. *
  997. * @parm DWORD | dwFlags |
  998. * - zero or more of
  999. * NORM_IGNORECASE
  1000. * NORM_IGNORENONSPACE
  1001. * NORM_IGNORESYMBOLS
  1002. *
  1003. * @parm LPBYTE | lpStr1 |
  1004. * Pointer to string to compare
  1005. *
  1006. * @parm int | cch1 |
  1007. * length of string
  1008. *
  1009. * @parm LPBYTE | lpStr2 |
  1010. * pointer to string to compare
  1011. *
  1012. * @parm int | cch2 |
  1013. * length of string
  1014. *
  1015. * @rdesc
  1016. * < 0 : if sz1 < sz2
  1017. * = 0 : if sz1 = sz2
  1018. * > 0 : if sz1 > sz2
  1019. ***********************************************************************/
  1020. PUBLIC int EXPORT_API PASCAL FAR StringJCompare( DWORD dwFlags,
  1021. LPBYTE lpstr1, int cch1, LPBYTE lpstr2, int cch2)
  1022. {
  1023. LPBYTE pbMasks;
  1024. unsigned char b1stDiff;
  1025. int b1stDiffValue;
  1026. unsigned char bFlgMask, bWgtMask;
  1027. int bTemp;
  1028. COMPSTRINGINFO compstrinfo1, compstrinfo2;
  1029. b1stDiff=0;
  1030. b1stDiffValue=0;
  1031. /* initialise to indicate no previous character */
  1032. g_dwFlags = dwFlags;
  1033. compstrinfo1.priwt = compstrinfo1.secwt = 0;
  1034. compstrinfo2.priwt = compstrinfo2.secwt = 0;
  1035. /* must continue even if one string empty, to ignore trailing punc */
  1036. while (cch1 || cch2)
  1037. {
  1038. /* get the sorting codes & if not equal, return the difference */
  1039. /* if we must ignore punc, then loop over them */
  1040. if (!cch1)
  1041. compstrinfo1.priwt = compstrinfo1.secwt = 0;
  1042. else
  1043. {
  1044. do
  1045. {
  1046. cch1 = GetSortWeightJ(&lpstr1, cch1, &compstrinfo1);
  1047. if ( (g_dwFlags & NORM_IGNORESYMBOLS) &&
  1048. compstrinfo1.priwt>=0x1400 &&
  1049. compstrinfo1.priwt<=0x54FF )
  1050. compstrinfo1.priwt = compstrinfo1.secwt = 0;
  1051. } while ( cch1 && compstrinfo1.priwt==0 );
  1052. }
  1053. if (!cch2)
  1054. compstrinfo2.priwt = compstrinfo2.secwt = 0;
  1055. else {
  1056. do
  1057. {
  1058. cch2 = GetSortWeightJ(&lpstr2, cch2, &compstrinfo2);
  1059. if ( (g_dwFlags & NORM_IGNORESYMBOLS) &&
  1060. compstrinfo2.priwt>=0x1400 &&
  1061. compstrinfo2.priwt<=0x54FF)
  1062. {
  1063. compstrinfo2.priwt = compstrinfo2.secwt = 0;
  1064. }
  1065. } while ( cch2 && compstrinfo2.priwt==0 );
  1066. }
  1067. /* This exit path also used when just one string is empty */
  1068. if (compstrinfo1.priwt != compstrinfo2.priwt)
  1069. return (compstrinfo1.priwt - compstrinfo2.priwt);
  1070. /* first order values same, so check 2nd, 3rd .. 6th for differences */
  1071. /* stop scanning when we reach an order where we have a previous diff */
  1072. if (compstrinfo1.secwt!=compstrinfo2.secwt)
  1073. {
  1074. for( pbMasks=pbgMasks;(bFlgMask=pbMasks[1]) && bFlgMask!=b1stDiff;
  1075. pbMasks+=4 )
  1076. {
  1077. if (bFlgMask & compstrinfo1.secflg)
  1078. {
  1079. bWgtMask = pbMasks[0];
  1080. bTemp = (compstrinfo1.secwt & bWgtMask) -
  1081. (compstrinfo2.secwt & bWgtMask);
  1082. /* if we find a difference it must be the most important
  1083. * so far so save it and remember which order it belongs
  1084. * to - then stop
  1085. */
  1086. if (bTemp)
  1087. {
  1088. b1stDiffValue = bTemp;
  1089. b1stDiff = bFlgMask;
  1090. break; /* move onto the next character pair */
  1091. }
  1092. }
  1093. }
  1094. }
  1095. }
  1096. /* no 1st order diffs, so ret by 2nd..6th order diff */
  1097. if (b1stDiff)
  1098. return (b1stDiffValue);
  1099. return 0;
  1100. }
  1101. /***
  1102. * GetSortWeightJ - get the sort weight for Japan.
  1103. * ( handles diacritical merging )
  1104. *Purpose:
  1105. *
  1106. *Entry:
  1107. *
  1108. *Exit:
  1109. * returns TRUE :
  1110. * FALSE :
  1111. *Note:
  1112. * Priwt : Word
  1113. * Secwt : Byte, contains 2nd, 3rd .. 6th order sorting values
  1114. * SecFlg: Byte, contains flags to say which orders to use
  1115. *
  1116. ***********************************************************************/
  1117. PRIVATE int PASCAL NEAR GetSortWeightJ(
  1118. LPBYTE FAR*plpstr1, int cch1, COMPSTRINGINFO FAR *pcompstrinfo)
  1119. {
  1120. unsigned int Priwt, NextCh;
  1121. BYTE Secwt, SecFlg;
  1122. LPBYTE lpstr1 = *plpstr1;
  1123. LPBYTE pbMasks;
  1124. /* first pick up the next whole character */
  1125. Priwt = *lpstr1++;
  1126. cch1--;
  1127. if (cch1 && isDbcsJ(Priwt, 0))
  1128. {
  1129. Priwt = (Priwt << 8) + *lpstr1++;
  1130. cch1--;
  1131. }
  1132. /* if this a Kanji outside our tables force the correct values */
  1133. if (Priwt >= 0x87A0)
  1134. {
  1135. Priwt |= 0x4000; /* 0x8nnn -> 0xCnnn, 9->D, E->E, F->F */
  1136. Secwt = 0x00;
  1137. SecFlg = 0x04; /* for repeat character order */
  1138. goto AllDone;
  1139. }
  1140. /* Char can be sorted by table, so mask into range & get table values */
  1141. Priwt &= 0x0FFF; /* 0x00nn -> 0x00nn, 81->01, 82->02, 83->03 */
  1142. Secwt = pbSecWgt[Priwt];
  1143. SecFlg = pbSecFlg[Priwt];
  1144. Priwt = (pbPriHi[Priwt] << 8) + pbPriLo[Priwt];
  1145. /* Most characters now complete, but a few need extra processing */
  1146. /* eg. Kana that can have Daku-ten or Handaku-ten, Cho-on or repeat chars */
  1147. if ( (Priwt&0x00FF) != 0x00FF )
  1148. goto AllDone;
  1149. Priwt &= 0xFF00; /* mask off the special flag */
  1150. /* If we have a Kana, test for following Daku-ten or Handaku-ten */
  1151. if (Priwt >= 0x8700)
  1152. {
  1153. if (cch1)
  1154. {
  1155. NextCh = *lpstr1;
  1156. if (cch1>=2 && isDbcsJ(NextCh, 0))
  1157. NextCh = (NextCh << 8) + *(lpstr1+1);
  1158. if (NextCh==0x00DE || NextCh==0x814A)
  1159. {
  1160. lpstr1 += (NextCh==0x00DE) ? 1 : 2;
  1161. cch1 -= (NextCh==0x00DE) ? 1 : 2;
  1162. Secwt |= 0x01;
  1163. }
  1164. else if (NextCh==0x00DF || NextCh==0x814B)
  1165. {
  1166. lpstr1 += (NextCh==0x00DF) ? 1 : 2;
  1167. cch1 -= (NextCh==0x00DF) ? 1 : 2;
  1168. Secwt |= 0x02;
  1169. }
  1170. }
  1171. goto AllDone;
  1172. }
  1173. /* If not kana, must be Cho-on or a repeat character - try Kanji repeat */
  1174. if (Priwt==0x3A00)
  1175. {
  1176. if ( pcompstrinfo->priwt >= 0xC7A0 ) /* if prev was Kanji, use it */
  1177. Priwt = pcompstrinfo->priwt;
  1178. Secwt = pcompstrinfo->secwt | 0x08; /* with a repeat marker */
  1179. SecFlg = pcompstrinfo->secflg;
  1180. goto AllDone;
  1181. }
  1182. /* Cho-on and Kana repeat chars only used if they actually follow a kana */
  1183. if (pcompstrinfo->priwt<0x8700 || pcompstrinfo->priwt>0xB9FF)
  1184. goto AllDone;
  1185. /* Cho-on characters duplicate the vowel sound of the prev. charater */
  1186. /* except when they follow a N, in which case they act like repeat */
  1187. if ((Priwt==0x4400 || Priwt==0x3500) && pcompstrinfo->priwt<0xB900)
  1188. {
  1189. Priwt = ((pcompstrinfo->priwt % 5) << 8) + 0x8700;
  1190. Secwt |= (pcompstrinfo->secwt&0x20);
  1191. SecFlg = 0x37;
  1192. goto AllDone;
  1193. }
  1194. /* Kana repeat is the only special character left */
  1195. /* second order values should be merged with those of previous character */
  1196. Priwt = pcompstrinfo->priwt;
  1197. Secwt = (pcompstrinfo->secwt&0xE4) | (Secwt&0x1B); /* merge minus some bits */
  1198. SecFlg = pcompstrinfo->secflg;
  1199. AllDone: /* we have the full 50-on sorting values now */
  1200. /* mask off any bits that we want to ignore during this compare */
  1201. if (g_dwFlags & ~NORM_IGNORESYMBOLS)
  1202. {
  1203. //Special kludges to make some pairs of full-pitch chars that
  1204. //sort as different chars both convert to the same half-pitch char
  1205. if (g_dwFlags & NORM_IGNOREWIDTH)
  1206. {
  1207. if (SecFlg==0x22 && (Secwt&0x40))
  1208. Secwt = 0x04;
  1209. if (Priwt==0x3500)
  1210. Priwt = 0x4400;
  1211. }
  1212. for (pbMasks=pbIgnore; *pbMasks; pbMasks+=4)
  1213. {
  1214. unsigned int nIgnore;
  1215. nIgnore = (pbMasks[2] << 8) + pbMasks[3];
  1216. if( (g_dwFlags & nIgnore) && (SecFlg&pbMasks[1]) )
  1217. {
  1218. Secwt &= ~pbMasks[0];
  1219. SecFlg &= ~pbMasks[1];
  1220. }
  1221. }
  1222. }
  1223. pcompstrinfo->priwt = Priwt;
  1224. pcompstrinfo->secwt = Secwt;
  1225. pcompstrinfo->secflg = SecFlg;
  1226. *plpstr1 = lpstr1;
  1227. return(cch1);
  1228. }
  1229. /* EOF */