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.

126 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1991-2000, Microsoft Corporation All rights reserved.
  3. Module Name:
  4. jamo.h
  5. Abstract:
  6. This file contains the header information for the sorting of Old Hangul.
  7. Revision History:
  8. 06-23-2000 YSLin Created.
  9. --*/
  10. #ifndef _JAMO_H
  11. #define _JAMO_H
  12. ////////////////////////////////////////////////////////////////////////////
  13. //
  14. // Constant Declarations.
  15. //
  16. ////////////////////////////////////////////////////////////////////////////
  17. //
  18. // Some Significant Values for Korean Jamo.
  19. //
  20. #define NLS_CHAR_FIRST_JAMO L'\x1100' // Beginning of the jamo range
  21. #define NLS_CHAR_LAST_JAMO L'\x11f9' // End of the jamo range
  22. #define NLS_CHAR_FIRST_VOWEL_JAMO L'\x1160' // First Vowel Jamo
  23. #define NLS_CHAR_FIRST_TRAILING_JAMO L'\x11a8' // First Trailing Jamo
  24. #define NLS_JAMO_VOWEL_COUNT 21 // Number of modern vowel jamo
  25. #define NLS_JAMO_TRAILING_COUNT 28 // Number of modern trailing consonant jamo
  26. #define NLS_HANGUL_FIRST_SYLLABLE L'\xac00' // Beginning of the modern syllable range
  27. //
  28. // Jamo classes for leading Jamo/Vowel Jamo/Trailing Jamo.
  29. //
  30. #define NLS_CLASS_LEADING_JAMO 1
  31. #define NLS_CLASS_VOWEL_JAMO 2
  32. #define NLS_CLASS_TRAILING_JAMO 3
  33. ////////////////////////////////////////////////////////////////////////////
  34. //
  35. // Typedef Declarations.
  36. //
  37. ////////////////////////////////////////////////////////////////////////////
  38. //
  39. // Expanded Jamo Sequence Sorting Info.
  40. // The JAMO_SORT_INFO.ExtraWeight is expanded to
  41. // Leading Weight/Vowel Weight/Trailing Weight
  42. // according to the current Jamo class.
  43. //
  44. typedef struct {
  45. BYTE m_bOld; // sequence occurs only in old Hangul flag
  46. BOOL m_bFiller; // Indicate if U+1160 (Hangul Jungseong Filler is used.
  47. CHAR m_chLeadingIndex; // indices used to locate the prior
  48. CHAR m_chVowelIndex; // modern Hangul syllable
  49. CHAR m_chTrailingIndex; //
  50. BYTE m_LeadingWeight; // extra weights that distinguish this from
  51. BYTE m_VowelWeight; // other old Hangul syllables
  52. BYTE m_TrailingWeight; //
  53. } JAMO_SORT_INFOEX, *PJAMO_SORT_INFOEX;
  54. ////////////////////////////////////////////////////////////////////////////
  55. //
  56. // Macro Definitions.
  57. //
  58. ////////////////////////////////////////////////////////////////////////////
  59. #define IS_JAMO(wch) \
  60. ((wch) >= NLS_CHAR_FIRST_JAMO && (wch) <= NLS_CHAR_LAST_JAMO)
  61. #define IsJamo(wch) \
  62. ((wch) >= NLS_CHAR_FIRST_JAMO && (wch) <= NLS_CHAR_LAST_JAMO)
  63. #define IsLeadingJamo(wch) \
  64. ((wch) < NLS_CHAR_FIRST_VOWEL_JAMO)
  65. #define IsVowelJamo(wch) \
  66. ((wch) >= NLS_CHAR_FIRST_VOWEL_JAMO && (wch) < NLS_CHAR_FIRST_TRAILING_JAMO)
  67. #define IsTrailingJamo(wch) \
  68. ((wch) >= NLS_CHAR_FIRST_TRAILING_JAMO)
  69. ////////////////////////////////////////////////////////////////////////////
  70. //
  71. // Function Prototypes.
  72. //
  73. ////////////////////////////////////////////////////////////////////////////
  74. int
  75. MapOldHangulSortKey(
  76. PLOC_HASH pHashN,
  77. LPCWSTR pSrc, // source string
  78. int cchSrc, // the length of the string
  79. // LPWSTR* pPosUW, // generated Unicode weight
  80. WORD* pUW, // generated Unicode weight
  81. LPBYTE pXW, // generated extra weight (3 bytes)
  82. BOOL fModify);
  83. #endif // _JAMO_H