Lines Matching refs:ch
20 #define IS_CONTINUATION_BYTE(ch) ((ch) >= 0x80 && (ch) < 0xC0) argument
27 Py_UCS4 ch; in STRINGLIB() local
32 ch = (unsigned char)*s; in STRINGLIB()
34 if (ch < 0x80) { in STRINGLIB()
88 ch = (unsigned char)*s; in STRINGLIB()
90 if (ch < 0x80) { in STRINGLIB()
92 *p++ = ch; in STRINGLIB()
97 if (ch < 0xE0) { in STRINGLIB()
100 if (ch < 0xC2) { in STRINGLIB()
115 ch = (ch << 6) + ch2 - in STRINGLIB()
117 assert ((ch > 0x007F) && (ch <= 0x07FF)); in STRINGLIB()
120 (STRINGLIB_MAX_CHAR < 0x07FF && ch > STRINGLIB_MAX_CHAR)) in STRINGLIB()
123 *p++ = ch; in STRINGLIB()
127 if (ch < 0xF0) { in STRINGLIB()
137 (ch2 < 0xA0 ? ch == 0xE0 : ch == 0xED)) in STRINGLIB()
148 if (ch == 0xE0) { in STRINGLIB()
153 } else if (ch == 0xED && ch2 >= 0xA0) { in STRINGLIB()
165 ch = (ch << 12) + (ch2 << 6) + ch3 - in STRINGLIB()
167 assert ((ch > 0x07FF) && (ch <= 0xFFFF)); in STRINGLIB()
170 (STRINGLIB_MAX_CHAR < 0xFFFF && ch > STRINGLIB_MAX_CHAR)) in STRINGLIB()
173 *p++ = ch; in STRINGLIB()
177 if (ch < 0xF5) { in STRINGLIB()
187 (ch2 < 0x90 ? ch == 0xF0 : ch == 0xF4)) in STRINGLIB()
204 if (ch == 0xF0) { in STRINGLIB()
209 } else if (ch == 0xF4 && ch2 >= 0x90) { in STRINGLIB()
222 ch = (ch << 18) + (ch2 << 12) + (ch3 << 6) + ch4 - in STRINGLIB()
224 assert ((ch > 0xFFFF) && (ch <= 0x10FFFF)); in STRINGLIB()
227 (STRINGLIB_MAX_CHAR < 0x10FFFF && ch > STRINGLIB_MAX_CHAR)) in STRINGLIB()
230 *p++ = ch; in STRINGLIB()
235 ch = 0; in STRINGLIB()
239 return ch; in STRINGLIB()
241 ch = 1; in STRINGLIB()
244 ch = 2; in STRINGLIB()
247 ch = 3; in STRINGLIB()
250 ch = 4; in STRINGLIB()
296 Py_UCS4 ch = data[i++]; in STRINGLIB() local
298 if (ch < 0x80) { in STRINGLIB()
300 *p++ = (char) ch; in STRINGLIB()
305 if (ch < 0x0800) in STRINGLIB()
309 *p++ = (char)(0xc0 | (ch >> 6)); in STRINGLIB()
310 *p++ = (char)(0x80 | (ch & 0x3f)); in STRINGLIB()
313 else if (Py_UNICODE_IS_SURROGATE(ch)) { in STRINGLIB()
341 ch = data[k]; in STRINGLIB()
342 *p++ = (char)(0xe0 | (ch >> 12)); in STRINGLIB()
343 *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); in STRINGLIB()
344 *p++ = (char)(0x80 | (ch & 0x3f)); in STRINGLIB()
371 ch = data[k]; in STRINGLIB()
372 if (!(0xDC80 <= ch && ch <= 0xDCFF)) in STRINGLIB()
374 *p++ = (char)(ch & 0xff); in STRINGLIB()
428 if (ch < 0x10000) in STRINGLIB()
431 *p++ = (char)(0xe0 | (ch >> 12)); in STRINGLIB()
432 *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); in STRINGLIB()
433 *p++ = (char)(0x80 | (ch & 0x3f)); in STRINGLIB()
438 assert(ch <= MAX_UNICODE); in STRINGLIB()
440 *p++ = (char)(0xf0 | (ch >> 18)); in STRINGLIB()
441 *p++ = (char)(0x80 | ((ch >> 12) & 0x3f)); in STRINGLIB()
442 *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); in STRINGLIB()
443 *p++ = (char)(0x80 | (ch & 0x3f)); in STRINGLIB()
497 Py_UCS4 ch; in STRINGLIB() local
561 ch = (q[ihi] << 8) | q[ilo]; in STRINGLIB()
563 if (!Py_UNICODE_IS_SURROGATE(ch)) { in STRINGLIB()
565 if (ch > STRINGLIB_MAX_CHAR) in STRINGLIB()
569 *p++ = (STRINGLIB_CHAR)ch; in STRINGLIB()
574 if (!Py_UNICODE_IS_HIGH_SURROGATE(ch)) in STRINGLIB()
582 ch = Py_UNICODE_JOIN_SURROGATES(ch, ch2); in STRINGLIB()
587 *p++ = (STRINGLIB_CHAR)ch; in STRINGLIB()
590 ch = 0; in STRINGLIB()
594 return ch; in STRINGLIB()
596 ch = 1; in STRINGLIB()
599 ch = 2; in STRINGLIB()
602 ch = 3; in STRINGLIB()
644 Py_UCS4 ch = *in++; in STRINGLIB() local
645 *out++ = SWAB2((Py_UCS2)ch); in STRINGLIB()
670 Py_UCS4 ch; in STRINGLIB() local
671 ch = *in++; in STRINGLIB()
672 if (ch < 0xd800) in STRINGLIB()
673 *out++ = ch; in STRINGLIB()
674 else if (ch < 0xe000) in STRINGLIB()
678 else if (ch >= 0x10000) { in STRINGLIB()
679 out[0] = Py_UNICODE_HIGH_SURROGATE(ch); in STRINGLIB()
680 out[1] = Py_UNICODE_LOW_SURROGATE(ch); in STRINGLIB()
685 *out++ = ch; in STRINGLIB()
706 Py_UCS4 ch = *in++; in STRINGLIB() local
707 if (ch < 0xd800) in STRINGLIB()
708 *out++ = SWAB2((Py_UCS2)ch); in STRINGLIB()
709 else if (ch < 0xe000) in STRINGLIB()
713 else if (ch >= 0x10000) { in STRINGLIB()
714 Py_UCS2 ch1 = Py_UNICODE_HIGH_SURROGATE(ch); in STRINGLIB()
715 Py_UCS2 ch2 = Py_UNICODE_LOW_SURROGATE(ch); in STRINGLIB()
722 *out++ = SWAB2((Py_UCS2)ch); in STRINGLIB()
735 STRINGLIB(SWAB4)(STRINGLIB_CHAR ch) in STRINGLIB()
737 uint32_t word = ch; in STRINGLIB()
775 Py_UCS4 ch; in STRINGLIB() local
776 ch = *in++; in STRINGLIB()
778 if (Py_UNICODE_IS_SURROGATE(ch)) { in STRINGLIB()
783 *out++ = ch; in STRINGLIB()
803 Py_UCS4 ch = *in++; in STRINGLIB() local
805 if (Py_UNICODE_IS_SURROGATE(ch)) { in STRINGLIB()
810 *out++ = STRINGLIB(SWAB4)(ch); in STRINGLIB()