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