Lines Matching refs:nbytes

68 file_encoding(struct magic_set *ms, const unsigned char *buf, size_t nbytes, unichar **ubuf, size_t…  in file_encoding()  argument
79 mlen = (nbytes + 1) * sizeof((*ubuf)[0]); in file_encoding()
84 mlen = (nbytes + 1) * sizeof(nbuf[0]); in file_encoding()
90 if (looks_ascii(buf, nbytes, *ubuf, ulen)) { in file_encoding()
94 } else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) { in file_encoding()
98 } else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) { in file_encoding()
102 } else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) { in file_encoding()
111 } else if (looks_latin1(buf, nbytes, *ubuf, ulen)) { in file_encoding()
115 } else if (looks_extended(buf, nbytes, *ubuf, ulen)) { in file_encoding()
120 from_ebcdic(buf, nbytes, nbuf); in file_encoding()
122 if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) { in file_encoding()
126 } else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) { in file_encoding()
224 looks_ascii(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_ascii() argument
231 for (i = 0; i < nbytes; i++) { in looks_ascii()
244 looks_latin1(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) in looks_latin1() argument
250 for (i = 0; i < nbytes; i++) { in looks_latin1()
263 looks_extended(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_extended() argument
270 for (i = 0; i < nbytes; i++) { in looks_extended()
294 file_looks_utf8(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) in file_looks_utf8() argument
304 for (i = 0; i < nbytes; i++) { in file_looks_utf8()
341 if (i >= nbytes) in file_looks_utf8()
365 looks_utf8_with_BOM(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_utf8_with_BOM() argument
368 if (nbytes > 3 && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf) in looks_utf8_with_BOM()
369 return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen); in looks_utf8_with_BOM()
375 looks_ucs16(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_ucs16() argument
381 if (nbytes < 2) in looks_ucs16()
393 for (i = 2; i + 1 < nbytes; i += 2) { in looks_ucs16()
496 from_ebcdic(const unsigned char *buf, size_t nbytes, unsigned char *out) in from_ebcdic() argument
500 for (i = 0; i < nbytes; i++) { in from_ebcdic()