Lines Matching refs:start

29 static unsigned int check_mb_utf8mb3_sequence(const char *start, const char *end)  in check_mb_utf8mb3_sequence()  argument
33 if (start >= end) { in check_mb_utf8mb3_sequence()
37 c = (zend_uchar) start[0]; in check_mb_utf8mb3_sequence()
46 if (start + 2 > end) { in check_mb_utf8mb3_sequence()
49 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40)) { in check_mb_utf8mb3_sequence()
55 if (start + 3 > end) { in check_mb_utf8mb3_sequence()
58 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8mb3_sequence()
59 (c >= 0xE1 || (zend_uchar)start[1] >= 0xA0))) { in check_mb_utf8mb3_sequence()
68 static unsigned int check_mb_utf8_sequence(const char *start, const char *end) in check_mb_utf8_sequence() argument
72 if (start >= end) { in check_mb_utf8_sequence()
76 c = (zend_uchar) start[0]; in check_mb_utf8_sequence()
85 if (start + 2 > end) { in check_mb_utf8_sequence()
88 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40)) { in check_mb_utf8_sequence()
94 if (start + 3 > end) { in check_mb_utf8_sequence()
97 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
98 (c >= 0xE1 || (zend_uchar)start[1] >= 0xA0))) { in check_mb_utf8_sequence()
104 if (start + 4 > end) { /* We need 4 characters */ in check_mb_utf8_sequence()
127 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
128 ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
129 ((zend_uchar)start[3] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
130 (c >= 0xf1 || (zend_uchar)start[1] >= 0x90) && in check_mb_utf8_sequence()
131 (c <= 0xf3 || (zend_uchar)start[1] <= 0x8F))) in check_mb_utf8_sequence()
140 static unsigned int check_mb_utf8mb3_valid(const char *start, const char *end) in check_mb_utf8mb3_valid() argument
142 unsigned int len = check_mb_utf8mb3_sequence(start, end); in check_mb_utf8mb3_valid()
146 static unsigned int check_mb_utf8_valid(const char *start, const char *end) in check_mb_utf8_valid() argument
148 unsigned int len = check_mb_utf8_sequence(start, end); in check_mb_utf8_valid()
200 static unsigned int check_mb_big5(const char *start, const char *end) in check_mb_big5() argument
202 return (valid_big5head(*(start)) && (end - start) > 1 && valid_big5tail(*(start + 1)) ? 2 : 0); in check_mb_big5()
218 static unsigned int check_mb_cp932(const char *start, const char *end) in check_mb_cp932() argument
220 return (valid_cp932head((zend_uchar)start[0]) && (end - start > 1) && in check_mb_cp932()
221 valid_cp932tail((zend_uchar)start[1])) ? 2 : 0; in check_mb_cp932()
235 static unsigned int check_mb_euckr(const char *start, const char *end) in check_mb_euckr() argument
237 if (end - start <= 1) { in check_mb_euckr()
240 if (*(zend_uchar *)start < 0x80) { in check_mb_euckr()
243 if (valid_euckr(start[1])) { in check_mb_euckr()
263 static unsigned int check_mb_eucjpms(const char *start, const char *end) in check_mb_eucjpms() argument
265 if (*((zend_uchar *)start) < 0x80) { in check_mb_eucjpms()
268 if (valid_eucjpms(start[0]) && (end - start) > 1 && valid_eucjpms(start[1])) { in check_mb_eucjpms()
271 if (valid_eucjpms_ss2(start[0]) && (end - start) > 1 && valid_eucjpms_kata(start[1])) { in check_mb_eucjpms()
274 if (valid_eucjpms_ss3(start[0]) && (end - start) > 2 && valid_eucjpms(start[1]) && in check_mb_eucjpms()
275 valid_eucjpms(start[2])) { in check_mb_eucjpms()
300 static unsigned int check_mb_gb2312(const char *start, const char *end) in check_mb_gb2312() argument
302 return (valid_gb2312_head((unsigned int)start[0]) && end - start > 1 && in check_mb_gb2312()
303 valid_gb2312_tail((unsigned int)start[1])) ? 2 : 0; in check_mb_gb2312()
318 static unsigned int check_mb_gbk(const char *start, const char *end) in check_mb_gbk() argument
320 return (valid_gbk_head(start[0]) && (end) - (start) > 1 && valid_gbk_tail(start[1])) ? 2 : 0; in check_mb_gbk()
335 static unsigned int check_mb_sjis(const char *start, const char *end) in check_mb_sjis() argument
337 …return (valid_sjis_head((zend_uchar)start[0]) && (end - start) > 1 && valid_sjis_tail((zend_uchar) in check_mb_sjis()
349 static unsigned int check_mb_ucs2(const char *start __attribute((unused)), const char *end __attrib… in check_mb_ucs2()
367 static unsigned int check_mb_ujis(const char *start, const char *end) in check_mb_ujis() argument
369 if (*(zend_uchar*)start < 0x80) { in check_mb_ujis()
372 if (valid_ujis(*(start)) && valid_ujis(*((start)+1))) { in check_mb_ujis()
375 if (valid_ujis_ss2(*(start)) && valid_ujis_kata(*((start)+1))) { in check_mb_ujis()
378 …if (valid_ujis_ss3(*(start)) && (end-start) > 2 && valid_ujis(*((start)+1)) && valid_ujis(*((start in check_mb_ujis()
397 static unsigned int check_mb_utf16(const char *start, const char *end) in check_mb_utf16() argument
399 if (start + 2 > end) { in check_mb_utf16()
403 if (UTF16_HIGH_HEAD(*start)) { in check_mb_utf16()
404 return (start + 4 <= end) && UTF16_LOW_HEAD(start[2]) ? 4 : 0; in check_mb_utf16()
407 if (UTF16_LOW_HEAD(*start)) { in check_mb_utf16()
422 static unsigned int check_mb_utf32(const char *start __attribute((unused)), const char *end __attri… in check_mb_utf32()
460 static unsigned int my_ismbchar_gb18030(const char * start, const char * end) in my_ismbchar_gb18030() argument
462 if (end - start <= 1 || !is_gb18030_odd(start[0])) { in my_ismbchar_gb18030()
466 if (is_gb18030_even_2(start[1])) { in my_ismbchar_gb18030()
468 …} else if (end - start > 3 && is_gb18030_even_4(start[1]) && is_gb18030_odd(start[2]) && is_gb1803… in my_ismbchar_gb18030()