transliterator.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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: Gustavo Lopes <cataphract@php.net> |
  12. +----------------------------------------------------------------------+
  13. */
  14. #ifdef HAVE_CONFIG_H
  15. #include "config.h"
  16. #endif
  17. #include "transliterator_class.h"
  18. #include "transliterator.h"
  19. #include "intl_convert.h"
  20. #include <unicode/ustring.h>
  21. /* {{{ transliterator_register_constants
  22. * Register constants common for both (OO and procedural) APIs.
  23. */
  24. void transliterator_register_constants( INIT_FUNC_ARGS )
  25. {
  26. if( !Transliterator_ce_ptr )
  27. {
  28. zend_error( E_ERROR, "Transliterator class not defined" );
  29. return;
  30. }
  31. #define TRANSLITERATOR_EXPOSE_CONST( x ) REGISTER_LONG_CONSTANT( #x, x, CONST_PERSISTENT | CONST_CS )
  32. #define TRANSLITERATOR_EXPOSE_CLASS_CONST( x ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( #x ) - 1, TRANSLITERATOR_##x );
  33. #define TRANSLITERATOR_EXPOSE_CUSTOM_CLASS_CONST( name, value ) zend_declare_class_constant_long( Transliterator_ce_ptr, ZEND_STRS( name ) - 1, value );*/
  34. /* Normalization form constants */
  35. TRANSLITERATOR_EXPOSE_CLASS_CONST( FORWARD );
  36. TRANSLITERATOR_EXPOSE_CLASS_CONST( REVERSE );
  37. #undef NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST
  38. #undef NORMALIZER_EXPOSE_CLASS_CONST
  39. #undef NORMALIZER_EXPOSE_CONST
  40. }
  41. /* }}} */