Lines Matching refs:start
26 static unsigned int check_mb_utf8mb3_sequence(const char * const start, const char * const end) in check_mb_utf8mb3_sequence() argument
30 if (start >= end) { in check_mb_utf8mb3_sequence()
34 c = (zend_uchar) start[0]; in check_mb_utf8mb3_sequence()
43 if (start + 2 > end) { in check_mb_utf8mb3_sequence()
46 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40)) { in check_mb_utf8mb3_sequence()
52 if (start + 3 > end) { in check_mb_utf8mb3_sequence()
55 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8mb3_sequence()
56 (c >= 0xE1 || (zend_uchar)start[1] >= 0xA0))) { in check_mb_utf8mb3_sequence()
65 static unsigned int check_mb_utf8_sequence(const char * const start, const char * const end) in check_mb_utf8_sequence() argument
69 if (start >= end) { in check_mb_utf8_sequence()
73 c = (zend_uchar) start[0]; in check_mb_utf8_sequence()
82 if (start + 2 > end) { in check_mb_utf8_sequence()
85 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40)) { in check_mb_utf8_sequence()
91 if (start + 3 > end) { in check_mb_utf8_sequence()
94 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
95 (c >= 0xE1 || (zend_uchar)start[1] >= 0xA0))) { in check_mb_utf8_sequence()
101 if (start + 4 > end) { /* We need 4 characters */ in check_mb_utf8_sequence()
124 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
125 ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
126 ((zend_uchar)start[3] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
127 (c >= 0xf1 || (zend_uchar)start[1] >= 0x90) && in check_mb_utf8_sequence()
128 (c <= 0xf3 || (zend_uchar)start[1] <= 0x8F))) in check_mb_utf8_sequence()
137 static unsigned int check_mb_utf8mb3_valid(const char * const start, const char * const end) in check_mb_utf8mb3_valid() argument
139 unsigned int len = check_mb_utf8mb3_sequence(start, end); in check_mb_utf8mb3_valid()
143 static unsigned int check_mb_utf8_valid(const char * const start, const char * const end) in check_mb_utf8_valid() argument
145 unsigned int len = check_mb_utf8_sequence(start, end); in check_mb_utf8_valid()
197 static unsigned int check_mb_big5(const char * const start, const char * const end) in check_mb_big5() argument
199 return (valid_big5head(*(start)) && (end - start) > 1 && valid_big5tail(*(start + 1)) ? 2 : 0); in check_mb_big5()
215 static unsigned int check_mb_cp932(const char * const start, const char * const end) in check_mb_cp932() argument
217 return (valid_cp932head((zend_uchar)start[0]) && (end - start > 1) && in check_mb_cp932()
218 valid_cp932tail((zend_uchar)start[1])) ? 2 : 0; in check_mb_cp932()
232 static unsigned int check_mb_euckr(const char * const start, const char * const end) in check_mb_euckr() argument
234 if (end - start <= 1) { in check_mb_euckr()
237 if (*(zend_uchar *)start < 0x80) { in check_mb_euckr()
240 if (valid_euckr(start[1])) { in check_mb_euckr()
260 static unsigned int check_mb_eucjpms(const char * const start, const char * const end) in check_mb_eucjpms() argument
262 if (*((zend_uchar *)start) < 0x80) { in check_mb_eucjpms()
265 if (valid_eucjpms(start[0]) && (end - start) > 1 && valid_eucjpms(start[1])) { in check_mb_eucjpms()
268 if (valid_eucjpms_ss2(start[0]) && (end - start) > 1 && valid_eucjpms_kata(start[1])) { in check_mb_eucjpms()
271 if (valid_eucjpms_ss3(start[0]) && (end - start) > 2 && valid_eucjpms(start[1]) && in check_mb_eucjpms()
272 valid_eucjpms(start[2])) { in check_mb_eucjpms()
297 static unsigned int check_mb_gb2312(const char * const start, const char * const end) in check_mb_gb2312() argument
299 return (valid_gb2312_head((unsigned int)start[0]) && end - start > 1 && in check_mb_gb2312()
300 valid_gb2312_tail((unsigned int)start[1])) ? 2 : 0; in check_mb_gb2312()
315 static unsigned int check_mb_gbk(const char * const start, const char * const end) in check_mb_gbk() argument
317 return (valid_gbk_head(start[0]) && (end) - (start) > 1 && valid_gbk_tail(start[1])) ? 2 : 0; in check_mb_gbk()
332 static unsigned int check_mb_sjis(const char * const start, const char * const end) in check_mb_sjis() argument
334 …return (valid_sjis_head((zend_uchar)start[0]) && (end - start) > 1 && valid_sjis_tail((zend_uchar)… in check_mb_sjis()
346 static unsigned int check_mb_ucs2(const char * const start __attribute((unused)), const char * cons… in check_mb_ucs2()
364 static unsigned int check_mb_ujis(const char * const start, const char * const end) in check_mb_ujis() argument
366 if (*(zend_uchar*)start < 0x80) { in check_mb_ujis()
369 if (valid_ujis(*(start)) && valid_ujis(*((start)+1))) { in check_mb_ujis()
372 if (valid_ujis_ss2(*(start)) && valid_ujis_kata(*((start)+1))) { in check_mb_ujis()
375 …if (valid_ujis_ss3(*(start)) && (end-start) > 2 && valid_ujis(*((start)+1)) && valid_ujis(*((start… in check_mb_ujis()
394 static unsigned int check_mb_utf16(const char * const start, const char * const end) in check_mb_utf16() argument
396 if (start + 2 > end) { in check_mb_utf16()
400 if (UTF16_HIGH_HEAD(*start)) { in check_mb_utf16()
401 return (start + 4 <= end) && UTF16_LOW_HEAD(start[2]) ? 4 : 0; in check_mb_utf16()
404 if (UTF16_LOW_HEAD(*start)) { in check_mb_utf16()
419 static unsigned int check_mb_utf32(const char * const start __attribute((unused)), const char * con… in check_mb_utf32()
457 static unsigned int my_ismbchar_gb18030(const char * start, const char * end) in my_ismbchar_gb18030() argument
459 if (end - start <= 1 || !is_gb18030_odd(start[0])) { in my_ismbchar_gb18030()
463 if (is_gb18030_even_2(start[1])) { in my_ismbchar_gb18030()
465 …} else if (end - start > 3 && is_gb18030_even_4(start[1]) && is_gb18030_odd(start[2]) && is_gb1803… in my_ismbchar_gb18030()