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: Vadim Savchuk <vsavchuk@productengine.com> | 12 | Dmitry Lakhtyuk <dlakhtyuk@productengine.com> | 13 | Stanislav Malyshev <stas@zend.com> | 14 +----------------------------------------------------------------------+ 15 */ 16 17 #ifndef INTL_COMMON_H 18 #define INTL_COMMON_H 19 /* Auxiliary macros */ 20 21 BEGIN_EXTERN_C() 22 #include <php.h> 23 END_EXTERN_C() 24 #include <unicode/utypes.h> 25 26 #ifndef UBYTES 27 # define UBYTES(len) ((len) * sizeof(UChar)) 28 #endif 29 30 #ifndef eumalloc 31 # define eumalloc(size) (UChar*)safe_emalloc(size, sizeof(UChar), 0) 32 #endif 33 34 #ifndef eurealloc 35 # define eurealloc(ptr, size) (UChar*)erealloc((ptr), size * sizeof(UChar)) 36 #endif 37 38 #define USIZE(data) sizeof((data))/sizeof(UChar) 39 #define UCHARS(len) ((len) / sizeof(UChar)) 40 41 #define INTL_ZSTR_VAL(str) (UChar*) ZSTR_VAL(str) 42 #define INTL_ZSTR_LEN(str) UCHARS(ZSTR_LEN(str)) 43 44 BEGIN_EXTERN_C() 45 extern zend_class_entry *IntlException_ce_ptr; 46 END_EXTERN_C() 47 48 #endif /* INTL_COMMON_H */ 49