Lines Matching refs:code

148 code_to_mbclen(OnigCodePoint code)  in code_to_mbclen()  argument
150 if ((code & 0xffffff80) == 0) return 1; in code_to_mbclen()
151 else if ((code & 0xfffff800) == 0) return 2; in code_to_mbclen()
152 else if ((code & 0xffff0000) == 0) return 3; in code_to_mbclen()
153 else if ((code & 0xffe00000) == 0) return 4; in code_to_mbclen()
154 else if ((code & 0xfc000000) == 0) return 5; in code_to_mbclen()
155 else if ((code & 0x80000000) == 0) return 6; in code_to_mbclen()
157 else if (code == INVALID_CODE_FE) return 1; in code_to_mbclen()
158 else if (code == INVALID_CODE_FF) return 1; in code_to_mbclen()
165 code_to_mbc(OnigCodePoint code, UChar *buf) in code_to_mbc() argument
167 #define UTF8_TRAILS(code, shift) (UChar )((((code) >> (shift)) & 0x3f) | 0x80) in code_to_mbc() argument
168 #define UTF8_TRAIL0(code) (UChar )(((code) & 0x3f) | 0x80) in code_to_mbc() argument
170 if ((code & 0xffffff80) == 0) { in code_to_mbc()
171 *buf = (UChar )code; in code_to_mbc()
177 if ((code & 0xfffff800) == 0) { in code_to_mbc()
178 *p++ = (UChar )(((code>>6)& 0x1f) | 0xc0); in code_to_mbc()
180 else if ((code & 0xffff0000) == 0) { in code_to_mbc()
181 *p++ = (UChar )(((code>>12) & 0x0f) | 0xe0); in code_to_mbc()
182 *p++ = UTF8_TRAILS(code, 6); in code_to_mbc()
184 else if ((code & 0xffe00000) == 0) { in code_to_mbc()
185 *p++ = (UChar )(((code>>18) & 0x07) | 0xf0); in code_to_mbc()
186 *p++ = UTF8_TRAILS(code, 12); in code_to_mbc()
187 *p++ = UTF8_TRAILS(code, 6); in code_to_mbc()
189 else if ((code & 0xfc000000) == 0) { in code_to_mbc()
190 *p++ = (UChar )(((code>>24) & 0x03) | 0xf8); in code_to_mbc()
191 *p++ = UTF8_TRAILS(code, 18); in code_to_mbc()
192 *p++ = UTF8_TRAILS(code, 12); in code_to_mbc()
193 *p++ = UTF8_TRAILS(code, 6); in code_to_mbc()
195 else if ((code & 0x80000000) == 0) { in code_to_mbc()
196 *p++ = (UChar )(((code>>30) & 0x01) | 0xfc); in code_to_mbc()
197 *p++ = UTF8_TRAILS(code, 24); in code_to_mbc()
198 *p++ = UTF8_TRAILS(code, 18); in code_to_mbc()
199 *p++ = UTF8_TRAILS(code, 12); in code_to_mbc()
200 *p++ = UTF8_TRAILS(code, 6); in code_to_mbc()
203 else if (code == INVALID_CODE_FE) { in code_to_mbc()
207 else if (code == INVALID_CODE_FF) { in code_to_mbc()
216 *p++ = UTF8_TRAIL0(code); in code_to_mbc()