Lines Matching refs:start

28 static unsigned int check_mb_utf8mb3_sequence(const char *start, const char *end)  in check_mb_utf8mb3_sequence()  argument
32 if (start >= end) { in check_mb_utf8mb3_sequence()
36 c = (zend_uchar) start[0]; in check_mb_utf8mb3_sequence()
45 if (start + 2 > end) { in check_mb_utf8mb3_sequence()
48 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40)) { in check_mb_utf8mb3_sequence()
54 if (start + 3 > end) { in check_mb_utf8mb3_sequence()
57 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8mb3_sequence()
58 (c >= 0xE1 || (zend_uchar)start[1] >= 0xA0))) { in check_mb_utf8mb3_sequence()
67 static unsigned int check_mb_utf8_sequence(const char *start, const char *end) in check_mb_utf8_sequence() argument
71 if (start >= end) { in check_mb_utf8_sequence()
75 c = (zend_uchar) start[0]; in check_mb_utf8_sequence()
84 if (start + 2 > end) { in check_mb_utf8_sequence()
87 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40)) { in check_mb_utf8_sequence()
93 if (start + 3 > end) { in check_mb_utf8_sequence()
96 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
97 (c >= 0xE1 || (zend_uchar)start[1] >= 0xA0))) { in check_mb_utf8_sequence()
103 if (start + 4 > end) { /* We need 4 characters */ in check_mb_utf8_sequence()
126 if (!(((zend_uchar)start[1] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
127 ((zend_uchar)start[2] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
128 ((zend_uchar)start[3] ^ 0x80) < 0x40 && in check_mb_utf8_sequence()
129 (c >= 0xf1 || (zend_uchar)start[1] >= 0x90) && in check_mb_utf8_sequence()
130 (c <= 0xf3 || (zend_uchar)start[1] <= 0x8F))) in check_mb_utf8_sequence()
139 static unsigned int check_mb_utf8mb3_valid(const char *start, const char *end) in check_mb_utf8mb3_valid() argument
141 unsigned int len = check_mb_utf8mb3_sequence(start, end); in check_mb_utf8mb3_valid()
145 static unsigned int check_mb_utf8_valid(const char *start, const char *end) in check_mb_utf8_valid() argument
147 unsigned int len = check_mb_utf8_sequence(start, end); in check_mb_utf8_valid()
199 static unsigned int check_mb_big5(const char *start, const char *end) in check_mb_big5() argument
201 return (valid_big5head(*(start)) && (end - start) > 1 && valid_big5tail(*(start + 1)) ? 2 : 0); in check_mb_big5()
217 static unsigned int check_mb_cp932(const char *start, const char *end) in check_mb_cp932() argument
219 return (valid_cp932head((zend_uchar)start[0]) && (end - start > 1) && in check_mb_cp932()
220 valid_cp932tail((zend_uchar)start[1])) ? 2 : 0; in check_mb_cp932()
234 static unsigned int check_mb_euckr(const char *start, const char *end) in check_mb_euckr() argument
236 if (end - start <= 1) { in check_mb_euckr()
239 if (*(zend_uchar *)start < 0x80) { in check_mb_euckr()
242 if (valid_euckr(start[1])) { in check_mb_euckr()
262 static unsigned int check_mb_eucjpms(const char *start, const char *end) in check_mb_eucjpms() argument
264 if (*((zend_uchar *)start) < 0x80) { in check_mb_eucjpms()
267 if (valid_eucjpms(start[0]) && (end - start) > 1 && valid_eucjpms(start[1])) { in check_mb_eucjpms()
270 if (valid_eucjpms_ss2(start[0]) && (end - start) > 1 && valid_eucjpms_kata(start[1])) { in check_mb_eucjpms()
273 if (valid_eucjpms_ss3(start[0]) && (end - start) > 2 && valid_eucjpms(start[1]) && in check_mb_eucjpms()
274 valid_eucjpms(start[2])) { in check_mb_eucjpms()
299 static unsigned int check_mb_gb2312(const char *start, const char *end) in check_mb_gb2312() argument
301 return (valid_gb2312_head((unsigned int)start[0]) && end - start > 1 && in check_mb_gb2312()
302 valid_gb2312_tail((unsigned int)start[1])) ? 2 : 0; in check_mb_gb2312()
317 static unsigned int check_mb_gbk(const char *start, const char *end) in check_mb_gbk() argument
319 return (valid_gbk_head(start[0]) && (end) - (start) > 1 && valid_gbk_tail(start[1])) ? 2 : 0; in check_mb_gbk()
334 static unsigned int check_mb_sjis(const char *start, const char *end) in check_mb_sjis() argument
336 …return (valid_sjis_head((zend_uchar)start[0]) && (end - start) > 1 && valid_sjis_tail((zend_uchar) in check_mb_sjis()
348 static unsigned int check_mb_ucs2(const char *start __attribute((unused)), const char *end __attrib… in check_mb_ucs2()
366 static unsigned int check_mb_ujis(const char *start, const char *end) in check_mb_ujis() argument
368 if (*(zend_uchar*)start < 0x80) { in check_mb_ujis()
371 if (valid_ujis(*(start)) && valid_ujis(*((start)+1))) { in check_mb_ujis()
374 if (valid_ujis_ss2(*(start)) && valid_ujis_kata(*((start)+1))) { in check_mb_ujis()
377 …if (valid_ujis_ss3(*(start)) && (end-start) > 2 && valid_ujis(*((start)+1)) && valid_ujis(*((start in check_mb_ujis()
396 static unsigned int check_mb_utf16(const char *start, const char *end) in check_mb_utf16() argument
398 if (start + 2 > end) { in check_mb_utf16()
402 if (UTF16_HIGH_HEAD(*start)) { in check_mb_utf16()
403 return (start + 4 <= end) && UTF16_LOW_HEAD(start[2]) ? 4 : 0; in check_mb_utf16()
406 if (UTF16_LOW_HEAD(*start)) { in check_mb_utf16()
422 check_mb_utf32(const char *start __attribute((unused)), const char *end __attribute((unused))) in check_mb_utf32()