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
75 mlen = (nbytes + 1) * sizeof(nbuf[0]); in file_encoding()
80 mlen = (nbytes + 1) * sizeof((*ubuf)[0]); in file_encoding()
86 if (looks_ascii(buf, nbytes, *ubuf, ulen)) { in file_encoding()
90 } else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) { in file_encoding()
94 } else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) { in file_encoding()
99 } else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) { in file_encoding()
108 } else if (looks_latin1(buf, nbytes, *ubuf, ulen)) { in file_encoding()
112 } else if (looks_extended(buf, nbytes, *ubuf, ulen)) { in file_encoding()
117 from_ebcdic(buf, nbytes, nbuf); in file_encoding()
119 if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) { in file_encoding()
123 } else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) { in file_encoding()
221 looks_ascii(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_ascii() argument
228 for (i = 0; i < nbytes; i++) { in looks_ascii()
241 looks_latin1(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) in looks_latin1() argument
247 for (i = 0; i < nbytes; i++) { in looks_latin1()
260 looks_extended(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_extended() argument
267 for (i = 0; i < nbytes; i++) { in looks_extended()
291 file_looks_utf8(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) in file_looks_utf8() argument
301 for (i = 0; i < nbytes; i++) { in file_looks_utf8()
338 if (i >= nbytes) in file_looks_utf8()
362 looks_utf8_with_BOM(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_utf8_with_BOM() argument
365 if (nbytes > 3 && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf) in looks_utf8_with_BOM()
366 return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen); in looks_utf8_with_BOM()
372 looks_ucs16(const unsigned char *buf, size_t nbytes, unichar *ubuf, in looks_ucs16() argument
378 if (nbytes < 2) in looks_ucs16()
390 for (i = 2; i + 1 < nbytes; i += 2) { in looks_ucs16()
493 from_ebcdic(const unsigned char *buf, size_t nbytes, unsigned char *out) in from_ebcdic() argument
497 for (i = 0; i < nbytes; i++) { in from_ebcdic()