Lines Matching defs:ulen

66  * ubuf, and the number of characters converted in ulen.
69 file_encoding(struct magic_set *ms, const unsigned char *buf, size_t nbytes, unichar **ubuf, size_t *ulen, const char **code, const char **code_mime, const char **type)
76 *ulen = 0;
91 if (looks_ascii(buf, nbytes, *ubuf, ulen)) {
92 if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) {
93 DPRINTF(("utf-7 %" SIZE_T_FORMAT "u\n", *ulen));
97 DPRINTF(("ascii %" SIZE_T_FORMAT "u\n", *ulen));
101 } else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) {
102 DPRINTF(("utf8/bom %" SIZE_T_FORMAT "u\n", *ulen));
105 } else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) {
106 DPRINTF(("utf8 %" SIZE_T_FORMAT "u\n", *ulen));
109 } else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) {
117 DPRINTF(("ucs16 %" SIZE_T_FORMAT "u\n", *ulen));
118 } else if (looks_latin1(buf, nbytes, *ubuf, ulen)) {
119 DPRINTF(("latin1 %" SIZE_T_FORMAT "u\n", *ulen));
122 } else if (looks_extended(buf, nbytes, *ubuf, ulen)) {
123 DPRINTF(("extended %" SIZE_T_FORMAT "u\n", *ulen));
129 if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) {
130 DPRINTF(("ebcdic %" SIZE_T_FORMAT "u\n", *ulen));
133 } else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) {
135 *ulen));
232 size_t *ulen)
236 *ulen = 0;
244 ubuf[(*ulen)++] = buf[i];
251 looks_latin1(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen)
255 *ulen = 0;
263 ubuf[(*ulen)++] = buf[i];
271 size_t *ulen)
275 *ulen = 0;
283 ubuf[(*ulen)++] = buf[i];
297 * If ubuf is non-NULL on entry, text is decoded into ubuf, *ulen;
301 file_looks_utf8(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen)
309 *ulen = 0;
322 ubuf[(*ulen)++] = buf[i];
358 ubuf[(*ulen)++] = c;
373 size_t *ulen)
376 return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen);
382 looks_utf7(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen)
391 *ulen = 0;
402 size_t *ulen)
417 *ulen = 0;
423 ubuf[(*ulen)++] = buf[i + 1] + 256 * buf[i];
425 ubuf[(*ulen)++] = buf[i] + 256 * buf[i + 1];
427 if (ubuf[*ulen - 1] == 0xfffe)
429 if (ubuf[*ulen - 1] < 128 &&
430 text_chars[(size_t)ubuf[*ulen - 1]] != T)