Lines Matching refs:code

130 code_to_mbclen(OnigCodePoint code)  in code_to_mbclen()  argument
132 if ((code & 0xffffff80) == 0) return 1; in code_to_mbclen()
133 else if ((code & 0xfffff800) == 0) return 2; in code_to_mbclen()
134 else if ((code & 0xffff0000) == 0) return 3; in code_to_mbclen()
135 else if ((code & 0xffe00000) == 0) return 4; in code_to_mbclen()
137 else if ((code & 0xfc000000) == 0) return 5; in code_to_mbclen()
138 else if ((code & 0x80000000) == 0) return 6; in code_to_mbclen()
141 else if (code == INVALID_CODE_FE) return 1; in code_to_mbclen()
142 else if (code == INVALID_CODE_FF) return 1; in code_to_mbclen()
149 code_to_mbc(OnigCodePoint code, UChar *buf) in code_to_mbc() argument
151 #define UTF8_TRAILS(code, shift) (UChar )((((code) >> (shift)) & 0x3f) | 0x80) in code_to_mbc() argument
152 #define UTF8_TRAIL0(code) (UChar )(((code) & 0x3f) | 0x80) in code_to_mbc() argument
154 if ((code & 0xffffff80) == 0) { in code_to_mbc()
155 *buf = (UChar )code; in code_to_mbc()
161 if ((code & 0xfffff800) == 0) { in code_to_mbc()
162 *p++ = (UChar )(((code>>6)& 0x1f) | 0xc0); in code_to_mbc()
164 else if ((code & 0xffff0000) == 0) { in code_to_mbc()
165 *p++ = (UChar )(((code>>12) & 0x0f) | 0xe0); in code_to_mbc()
166 *p++ = UTF8_TRAILS(code, 6); in code_to_mbc()
168 else if ((code & 0xffe00000) == 0) { in code_to_mbc()
169 *p++ = (UChar )(((code>>18) & 0x07) | 0xf0); in code_to_mbc()
170 *p++ = UTF8_TRAILS(code, 12); in code_to_mbc()
171 *p++ = UTF8_TRAILS(code, 6); in code_to_mbc()
174 else if ((code & 0xfc000000) == 0) { in code_to_mbc()
175 *p++ = (UChar )(((code>>24) & 0x03) | 0xf8); in code_to_mbc()
176 *p++ = UTF8_TRAILS(code, 18); in code_to_mbc()
177 *p++ = UTF8_TRAILS(code, 12); in code_to_mbc()
178 *p++ = UTF8_TRAILS(code, 6); in code_to_mbc()
180 else if ((code & 0x80000000) == 0) { in code_to_mbc()
181 *p++ = (UChar )(((code>>30) & 0x01) | 0xfc); in code_to_mbc()
182 *p++ = UTF8_TRAILS(code, 24); in code_to_mbc()
183 *p++ = UTF8_TRAILS(code, 18); in code_to_mbc()
184 *p++ = UTF8_TRAILS(code, 12); in code_to_mbc()
185 *p++ = UTF8_TRAILS(code, 6); in code_to_mbc()
189 else if (code == INVALID_CODE_FE) { in code_to_mbc()
193 else if (code == INVALID_CODE_FF) { in code_to_mbc()
202 *p++ = UTF8_TRAIL0(code); in code_to_mbc()