normalizer.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. +----------------------------------------------------------------------+
  3. | This source file is subject to version 3.01 of the PHP license, |
  4. | that is bundled with this package in the file LICENSE, and is |
  5. | available through the world-wide-web at the following url: |
  6. | https://www.php.net/license/3_01.txt |
  7. | If you did not receive a copy of the PHP license and are unable to |
  8. | obtain it through the world-wide-web, please send a note to |
  9. | license@php.net so we can mail you a copy immediately. |
  10. +----------------------------------------------------------------------+
  11. | Authors: Ed Batutis <ed@batutis.com> |
  12. +----------------------------------------------------------------------+
  13. */
  14. #ifndef NORMALIZER_NORMALIZER_H
  15. #define NORMALIZER_NORMALIZER_H
  16. #include <php.h>
  17. #include <unicode/utypes.h>
  18. #if U_ICU_VERSION_MAJOR_NUM < 56
  19. #include <unicode/unorm.h>
  20. #define NORMALIZER_FORM_D UNORM_NFD
  21. #define NORMALIZER_NFD UNORM_NFD
  22. #define NORMALIZER_FORM_KD UNORM_NFKD
  23. #define NORMALIZER_NFKD UNORM_NFKD
  24. #define NORMALIZER_FORM_C UNORM_NFC
  25. #define NORMALIZER_NFC UNORM_NFC
  26. #define NORMALIZER_FORM_KC UNORM_NFKC
  27. #define NORMALIZER_NFKC UNORM_NFKC
  28. #define NORMALIZER_DEFAULT UNORM_DEFAULT
  29. #else
  30. #include <unicode/unorm2.h>
  31. #define NORMALIZER_FORM_D 0x4
  32. #define NORMALIZER_NFD NORMALIZER_FORM_D
  33. #define NORMALIZER_FORM_KD 0x8
  34. #define NORMALIZER_NFKD NORMALIZER_FORM_KD
  35. #define NORMALIZER_FORM_C 0x10
  36. #define NORMALIZER_NFC NORMALIZER_FORM_C
  37. #define NORMALIZER_FORM_KC 0x20
  38. #define NORMALIZER_NFKC NORMALIZER_FORM_KC
  39. #define NORMALIZER_FORM_KC_CF 0x30
  40. #define NORMALIZER_NFKC_CF NORMALIZER_FORM_KC_CF
  41. #define NORMALIZER_DEFAULT NORMALIZER_FORM_C
  42. #endif
  43. void normalizer_register_constants( INIT_FUNC_ARGS );
  44. #endif // NORMALIZER_NORMALIZER_H