Lines Matching defs:ucs_ch

153 static u_int16_t  ucs_to_sfm(u_int16_t ucs_ch, int lastchar);
155 static u_int16_t sfm_to_ucs(u_int16_t ucs_ch);
195 u_int16_t ucs_ch;
210 ucs_ch = *chp++;
212 ucs_ch = *ucsp++;
214 ucs_ch = OSSwapInt16(ucs_ch);
216 if (ucs_ch == '/') {
217 ucs_ch = altslash ? altslash : '_';
218 } else if (ucs_ch == '\0') {
219 ucs_ch = UCS_ALT_NULL;
220 } else if (decompose && unicode_decomposeable(ucs_ch)) {
221 extra = unicode_decompose(ucs_ch, sequence) - 1;
223 ucs_ch = sequence[0];
227 len += UNICODE_TO_UTF8_LEN(ucs_ch);
265 u_int16_t ucs_ch;
285 ucs_ch = *chp++;
287 ucs_ch = swapbytes ? OSSwapInt16(*ucsp++) : *ucsp++;
289 if (decompose && unicode_decomposeable(ucs_ch)) {
290 extra = unicode_decompose(ucs_ch, sequence) - 1;
292 ucs_ch = sequence[0];
298 if (ucs_ch == '/') {
300 ucs_ch = altslash;
302 ucs_ch = '_';
305 } else if (ucs_ch == '\0') {
306 ucs_ch = UCS_ALT_NULL;
309 if (ucs_ch < 0x0080) {
314 *utf8p++ = ucs_ch;
316 } else if (ucs_ch < 0x800) {
321 *utf8p++ = 0xc0 | (ucs_ch >> 6);
322 *utf8p++ = 0x80 | (0x3f & ucs_ch);
326 if (ucs_ch == 0xFFFE || ucs_ch == 0xFFFF) {
332 if (ucs_ch >= SP_HIGH_FIRST && ucs_ch <= SP_HIGH_LAST
339 pair = ((ucs_ch - SP_HIGH_FIRST) << SP_HALF_SHIFT)
354 ucs_ch = sfm_to_ucs(ucs_ch);
355 if (ucs_ch < 0x0080) {
360 *utf8p++ = ucs_ch;
368 *utf8p++ = 0xe0 | (ucs_ch >> 12);
369 *utf8p++ = 0x80 | (0x3f & (ucs_ch >> 6));
370 *utf8p++ = 0x80 | (0x3f & ucs_ch);
416 unsigned int ucs_ch;
439 ucs_ch = sfmconv ? ucs_to_sfm(byte, utf8len == 0) : byte;
459 ucs_ch = ch;
480 ucs_ch = ch;
497 ucs_ch = (ch >> SP_HALF_SHIFT) + SP_HIGH_FIRST;
498 if (ucs_ch < SP_HIGH_FIRST || ucs_ch > SP_HIGH_LAST)
500 *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : (u_int16_t)ucs_ch;
503 ucs_ch = (ch & SP_HALF_MASK) + SP_LOW_FIRST;
504 if (ucs_ch < SP_LOW_FIRST || ucs_ch > SP_LOW_LAST) {
508 *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : (u_int16_t)ucs_ch;
515 if (unicode_decomposeable(ucs_ch)) {
528 count = unicode_decompose(ucs_ch, sequence);
530 ucs_ch = sequence[i];
531 *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : (u_int16_t)ucs_ch;
541 if (unicode_combinable(ucs_ch)) {
543 composite = unicode_combine(base, ucs_ch);
546 ucs_ch = composite;
550 if (ucs_ch == UCS_ALT_NULL)
551 ucs_ch = '\0';
553 if (ucs_ch == altslash)
554 ucs_ch = '/';
559 if (unicode_combinable(ucs_ch)) {
568 *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : (u_int16_t)ucs_ch;
600 ucs_ch = '%';
601 *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : (u_int16_t)ucs_ch;
602 ucs_ch = hexdigits[byte >> 4];
603 *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : (u_int16_t)ucs_ch;
604 ucs_ch = hexdigits[byte & 0x0F];
605 *ucsp++ = swapbytes ? OSSwapInt16(ucs_ch) : (u_int16_t)ucs_ch;
632 unsigned int ucs_ch;
691 ucs_ch = (ch >> SP_HALF_SHIFT) + SP_HIGH_FIRST;
692 if (ucs_ch < SP_HIGH_FIRST || ucs_ch > SP_HIGH_LAST)
694 ucs_ch = (ch & SP_HALF_MASK) + SP_LOW_FIRST;
695 if (ucs_ch < SP_LOW_FIRST || ucs_ch > SP_LOW_LAST)
1129 ucs_to_sfm(u_int16_t ucs_ch, int lastchar)
1133 if (ucs_ch == 0x20)
1135 else if (ucs_ch == 0x2e)
1139 if (ucs_ch <= 0x1f) {
1140 return (ucs_ch | 0xf000);
1144 lsb = mac2sfm[ucs_ch - 0x0020];
1145 if (lsb != ucs_ch)
1148 return (ucs_ch);
1155 sfm_to_ucs(u_int16_t ucs_ch)
1157 if (((ucs_ch & 0xffC0) == SFMCODE_PREFIX_MASK) &&
1158 ((ucs_ch & 0x003f) <= MAX_SFM2MAC)) {
1159 ucs_ch = sfm2mac[ucs_ch & 0x003f];
1161 return (ucs_ch);