Lines Matching refs:code
119 utf8_code_to_mbclen(OnigCodePoint code) in utf8_code_to_mbclen() argument
121 if ((code & 0xffffff80) == 0) return 1; in utf8_code_to_mbclen()
122 else if ((code & 0xfffff800) == 0) { in utf8_code_to_mbclen()
123 if (code <= 0xff && code >= 0xfe) in utf8_code_to_mbclen()
127 else if ((code & 0xffff0000) == 0) return 3; in utf8_code_to_mbclen()
128 else if ((code & 0xffe00000) == 0) return 4; in utf8_code_to_mbclen()
129 else if ((code & 0xfc000000) == 0) return 5; in utf8_code_to_mbclen()
130 else if ((code & 0x80000000) == 0) return 6; in utf8_code_to_mbclen()
132 else if (code == INVALID_CODE_FE) return 1; in utf8_code_to_mbclen()
133 else if (code == INVALID_CODE_FF) return 1; in utf8_code_to_mbclen()
141 utf8_code_to_mbc_first(OnigCodePoint code)
143 if ((code & 0xffffff80) == 0)
144 return code;
146 if ((code & 0xfffff800) == 0)
147 return ((code>>6)& 0x1f) | 0xc0;
148 else if ((code & 0xffff0000) == 0)
149 return ((code>>12) & 0x0f) | 0xe0;
150 else if ((code & 0xffe00000) == 0)
151 return ((code>>18) & 0x07) | 0xf0;
152 else if ((code & 0xfc000000) == 0)
153 return ((code>>24) & 0x03) | 0xf8;
154 else if ((code & 0x80000000) == 0)
155 return ((code>>30) & 0x01) | 0xfc;
164 utf8_code_to_mbc(OnigCodePoint code, UChar *buf) in utf8_code_to_mbc() argument
166 #define UTF8_TRAILS(code, shift) (UChar )((((code) >> (shift)) & 0x3f) | 0x80) in utf8_code_to_mbc() argument
167 #define UTF8_TRAIL0(code) (UChar )(((code) & 0x3f) | 0x80) in utf8_code_to_mbc() argument
169 if ((code & 0xffffff80) == 0) { in utf8_code_to_mbc()
170 *buf = (UChar )code; in utf8_code_to_mbc()
176 if ((code & 0xfffff800) == 0) { in utf8_code_to_mbc()
177 *p++ = (UChar )(((code>>6)& 0x1f) | 0xc0); in utf8_code_to_mbc()
179 else if ((code & 0xffff0000) == 0) { in utf8_code_to_mbc()
180 *p++ = (UChar )(((code>>12) & 0x0f) | 0xe0); in utf8_code_to_mbc()
181 *p++ = UTF8_TRAILS(code, 6); in utf8_code_to_mbc()
183 else if ((code & 0xffe00000) == 0) { in utf8_code_to_mbc()
184 *p++ = (UChar )(((code>>18) & 0x07) | 0xf0); in utf8_code_to_mbc()
185 *p++ = UTF8_TRAILS(code, 12); in utf8_code_to_mbc()
186 *p++ = UTF8_TRAILS(code, 6); in utf8_code_to_mbc()
188 else if ((code & 0xfc000000) == 0) { in utf8_code_to_mbc()
189 *p++ = (UChar )(((code>>24) & 0x03) | 0xf8); in utf8_code_to_mbc()
190 *p++ = UTF8_TRAILS(code, 18); in utf8_code_to_mbc()
191 *p++ = UTF8_TRAILS(code, 12); in utf8_code_to_mbc()
192 *p++ = UTF8_TRAILS(code, 6); in utf8_code_to_mbc()
194 else if ((code & 0x80000000) == 0) { in utf8_code_to_mbc()
195 *p++ = (UChar )(((code>>30) & 0x01) | 0xfc); in utf8_code_to_mbc()
196 *p++ = UTF8_TRAILS(code, 24); in utf8_code_to_mbc()
197 *p++ = UTF8_TRAILS(code, 18); in utf8_code_to_mbc()
198 *p++ = UTF8_TRAILS(code, 12); in utf8_code_to_mbc()
199 *p++ = UTF8_TRAILS(code, 6); in utf8_code_to_mbc()
202 else if (code == INVALID_CODE_FE) { in utf8_code_to_mbc()
206 else if (code == INVALID_CODE_FF) { in utf8_code_to_mbc()
215 *p++ = UTF8_TRAIL0(code); in utf8_code_to_mbc()
3612 utf8_is_code_ctype(OnigCodePoint code, unsigned int ctype) in utf8_is_code_ctype() argument
3618 if (code < 256) { in utf8_is_code_ctype()
3619 return ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype); in utf8_is_code_ctype()
3676 return onig_is_in_code_range((UChar* )range, code); in utf8_is_code_ctype()
3682 if (code <= VALID_CODE_LIMIT) in utf8_is_code_ctype()