1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 7                                                        |
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 
17 #include "normalizer_class.h"
18 #include "php_intl.h"
19 #include "normalizer_normalize.h"
20 #include "intl_error.h"
21 
22 #include <unicode/unorm.h>
23 
24 zend_class_entry *Normalizer_ce_ptr = NULL;
25 
26 /*
27  * 'Normalizer' class registration structures & functions
28  */
29 
30 /* {{{ Normalizer methods arguments info */
31 
32 ZEND_BEGIN_ARG_INFO_EX( normalizer_args, 0, 0, 1 )
33 	ZEND_ARG_INFO( 0, input )
34 	ZEND_ARG_INFO( 0, form )
35 ZEND_END_ARG_INFO()
36 
37 /* }}} */
38 
39 /* {{{ Normalizer_class_functions
40  * Every 'Normalizer' class method has an entry in this table
41  */
42 
43 zend_function_entry Normalizer_class_functions[] = {
44 	ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
45 	ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
46 	PHP_FE_END
47 };
48 /* }}} */
49 
50 /* {{{ normalizer_register_Normalizer_class
51  * Initialize 'Normalizer' class
52  */
normalizer_register_Normalizer_class(void)53 void normalizer_register_Normalizer_class( void )
54 {
55 	zend_class_entry ce;
56 
57 	/* Create and register 'Normalizer' class. */
58 	INIT_CLASS_ENTRY( ce, "Normalizer", Normalizer_class_functions );
59 	ce.create_object = NULL;
60 	Normalizer_ce_ptr = zend_register_internal_class( &ce );
61 
62 	/* Declare 'Normalizer' class properties. */
63 	if( !Normalizer_ce_ptr )
64 	{
65 		zend_error( E_ERROR,
66 			"Normalizer: attempt to create properties "
67 			"on a non-registered class." );
68 		return;
69 	}
70 }
71 /* }}} */
72 
73 /*
74  * Local variables:
75  * tab-width: 4
76  * c-basic-offset: 4
77  * End:
78  * vim600: noet sw=4 ts=4 fdm=marker
79  * vim<600: noet sw=4 ts=4
80  */
81