Lines Matching refs:len

1089     int		len;  in dbcs_ptr2len()  local
1092 len = MB_BYTE2LEN(*p); in dbcs_ptr2len()
1093 if (len == 2 && p[1] == NUL) in dbcs_ptr2len()
1094 len = 1; in dbcs_ptr2len()
1095 return len; in dbcs_ptr2len()
1115 int len; in dbcs_ptr2len_len() local
1122 len = MB_BYTE2LEN(*p); in dbcs_ptr2len_len()
1123 if (len == 2 && p[1] == NUL) in dbcs_ptr2len_len()
1124 len = 1; in dbcs_ptr2len_len()
1125 return len; in dbcs_ptr2len_len()
1717 mb_string2cells(char_u *p, int len) in mb_string2cells() argument
1722 for (i = 0; (len < 0 || i < len) && p[i] != NUL; i += (*mb_ptr2len)(p + i)) in mb_string2cells()
1786 int len; in utf_ptr2char() local
1791 len = utf8len_tab_zero[p[0]]; in utf_ptr2char()
1792 if (len > 1 && (p[1] & 0xc0) == 0x80) in utf_ptr2char()
1794 if (len == 2) in utf_ptr2char()
1798 if (len == 3) in utf_ptr2char()
1803 if (len == 4) in utf_ptr2char()
1808 if (len == 5) in utf_ptr2char()
1812 if ((p[5] & 0xc0) == 0x80 && len == 6) in utf_ptr2char()
1942 int len; in utfc_ptr2char() local
1948 len = utf_ptr2len(p); in utfc_ptr2char()
1951 if ((len > 1 || *p < 0x80) in utfc_ptr2char()
1952 && p[len] >= 0x80 in utfc_ptr2char()
1953 && UTF_COMPOSINGLIKE(p, p + len)) in utfc_ptr2char()
1955 cc = utf_ptr2char(p + len); in utfc_ptr2char()
1961 len += utf_ptr2len(p + len); in utfc_ptr2char()
1962 if (p[len] < 0x80 || !utf_iscomposing(cc = utf_ptr2char(p + len))) in utfc_ptr2char()
1983 int len; in utfc_ptr2char_len() local
1989 len = utf_ptr2len_len(p, maxlen); in utfc_ptr2char_len()
1991 if ((len > 1 || *p < 0x80) in utfc_ptr2char_len()
1992 && len < maxlen in utfc_ptr2char_len()
1993 && p[len] >= 0x80 in utfc_ptr2char_len()
1994 && UTF_COMPOSINGLIKE(p, p + len)) in utfc_ptr2char_len()
1996 cc = utf_ptr2char(p + len); in utfc_ptr2char_len()
2002 len += utf_ptr2len_len(p + len, maxlen - len); in utfc_ptr2char_len()
2003 if (len >= maxlen in utfc_ptr2char_len()
2004 || p[len] < 0x80 in utfc_ptr2char_len()
2005 || !utf_iscomposing(cc = utf_ptr2char(p + len))) in utfc_ptr2char_len()
2026 int len; in utfc_char2bytes() local
2029 len = utf_char2bytes(ScreenLinesUC[off], buf); in utfc_char2bytes()
2034 len += utf_char2bytes(ScreenLinesC[i][off], buf + len); in utfc_char2bytes()
2036 return len; in utfc_char2bytes()
2048 int len; in utf_ptr2len() local
2053 len = utf8len_tab[*p]; in utf_ptr2len()
2054 for (i = 1; i < len; ++i) in utf_ptr2len()
2057 return len; in utf_ptr2len()
2082 int len; in utf_ptr2len_len() local
2086 len = utf8len_tab[*p]; in utf_ptr2len_len()
2087 if (len == 1) in utf_ptr2len_len()
2089 if (len > size) in utf_ptr2len_len()
2092 m = len; in utf_ptr2len_len()
2096 return len; in utf_ptr2len_len()
2106 int len; in utfc_ptr2len() local
2118 len = utf_ptr2len(p); in utfc_ptr2len()
2121 if (len == 1 && b0 >= 0x80) in utfc_ptr2len()
2133 if (p[len] < 0x80 || !UTF_COMPOSINGLIKE(p + prevlen, p + len)) in utfc_ptr2len()
2134 return len; in utfc_ptr2len()
2138 prevlen = len; in utfc_ptr2len()
2140 len += utf_ptr2len(p + len); in utfc_ptr2len()
2153 int len; in utfc_ptr2len_len() local
2164 len = utf_ptr2len_len(p, size); in utfc_ptr2len_len()
2167 if ((len == 1 && p[0] >= 0x80) || len > size) in utfc_ptr2len_len()
2177 while (len < size) in utfc_ptr2len_len()
2181 if (p[len] < 0x80) in utfc_ptr2len_len()
2188 len_next_char = utf_ptr2len_len(p + len, size - len); in utfc_ptr2len_len()
2189 if (len_next_char > size - len) in utfc_ptr2len_len()
2192 if (!UTF_COMPOSINGLIKE(p + prevlen, p + len)) in utfc_ptr2len_len()
2197 prevlen = len; in utfc_ptr2len_len()
2199 len += len_next_char; in utfc_ptr2len_len()
2201 return len; in utfc_ptr2len_len()
3746 int len; in show_utf8() local
3755 len = utfc_ptr2len(line); in show_utf8()
3756 if (len == 0) in show_utf8()
3763 for (i = 0; i < len; ++i) in show_utf8()
3856 int len; in utf_head_off() local
3876 len = utf8len_tab[*q]; in utf_head_off()
3877 if (len != (int)(s - q + 1) && len != (int)(p - q + 1)) in utf_head_off()
4151 int len; in utf_find_illegal() local
4181 len = utf_ptr2len(p); in utf_find_illegal()
4182 if (*p >= 0x80 && (len == 1 in utf_find_illegal()
4183 || utf_char2len(utf_ptr2char(p)) != len)) in utf_find_illegal()
4191 len = (int)(p - tofree); in utf_find_illegal()
4192 for (p = ml_get_cursor(); *p != NUL && len-- > 0; p += l) in utf_find_illegal()
4200 p += len; in utf_find_illegal()
4339 mb_charlen_len(char_u *str, int len) in mb_charlen_len() argument
4344 for (count = 0; *p != NUL && p < str + len; count++) in mb_charlen_len()
4763 size_t len = 0; in iconv_string() local
4773 if (len == 0 || ICONV_ERRNO == ICONV_E2BIG) in iconv_string()
4777 len = len + fromlen * 2 + 40; in iconv_string()
4778 p = alloc(len); in iconv_string()
4788 tolen = len - done - 2; in iconv_string()
5141 convert_input(char_u *ptr, int len, int maxlen) in convert_input() argument
5143 return convert_input_safe(ptr, len, maxlen, NULL, NULL); in convert_input()
5155 int len, in convert_input_safe() argument
5161 int dlen = len; in convert_input_safe()
5175 mch_memmove(*restp, ptr + len - unconvertlen, unconvertlen); in convert_input_safe()
5183 dlen = len; in convert_input_safe()
5219 int len; in string_convert_ext() local
5225 len = (int)STRLEN(ptr); in string_convert_ext()
5227 len = *lenp; in string_convert_ext()
5228 if (len == 0) in string_convert_ext()
5234 retval = alloc(len * 2 + 1); in string_convert_ext()
5238 for (i = 0; i < len; ++i) in string_convert_ext()
5255 retval = alloc(len * 3 + 1); in string_convert_ext()
5259 for (i = 0; i < len; ++i) in string_convert_ext()
5282 retval = alloc(len + 1); in string_convert_ext()
5286 for (i = 0; i < len; ++i) in string_convert_ext()
5288 l = utf_ptr2len_len(ptr + i, len - i); in string_convert_ext()
5301 if (unconvlenp != NULL && l_w > len - i) in string_convert_ext()
5304 *unconvlenp = len - i; in string_convert_ext()
5358 retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail, in string_convert_ext()
5363 retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail, in string_convert_ext()
5368 retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail, in string_convert_ext()
5373 retval = mac_string_convert(ptr, len, lenp, vcp->vc_fail, in string_convert_ext()
5380 retval = iconv_string(vcp, ptr, len, unconvlenp, lenp); in string_convert_ext()
5392 tmp_len = utf8_to_utf16(ptr, len, NULL, NULL); in string_convert_ext()
5397 (char *)ptr, len, 0, 0); in string_convert_ext()
5404 *unconvlenp = len; in string_convert_ext()
5415 utf8_to_utf16(ptr, len, tmp, unconvlenp); in string_convert_ext()
5418 (char *)ptr, len, tmp, tmp_len); in string_convert_ext()