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.

51 lines
1.1 KiB

  1. // uni.h
  2. // Unicode api
  3. // Copyright 1998 Microsoft Corp.
  4. //
  5. // Modification History:
  6. // 16 MAR 00 bhshin porting for WordBreaker from uni.c
  7. #ifndef _UNI_H_
  8. #define _UNI_H_
  9. #define HANGUL_CHOSEONG 0x1100
  10. #define HANGUL_CHOSEONG_MAX 0x1159
  11. #define HANGUL_JUNGSEONG 0x1161
  12. #define HANGUL_JUNGSEONG_MAX 0x11A2
  13. #define HANGUL_JONGSEONG 0x11A8
  14. #define HANGUL_JONGSEONG_MAX 0x11F9
  15. // fIsC
  16. //
  17. // return fTrue if the given char is a consonant (ChoSeong or JungSeong)
  18. //
  19. // this assumes that the text has already been decomposed and
  20. // normalized
  21. //
  22. // 24NOV98 GaryKac began
  23. __inline int
  24. fIsC(WCHAR wch)
  25. {
  26. return ((wch >= HANGUL_CHOSEONG && wch <= HANGUL_CHOSEONG_MAX) ||
  27. (wch >= HANGUL_JONGSEONG && wch <= HANGUL_JONGSEONG_MAX)) ? TRUE : FALSE;
  28. }
  29. // fIsV
  30. //
  31. // return fTrue if the given char is a vowel (JongSeong)
  32. //
  33. // this assumes that the text has already been decomposed and
  34. // normalized
  35. //
  36. // 24NOV98 GaryKac began
  37. __inline int
  38. fIsV(WCHAR wch)
  39. {
  40. return (wch >= HANGUL_JUNGSEONG && wch <= HANGUL_JUNGSEONG_MAX) ? TRUE : FALSE;
  41. }
  42. #endif // _UNI_H_