Lines Matching refs:ubuf

70 file_encoding(struct magic_set *ms, const struct buffer *b, unichar **ubuf,  in file_encoding()  argument
81 if (ubuf == NULL) in file_encoding()
82 ubuf = &udefbuf; in file_encoding()
91 mlen = (nbytes + 1) * sizeof((*ubuf)[0]); in file_encoding()
92 if ((*ubuf = CAST(unichar *, ecalloc(CAST(size_t, 1), mlen))) == NULL) { in file_encoding()
103 if (looks_ascii(buf, nbytes, *ubuf, ulen)) { in file_encoding()
104 if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) { in file_encoding()
113 } else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) { in file_encoding()
117 } else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) { in file_encoding()
121 } else if ((ucs_type = looks_ucs32(buf, nbytes, *ubuf, ulen)) != 0) { in file_encoding()
130 } else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) { in file_encoding()
139 } else if (looks_latin1(buf, nbytes, *ubuf, ulen)) { in file_encoding()
143 } else if (looks_extended(buf, nbytes, *ubuf, ulen)) { in file_encoding()
150 if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) { in file_encoding()
154 } else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) { in file_encoding()
168 if (ubuf == &udefbuf) in file_encoding()
254 looks_ascii(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_ascii() argument
267 ubuf[(*ulen)++] = buf[i]; in looks_ascii()
274 looks_latin1(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) in looks_latin1() argument
286 ubuf[(*ulen)++] = buf[i]; in looks_latin1()
293 looks_extended(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_extended() argument
306 ubuf[(*ulen)++] = buf[i]; in looks_extended()
324 file_looks_utf8(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) in file_looks_utf8() argument
331 if (ubuf) in file_looks_utf8()
344 if (ubuf) in file_looks_utf8()
345 ubuf[(*ulen)++] = buf[i]; in file_looks_utf8()
380 if (ubuf) in file_looks_utf8()
381 ubuf[(*ulen)++] = c; in file_looks_utf8()
395 looks_utf8_with_BOM(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_utf8_with_BOM() argument
399 return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen); in looks_utf8_with_BOM()
405 looks_utf7(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) in looks_utf7() argument
413 if (ubuf) in looks_utf7()