normalizer_class.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | This source file is subject to version 3.01 of the PHP license, |
  6. | that is bundled with this package in the file LICENSE, and is |
  7. | available through the world-wide-web at the following url: |
  8. | http://www.php.net/license/3_01.txt |
  9. | If you did not receive a copy of the PHP license and are unable to |
  10. | obtain it through the world-wide-web, please send a note to |
  11. | license@php.net so we can mail you a copy immediately. |
  12. +----------------------------------------------------------------------+
  13. | Authors: Ed Batutis <ed@batutis.com> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #include "normalizer_class.h"
  17. #include "php_intl.h"
  18. #include "normalizer_normalize.h"
  19. #include "intl_error.h"
  20. #include <unicode/unorm.h>
  21. zend_class_entry *Normalizer_ce_ptr = NULL;
  22. /*
  23. * 'Normalizer' class registration structures & functions
  24. */
  25. /* {{{ Normalizer methods arguments info */
  26. ZEND_BEGIN_ARG_INFO_EX( normalizer_3_args, 0, 0, 3 )
  27. ZEND_ARG_INFO( 0, arg1 )
  28. ZEND_ARG_INFO( 0, arg2 )
  29. ZEND_ARG_INFO( 0, arg3 )
  30. ZEND_END_ARG_INFO()
  31. /* }}} */
  32. /* {{{ Normalizer_class_functions
  33. * Every 'Normalizer' class method has an entry in this table
  34. */
  35. zend_function_entry Normalizer_class_functions[] = {
  36. ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
  37. ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
  38. PHP_FE_END
  39. };
  40. /* }}} */
  41. /* {{{ normalizer_register_Normalizer_class
  42. * Initialize 'Normalizer' class
  43. */
  44. void normalizer_register_Normalizer_class( TSRMLS_D )
  45. {
  46. zend_class_entry ce;
  47. /* Create and register 'Normalizer' class. */
  48. INIT_CLASS_ENTRY( ce, "Normalizer", Normalizer_class_functions );
  49. ce.create_object = NULL;
  50. Normalizer_ce_ptr = zend_register_internal_class( &ce TSRMLS_CC );
  51. /* Declare 'Normalizer' class properties. */
  52. if( !Normalizer_ce_ptr )
  53. {
  54. zend_error( E_ERROR,
  55. "Normalizer: attempt to create properties "
  56. "on a non-registered class." );
  57. return;
  58. }
  59. }
  60. /* }}} */
  61. /*
  62. * Local variables:
  63. * tab-width: 4
  64. * c-basic-offset: 4
  65. * End:
  66. * vim600: noet sw=4 ts=4 fdm=marker
  67. * vim<600: noet sw=4 ts=4
  68. */