Back to index

php5  5.3.10
intl_common.h
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: Vadim Savchuk <vsavchuk@productengine.com>                  |
00014    |          Dmitry Lakhtyuk <dlakhtyuk@productengine.com>               |
00015    |          Stanislav Malyshev <stas@zend.com>                          |
00016    +----------------------------------------------------------------------+
00017  */
00018 
00019 #ifndef INTL_COMMON_H
00020 #define INTL_COMMON_H
00021 /* Auxiliary macros */
00022 
00023 #include <php.h>
00024 #include <unicode/utypes.h>
00025 
00026 #ifndef UBYTES
00027 # define UBYTES(len) ((len) * sizeof(UChar))
00028 #endif
00029 
00030 #ifndef eumalloc
00031 # define eumalloc(size)  (UChar*)safe_emalloc(size, sizeof(UChar), 0)
00032 #endif
00033 
00034 #ifndef eurealloc
00035 # define eurealloc(ptr, size)  (UChar*)erealloc((ptr), size * sizeof(UChar))
00036 #endif
00037 
00038 #define USIZE(data) sizeof((data))/sizeof(UChar)
00039 #define UCHARS(len) ((len) / sizeof(UChar))
00040 
00041 #define INTL_Z_STRVAL_P(str) (UChar*) Z_STRVAL_P(str)
00042 #define INTL_Z_STRLEN_P(str) UCHARS( Z_STRLEN_P(str) )
00043 
00044 #endif /* INTL_COMMON_H */