Back to index

php5  5.3.10
normalizer.c
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | This source file is subject to version 3.01 of the PHP license,      |
00006    | that is bundled with this package in the file LICENSE, and is        |
00007    | available through the world-wide-web at the following url:           |
00008    | http://www.php.net/license/3_01.txt                                  |
00009    | If you did not receive a copy of the PHP license and are unable to   |
00010    | obtain it through the world-wide-web, please send a note to          |
00011    | license@php.net so we can mail you a copy immediately.               |
00012    +----------------------------------------------------------------------+
00013    | Authors: Ed Batutis <ed@batutis.com>                                 |
00014    +----------------------------------------------------------------------+
00015  */
00016 
00017 #ifdef HAVE_CONFIG_H
00018 #include "config.h"
00019 #endif
00020 
00021 #include "normalizer_class.h"
00022 #include "normalizer.h"
00023 
00024 #include <unicode/utypes.h>
00025 #include <unicode/unorm.h>
00026 #include <unicode/ustring.h>
00027 
00028 /* {{{ normalizer_register_constants
00029  * Register constants common for the both (OO and procedural)
00030  * APIs.
00031  */
00032 void normalizer_register_constants( INIT_FUNC_ARGS )
00033 {
00034        if( !Normalizer_ce_ptr )
00035        {
00036               zend_error( E_ERROR, "Normalizer class not defined" );
00037               return;
00038        }
00039 
00040        #define NORMALIZER_EXPOSE_CONST(x) REGISTER_LONG_CONSTANT(#x, x, CONST_CS)
00041        #define NORMALIZER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( #x ) - 1, NORMALIZER_##x TSRMLS_CC );
00042        #define NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST(name, value) zend_declare_class_constant_long( Normalizer_ce_ptr, ZEND_STRS( name ) - 1, value TSRMLS_CC );
00043 
00044        /* Normalization form constants */
00045        NORMALIZER_EXPOSE_CLASS_CONST( NONE );
00046        NORMALIZER_EXPOSE_CLASS_CONST( FORM_D );
00047        NORMALIZER_EXPOSE_CLASS_CONST( NFD );
00048        NORMALIZER_EXPOSE_CLASS_CONST( FORM_KD );
00049        NORMALIZER_EXPOSE_CLASS_CONST( NFKD );
00050        NORMALIZER_EXPOSE_CLASS_CONST( FORM_C );
00051        NORMALIZER_EXPOSE_CLASS_CONST( NFC );
00052        NORMALIZER_EXPOSE_CLASS_CONST( FORM_KC );
00053        NORMALIZER_EXPOSE_CLASS_CONST( NFKC );
00054 
00055        #undef NORMALIZER_EXPOSE_CUSTOM_CLASS_CONST
00056        #undef NORMALIZER_EXPOSE_CLASS_CONST
00057        #undef NORMALIZER_EXPOSE_CONST
00058 }
00059 /* }}} */
00060 
00061 /*
00062  * Local variables:
00063  * tab-width: 4
00064  * c-basic-offset: 4
00065  * End:
00066  * vim600: noet sw=4 ts=4 fdm=marker
00067  * vim<600: noet sw=4 ts=4
00068  */