Lines Matching refs:start
84 …mbvalid_dispatch(enum mysqlnd_encoding_valid encoding, const char * const start, const char * cons…
87 static unsigned int check_mb_utf8mb3_sequence(const char * const start, const char * const end) in check_mb_utf8mb3_sequence() argument
91 if (UNEXPECTED(start >= end)) { in check_mb_utf8mb3_sequence()
95 c = (zend_uchar) start[0]; in check_mb_utf8mb3_sequence()
104 if (start + 2 > end) { in check_mb_utf8mb3_sequence()
107 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40)) { in check_mb_utf8mb3_sequence()
113 if (start + 3 > end) { in check_mb_utf8mb3_sequence()
116 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8mb3_sequence()
117 (c >= 0xE1 || (zend_uchar)start[1] >= 0xA0))) { in check_mb_utf8mb3_sequence()
126 static unsigned int check_mb_utf8_sequence(const char * const start, const char * const end) in check_mb_utf8_sequence() argument
130 if (UNEXPECTED(start >= end)) { in check_mb_utf8_sequence()
134 c = (zend_uchar) start[0]; in check_mb_utf8_sequence()
143 if (start + 2 > end) { in check_mb_utf8_sequence()
146 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40)) { in check_mb_utf8_sequence()
152 if (start + 3 > end) { in check_mb_utf8_sequence()
155 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
156 (c >= 0xE1 || (zend_uchar)start[1] >= 0xA0))) { in check_mb_utf8_sequence()
162 if (start + 4 > end) { /* We need 4 characters */ in check_mb_utf8_sequence()
185 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
186 ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
187 ((zend_uchar)start[3] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
188 (c >= 0xf1 || (zend_uchar)start[1] >= 0x90) && in check_mb_utf8_sequence()
189 (c <= 0xf3 || (zend_uchar)start[1] <= 0x8F))) in check_mb_utf8_sequence()
198 static unsigned int check_mb_utf8mb3_valid(const char * const start, const char * const end) in check_mb_utf8mb3_valid() argument
200 unsigned int len = check_mb_utf8mb3_sequence(start, end); in check_mb_utf8mb3_valid()
204 static unsigned int check_mb_utf8_valid(const char * const start, const char * const end) in check_mb_utf8_valid() argument
206 unsigned int len = check_mb_utf8_sequence(start, end); in check_mb_utf8_valid()
258 static unsigned int check_mb_big5(const char * const start, const char * const end) in check_mb_big5() argument
260 return (valid_big5head(*(start)) && (end - start) > 1 && valid_big5tail(*(start + 1)) ? 2 : 0); in check_mb_big5()
276 static unsigned int check_mb_cp932(const char * const start, const char * const end) in check_mb_cp932() argument
278 return (valid_cp932head((zend_uchar)start[0]) && (end - start > 1) && in check_mb_cp932()
279 valid_cp932tail((zend_uchar)start[1])) ? 2 : 0; in check_mb_cp932()
293 static unsigned int check_mb_euckr(const char * const start, const char * const end) in check_mb_euckr() argument
295 if (end - start <= 1) { in check_mb_euckr()
298 if (*(zend_uchar *)start < 0x80) { in check_mb_euckr()
301 if (valid_euckr(start[1])) { in check_mb_euckr()
321 static unsigned int check_mb_eucjpms(const char * const start, const char * const end) in check_mb_eucjpms() argument
323 if (*((zend_uchar *)start) < 0x80) { in check_mb_eucjpms()
326 if (valid_eucjpms(start[0]) && (end - start) > 1 && valid_eucjpms(start[1])) { in check_mb_eucjpms()
329 if (valid_eucjpms_ss2(start[0]) && (end - start) > 1 && valid_eucjpms_kata(start[1])) { in check_mb_eucjpms()
332 if (valid_eucjpms_ss3(start[0]) && (end - start) > 2 && valid_eucjpms(start[1]) && in check_mb_eucjpms()
333 valid_eucjpms(start[2])) { in check_mb_eucjpms()
358 static unsigned int check_mb_gb2312(const char * const start, const char * const end) in check_mb_gb2312() argument
360 return (valid_gb2312_head((unsigned int)start[0]) && end - start > 1 && in check_mb_gb2312()
361 valid_gb2312_tail((unsigned int)start[1])) ? 2 : 0; in check_mb_gb2312()
376 static unsigned int check_mb_gbk(const char * const start, const char * const end) in check_mb_gbk() argument
378 return (valid_gbk_head(start[0]) && (end) - (start) > 1 && valid_gbk_tail(start[1])) ? 2 : 0; in check_mb_gbk()
393 static unsigned int check_mb_sjis(const char * const start, const char * const end) in check_mb_sjis() argument
395 …return (valid_sjis_head((zend_uchar)start[0]) && (end - start) > 1 && valid_sjis_tail((zend_uchar)… in check_mb_sjis()
407 static unsigned int check_mb_ucs2(const char * const start __attribute((unused)), const char * cons… in check_mb_ucs2()
425 static unsigned int check_mb_ujis(const char * const start, const char * const end) in check_mb_ujis() argument
427 if (*(zend_uchar*)start < 0x80) { in check_mb_ujis()
430 if (valid_ujis(*(start)) && valid_ujis(*((start)+1))) { in check_mb_ujis()
433 if (valid_ujis_ss2(*(start)) && valid_ujis_kata(*((start)+1))) { in check_mb_ujis()
436 …if (valid_ujis_ss3(*(start)) && (end-start) > 2 && valid_ujis(*((start)+1)) && valid_ujis(*((start… in check_mb_ujis()
455 static unsigned int check_mb_utf16(const char * const start, const char * const end) in check_mb_utf16() argument
457 if (start + 2 > end) { in check_mb_utf16()
461 if (UTF16_HIGH_HEAD(*start)) { in check_mb_utf16()
462 return (start + 4 <= end) && UTF16_LOW_HEAD(start[2]) ? 4 : 0; in check_mb_utf16()
465 if (UTF16_LOW_HEAD(*start)) { in check_mb_utf16()
480 static unsigned int check_mb_utf32(const char * const start __attribute((unused)), const char * con… in check_mb_utf32()
518 static unsigned int my_ismbchar_gb18030(const char * start, const char * end) in my_ismbchar_gb18030() argument
520 if (end - start <= 1 || !is_gb18030_odd(start[0])) { in my_ismbchar_gb18030()
524 if (is_gb18030_even_2(start[1])) { in my_ismbchar_gb18030()
526 …} else if (end - start > 3 && is_gb18030_even_4(start[1]) && is_gb18030_odd(start[2]) && is_gb1803… in my_ismbchar_gb18030()
549 static zend_always_inline unsigned int check_null(const char * const start, const char * const end) in check_null() argument
565 …mbvalid_dispatch(enum mysqlnd_encoding_valid encoding, const char * const start, const char * cons… in mysqlnd_mbvalid_dispatch() argument
568 #define ENUMERATOR_DISPATCH(x) case x##_id: return x(start, end); in mysqlnd_mbvalid_dispatch()
571 default: return check_null(start, end); in mysqlnd_mbvalid_dispatch()