Lines Matching refs:ulen
70 size_t *ulen, const char **code, const char **code_mime, const char **type) in file_encoding() argument
82 if (ulen == NULL) in file_encoding()
83 ulen = &udeflen; in file_encoding()
86 *ulen = 0; in file_encoding()
102 if (looks_ascii(buf, nbytes, *ubuf, ulen)) { in file_encoding()
103 if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) { in file_encoding()
104 DPRINTF(("utf-7 %" SIZE_T_FORMAT "u\n", *ulen)); in file_encoding()
108 DPRINTF(("ascii %" SIZE_T_FORMAT "u\n", *ulen)); in file_encoding()
112 } else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) { in file_encoding()
113 DPRINTF(("utf8/bom %" SIZE_T_FORMAT "u\n", *ulen)); in file_encoding()
116 } else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) { in file_encoding()
117 DPRINTF(("utf8 %" SIZE_T_FORMAT "u\n", *ulen)); in file_encoding()
120 } else if ((ucs_type = looks_ucs32(buf, nbytes, *ubuf, ulen)) != 0) { in file_encoding()
128 DPRINTF(("ucs32 %" SIZE_T_FORMAT "u\n", *ulen)); in file_encoding()
129 } else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) { in file_encoding()
137 DPRINTF(("ucs16 %" SIZE_T_FORMAT "u\n", *ulen)); in file_encoding()
138 } else if (looks_latin1(buf, nbytes, *ubuf, ulen)) { in file_encoding()
139 DPRINTF(("latin1 %" SIZE_T_FORMAT "u\n", *ulen)); in file_encoding()
142 } else if (looks_extended(buf, nbytes, *ubuf, ulen)) { in file_encoding()
143 DPRINTF(("extended %" SIZE_T_FORMAT "u\n", *ulen)); in file_encoding()
149 if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) { in file_encoding()
150 DPRINTF(("ebcdic %" SIZE_T_FORMAT "u\n", *ulen)); in file_encoding()
153 } else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) { in file_encoding()
155 *ulen)); in file_encoding()
254 size_t *ulen) in looks_ascii() argument
258 *ulen = 0; in looks_ascii()
266 ubuf[(*ulen)++] = buf[i]; in looks_ascii()
273 looks_latin1(const unsigned char *buf, size_t nbytes, unicodechar *ubuf, size_t *ulen) in looks_latin1() argument
277 *ulen = 0; in looks_latin1()
285 ubuf[(*ulen)++] = buf[i]; in looks_latin1()
293 size_t *ulen) in looks_extended() argument
297 *ulen = 0; in looks_extended()
305 ubuf[(*ulen)++] = buf[i]; in looks_extended()
323 file_looks_utf8(const unsigned char *buf, size_t nbytes, unicodechar *ubuf, size_t *ulen) in file_looks_utf8() argument
331 *ulen = 0; in file_looks_utf8()
344 ubuf[(*ulen)++] = buf[i]; in file_looks_utf8()
380 ubuf[(*ulen)++] = c; in file_looks_utf8()
395 size_t *ulen) in looks_utf8_with_BOM() argument
398 return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen); in looks_utf8_with_BOM()
404 looks_utf7(const unsigned char *buf, size_t nbytes, unicodechar *ubuf, size_t *ulen) in looks_utf7() argument
413 *ulen = 0; in looks_utf7()
424 size_t *ulen) in looks_ucs16() argument
439 *ulen = 0; in looks_ucs16()
445 ubf[(*ulen)++] = bf[i + 1] in looks_ucs16()
448 ubf[(*ulen)++] = bf[i] in looks_ucs16()
451 if (ubf[*ulen - 1] == 0xfffe) in looks_ucs16()
453 if (ubf[*ulen - 1] < 128 && in looks_ucs16()
454 text_chars[CAST(size_t, ubf[*ulen - 1])] != T) in looks_ucs16()
463 size_t *ulen) in looks_ucs32() argument
478 *ulen = 0; in looks_ucs32()
484 ubf[(*ulen)++] = CAST(unicodechar, bf[i + 3]) in looks_ucs32()
489 ubf[(*ulen)++] = CAST(unicodechar, bf[i + 0]) in looks_ucs32()
494 if (ubf[*ulen - 1] == 0xfffe) in looks_ucs32()
496 if (ubf[*ulen - 1] < 128 && in looks_ucs32()
497 text_chars[CAST(size_t, ubf[*ulen - 1])] != T) in looks_ucs32()