Lines Matching defs:ubuf
72 * ubuf, and the number of characters converted in ulen.
76 file_unichar_t **ubuf, size_t *ulen, const char **code,
86 if (ubuf == NULL)
87 ubuf = &udefbuf;
99 mlen = (nbytes + 1) * sizeof((*ubuf)[0]);
100 *ubuf = CAST(file_unichar_t *, calloc(CAST(size_t, 1), mlen));
101 if (*ubuf == NULL) {
105 if (looks_ascii(buf, nbytes, *ubuf, ulen)) {
106 if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) {
115 } else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) {
119 } else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) {
123 } else if ((ucs_type = looks_ucs32(buf, nbytes, *ubuf, ulen)) != 0) {
132 } else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) {
141 } else if (looks_latin1(buf, nbytes, *ubuf, ulen)) {
145 } else if (looks_extended(buf, nbytes, *ubuf, ulen)) {
159 if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) {
163 } else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) {
177 if (ubuf == &udefbuf)
264 looks_ ## NAME(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf, \
277 ubuf[(*ulen)++] = buf[i]; \
294 * If ubuf is non-NULL on entry, text is decoded into ubuf, *ulen;
295 * ubuf must be big enough!
350 file_looks_utf8(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf,
358 if (ubuf)
371 if (ubuf)
372 ubuf[(*ulen)++] = buf[i];
416 if (ubuf)
417 ubuf[(*ulen)++] = c;
432 file_unichar_t *ubuf, size_t *ulen)
435 return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen);
441 looks_utf7(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf,
450 if (ubuf)