74#define UC_CASE_IGNORABLE 36
98static inline int php_unicode_is_lower(
unsigned long code) {
100 return code >= 0x61 && code <= 0x7A;
106static inline int php_unicode_is_upper(
unsigned long code) {
108 return code >= 0x41 && code <= 0x5A;
114#define php_unicode_is_alpha(cc) php_unicode_is_prop(cc, UC_LU, UC_LL, UC_LM, UC_LO, UC_LT, -1)
115#define php_unicode_is_digit(cc) php_unicode_is_prop1(cc, UC_ND)
116#define php_unicode_is_alnum(cc) php_unicode_is_prop(cc, UC_LU, UC_LL, UC_LM, UC_LO, UC_LT, UC_ND, -1)
117#define php_unicode_is_cntrl(cc) php_unicode_is_prop1(cc, UC_C)
118#define php_unicode_is_blank(cc) php_unicode_is_prop1(cc, UC_ZS)
119#define php_unicode_is_punct(cc) php_unicode_is_prop1(cc, UC_P)
120#define php_unicode_is_graph(cc) php_unicode_is_prop(cc, \
121 UC_MN, UC_MC, UC_ME, UC_ND, UC_NL, UC_NO, \
122 UC_LU, UC_LL, UC_LT, UC_LM, UC_LO, UC_P, \
123 UC_SM, UC_SM, UC_SC, UC_SK, UC_SO, -1)
124#define php_unicode_is_print(cc) php_unicode_is_prop(cc, \
125 UC_MN, UC_MC, UC_ME, UC_ND, UC_NL, UC_NO, \
126 UC_LU, UC_LL, UC_LT, UC_LM, UC_LO, UC_P, \
127 UC_SM, UC_SM, UC_SC, UC_SK, UC_SO, UC_ZS, -1)
128#define php_unicode_is_title(cc) php_unicode_is_prop1(cc, UC_LT)
130#define php_unicode_is_symbol(cc) php_unicode_is_prop(cc, UC_SM, UC_SC, UC_SO, UC_SK, -1)
131#define php_unicode_is_number(cc) php_unicode_is_prop(cc, UC_ND, UC_NO, UC_NL, -1)
132#define php_unicode_is_nonspacing(cc) php_unicode_is_prop1(cc, UC_MN)
137#define php_unicode_is_rtl(cc) php_unicode_is_prop1(cc, UC_R)
138#define php_unicode_is_ltr(cc) php_unicode_is_prop1(cc, UC_L)
139#define php_unicode_is_strong(cc) php_unicode_is_prop(cc, UC_L, UC_R, -1)
140#define php_unicode_is_weak(cc) php_unicode_is_prop(cc, UC_EN, UC_ES, UC_ET, UC_AN, UC_CS, -1)
141#define php_unicode_is_neutral(cc) php_unicode_is_prop(cc, UC_B, UC_S, UC_WS, UC_ON, -1)
142#define php_unicode_is_separator(cc) php_unicode_is_prop(cc, UC_B, UC_S, -1)
147#define php_unicode_is_mark(cc) php_unicode_is_prop(cc, UC_MN, UC_MC, UC_ME, -1)
148#define php_unicode_is_modif(cc) php_unicode_is_prop1(cc, UC_LM)
149#define php_unicode_is_letnum(cc) php_unicode_is_prop1(cc, UC_NL)
150#define php_unicode_is_math(cc) php_unicode_is_prop1(cc, UC_SM)
151#define php_unicode_is_currency(cc) php_unicode_is_prop1(cc, UC_SC)
152#define php_unicode_is_modifsymbol(cc) php_unicode_is_prop1(cc, UC_SK)
153#define php_unicode_is_nsmark(cc) php_unicode_is_prop1(cc, UC_MN)
154#define php_unicode_is_spmark(cc) php_unicode_is_prop1(cc, UC_MC)
155#define php_unicode_is_enclosing(cc) php_unicode_is_prop1(cc, UC_ME)
156#define php_unicode_is_private(cc) php_unicode_is_prop1(cc, UC_CO)
157#define php_unicode_is_surrogate(cc) php_unicode_is_prop1(cc, UC_OS)
158#define php_unicode_is_lsep(cc) php_unicode_is_prop1(cc, UC_ZL)
159#define php_unicode_is_psep(cc) php_unicode_is_prop1(cc, UC_ZP)
164#define php_unicode_is_han(cc) (((cc) >= 0x4e00 && (cc) <= 0x9fff) ||\
165 ((cc) >= 0xf900 && (cc) <= 0xfaff))
166#define php_unicode_is_hangul(cc) ((cc) >= 0xac00 && (cc) <= 0xd7ff)
172#define php_unicode_is_cased(cc) php_unicode_is_prop1(cc, UC_CASED)
173#define php_unicode_is_case_ignorable(cc) php_unicode_is_prop1(cc, UC_CASE_IGNORABLE)
MBSTRING_API zend_string * php_unicode_convert_case(php_case_mode case_mode, const char *srcstr, size_t srclen, const mbfl_encoding *src_encoding, const mbfl_encoding *dst_encoding, int illegal_mode, uint32_t illegal_substchar)
MBSTRING_API bool php_unicode_is_prop1(unsigned long code, int prop)
MBSTRING_API bool php_unicode_is_prop(unsigned long code,...)
@ PHP_UNICODE_CASE_LOWER_SIMPLE
@ PHP_UNICODE_CASE_FOLD_SIMPLE
@ PHP_UNICODE_CASE_UPPER_SIMPLE
@ PHP_UNICODE_CASE_TITLE_SIMPLE
@ PHP_UNICODE_CASE_MODE_MAX
struct _zend_string zend_string