Lines Matching refs:wc

711 	unsigned int wc;  in utf_widthadj()  local
714 if (!UTFMODE || (len = utf_mbtowc(&wc, src)) == (size_t)-1 || in utf_widthadj()
715 wc == 0) in utf_widthadj()
717 else if ((width = utf_wcwidth(wc)) < 0) in utf_widthadj()
730 unsigned int wc; in utf_mbswidth() local
737 if (((len = utf_mbtowc(&wc, s)) == (size_t)-1) || in utf_mbswidth()
738 ((cw = utf_wcwidth(wc)) == -1)) { in utf_mbswidth()
793 unsigned int c, wc; in utf_mbtowc() local
795 if ((wc = ord(rtt2asc(*s++))) < 0x80) { in utf_mbtowc()
798 *dst = wc; in utf_mbtowc()
799 return (wc ? ((const char *)s - src) : 0); in utf_mbtowc()
801 if (wc < 0xC2 || wc >= 0xF0) in utf_mbtowc()
807 if (wc < 0xE0) { in utf_mbtowc()
808 wc = (wc & 0x1F) << 6; in utf_mbtowc()
811 wc |= c & 0x3F; in utf_mbtowc()
815 wc = (wc & 0x0F) << 12; in utf_mbtowc()
819 wc |= (c & 0x3F) << 6; in utf_mbtowc()
823 wc |= c & 0x3F; in utf_mbtowc()
826 if (wc >= 0x0800 && wc <= 0xFFFD) in utf_mbtowc()
833 utf_wctomb(char *dst, unsigned int wc) in utf_wctomb() argument
837 if (wc < 0x80) { in utf_wctomb()
838 *dst = asc2rtt(wc); in utf_wctomb()
843 if (wc < 0x0800) in utf_wctomb()
844 *d++ = asc2rtt((wc >> 6) | 0xC0); in utf_wctomb()
846 *d++ = asc2rtt(((wc = wc > 0xFFFD ? 0xFFFD : wc) >> 12) | 0xE0); in utf_wctomb()
847 *d++ = asc2rtt(((wc >> 6) & 0x3F) | 0x80); in utf_wctomb()
849 *d++ = asc2rtt((wc & 0x3F) | 0x80); in utf_wctomb()
1182 utf_wcwidth(unsigned int wc) in utf_wcwidth() argument
1185 if (wc < 0x20 || (wc >= 0x7F && wc < 0xA0)) in utf_wcwidth()
1186 return (wc ? -1 : 0); in utf_wcwidth()
1189 if (mb_ucsbsearch(mb_ucs_combining, NELEM(mb_ucs_combining), wc)) in utf_wcwidth()
1193 if (mb_ucsbsearch(mb_ucs_fullwidth, NELEM(mb_ucs_fullwidth), wc)) in utf_wcwidth()