Home | History | Annotate | Download | only in libxml2

Lines Matching defs:out

81  * Handle an out of memory condition
160 * @out: a pointer to an array of bytes to store the result
161 * @outlen: the length of @out
166 * block of chars out.
173 asciiToUTF8(unsigned char* out, int *outlen,
175 unsigned char* outstart = out;
178 unsigned char* outend = out + *outlen;
183 while ((in < inend) && (out - outstart + 5 < *outlen)) {
186 if (out >= outend)
189 *out++ = c;
191 *outlen = out - outstart;
198 *outlen = out - outstart;
206 * @out: a pointer to an array of bytes to store the result
207 * @outlen: the length of @out
212 * block of chars out.
220 UTF8Toascii(unsigned char* out, int *outlen,
224 const unsigned char* outstart = out;
230 if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
240 outend = out + (*outlen);
246 *outlen = out - outstart;
254 *outlen = out - outstart;
272 if (out >= outend)
274 *out++ = c;
277 *outlen = out - outstart;
283 *outlen = out - outstart;
291 * @out: a pointer to an array of bytes to store the result
292 * @outlen: the length of @out
297 * block of chars out.
304 isolat1ToUTF8(unsigned char* out, int *outlen,
306 unsigned char* outstart = out;
312 if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
315 outend = out + *outlen;
319 while ((in < inend) && (out < outend - 1)) {
321 *out++ = (((*in) >> 6) & 0x1F) | 0xC0;
322 *out++ = ((*in) & 0x3F) | 0x80;
325 if ((instop - in) > (outend - out)) instop = in + (outend - out);
327 *out++ = *in++;
330 if ((in < inend) && (out < outend) && (*in < 0x80)) {
331 *out++ = *in++;
333 *outlen = out - outstart;
340 * @out: a pointer to an array of bytes to store the result
341 * @outlen: the length of @out
352 UTF8ToUTF8(unsigned char* out, int *outlen,
357 if ((out == NULL) || (inb == NULL) || (outlen == NULL) || (inlenb == NULL))
367 memcpy(out, inb, len);
378 * @out: a pointer to an array of bytes to store the result
379 * @outlen: the length of @out
384 * block of chars out.
393 UTF8Toisolat1(unsigned char* out, int *outlen,
397 const unsigned char* outstart = out;
403 if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
413 outend = out + (*outlen);
419 *outlen = out - outstart;
427 *outlen = out - outstart;
440 *outlen = out - outstart;
450 if (out >= outend)
452 *out++ = c;
455 *outlen = out - outstart;
461 *outlen = out - outstart;
469 * @out: a pointer to an array of bytes to store the result
470 * @outlen: the length of @out
475 * block of chars out. This function assumes the endian property
485 UTF16LEToUTF8(unsigned char* out, int *outlen,
488 unsigned char* outstart = out;
490 unsigned char* outend = out + *outlen;
501 while ((in < inend) && (out - outstart + 5 < *outlen)) {
529 *outlen = out - outstart;
536 if (out >= outend)
538 if (c < 0x80) { *out++= c; bits= -6; }
539 else if (c < 0x800) { *out++= ((c >> 6) & 0x1F) | 0xC0; bits= 0; }
540 else if (c < 0x10000) { *out++= ((c >> 12) & 0x0F) | 0xE0; bits= 6; }
541 else { *out++= ((c >> 18) & 0x07) | 0xF0; bits= 12; }
544 if (out >= outend)
546 *out++= ((c >> bits) & 0x3F) | 0x80;
550 *outlen = out - outstart;
564 * block of chars out.
573 unsigned short* out = (unsigned short*) outb;
576 unsigned short* outstart= out;
585 if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
592 outend = out + (*outlen / 2);
598 *outlen = (out - outstart) * 2;
606 *outlen = (out - outstart) * 2;
624 if (out >= outend)
627 *out++ = c;
629 tmp = (unsigned char *) out;
632 out++;
636 if (out+1 >= outend)
640 *out++ = 0xD800 | (c >> 10);
641 *out++ = 0xDC00 | (c & 0x03FF);
644 tmp = (unsigned char *) out;
647 out++;
650 tmp = (unsigned char *) out;
653 out++;
660 *outlen = (out - outstart) * 2;
673 * block of chars out.
707 * @out: a pointer to an array of bytes to store the result
708 * @outlen: the length of @out
713 * block of chars out. This function assumes the endian property
723 UTF16BEToUTF8(unsigned char* out, int *outlen,
726 unsigned char* outstart = out;
728 unsigned char* outend = out + *outlen;
751 *outlen = out - outstart;
771 *outlen = out - outstart;
778 if (out >= outend)
780 if (c < 0x80) { *out++= c; bits= -6; }
781 else if (c < 0x800) { *out++= ((c >> 6) & 0x1F) | 0xC0; bits= 0; }
782 else if (c < 0x10000) { *out++= ((c >> 12) & 0x0F) | 0xE0; bits= 6; }
783 else { *out++= ((c >> 18) & 0x07) | 0xF0; bits= 12; }
786 if (out >= outend)
788 *out++= ((c >> bits) & 0x3F) | 0x80;
792 *outlen = out - outstart;
806 * block of chars out.
815 unsigned short* out = (unsigned short*) outb;
818 unsigned short* outstart= out;
834 outend = out + (*outlen / 2);
840 *outlen = out - outstart;
848 *outlen = out - outstart;
865 if (out >= outend) break;
867 tmp = (unsigned char *) out;
870 out++;
872 *out++ = c;
876 if (out+1 >= outend) break;
880 tmp = (unsigned char *) out;
883 out++;
886 tmp = (unsigned char *) out;
889 out++;
891 *out++ = 0xD800 | (c >> 10);
892 *out++ = 0xDC00 | (c & 0x03FF);
899 *outlen = (out - outstart) * 2;
1340 xmlEncodingErrMemory("xmlNewCharEncodingHandler : out of memory !\n");
1351 xmlEncodingErrMemory("xmlNewCharEncodingHandler : out of memory !\n");
1405 xmlEncodingErrMemory("xmlInitCharEncodingHandlers : out of memory !\n");
1776 * @out: a pointer to an array of bytes to store the result
1777 * @outlen: the length of @out
1792 xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
1796 char *icv_out = (char *) out;
1799 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
1843 * @out: a pointer to an array of bytes to store the result
1844 * @outlen: the length of @out
1859 xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
1862 char *ucv_out = (char *) out;
1865 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
1889 *outlen = ucv_out - (char *) out;
1910 * @out: an xmlBuffer for the output.
1923 xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
1930 if (out == NULL) return(-1);
1934 written = out->size - out->use - 1; /* count '\0' */
1952 xmlBufferGrow(out, toconv * 2);
1953 written = out->size - out->use - 1;
1957 ret = handler->input(&out->content[out->use], &written,
1960 out->use += written;
1961 out->content[out->use] = 0;
1965 ret = xmlIconvWrapper(handler->iconv_in, &out->content[out->use],
1968 out->use += written;
1969 out->content[out->use] = 0;
1975 ret = xmlUconvWrapper(handler->uconv_in, 1, &out->content[out->use],
1978 out->use += written;
1979 out->content[out->use] = 0;
2017 * @out: an xmlBuffer for the output.
2029 xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out,
2031 return(xmlCharEncFirstLineInt(handler, out, in, -1));
2042 * out that a different decoder is needed to process the input.
2058 xmlBufPtr out;
2063 out = input->buffer;
2069 written = xmlBufAvail(out) - 1; /* count '\0' */
2086 xmlBufGrow(out, toconv * 2);
2087 written = xmlBufAvail(out) - 1;
2095 ret = input->encoder->input(xmlBufEnd(out), &c_out,
2098 xmlBufAddLen(out, c_out);
2102 ret = xmlIconvWrapper(input->encoder->iconv_in, xmlBufEnd(out),
2105 xmlBufAddLen(out, c_out);
2112 ret = xmlUconvWrapper(input->encoder->uconv_in, 1, xmlBufEnd(out),
2115 xmlBufAddLen(out, c_out);
2184 xmlBufPtr out;
2189 out = input->buffer;
2197 written = xmlBufAvail(out);
2201 out, toconv * 2);
2202 written = xmlBufAvail(out);
2212 ret = input->encoder->input(xmlBufEnd(out), &c_out,
2215 xmlBufAddLen(out, c_out);
2219 ret = xmlIconvWrapper(input->encoder->iconv_in, xmlBufEnd(out),
2222 xmlBufAddLen(out, c_out);
2229 ret = xmlUconvWrapper(input->encoder->uconv_in, 1, xmlBufEnd(out),
2232 xmlBufAddLen(out, c_out);
2283 * @out: an xmlBuffer for the output.
2294 xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
2303 if (out == NULL)
2311 written = out->size - out->use -1; /* count '\0' */
2313 xmlBufferGrow(out, out->size + toconv * 2);
2314 written = out->size - out->use - 1;
2317 ret = handler->input(&out->content[out->use], &written,
2320 out->use += written;
2321 out->content[out->use] = 0;
2325 ret = xmlIconvWrapper(handler->iconv_in, &out->content[out->use],
2328 out->use += written;
2329 out->content[out->use] = 0;
2336 ret = xmlUconvWrapper(handler->uconv_in, 1, &out->content[out->use],
2339 out->use += written;
2340 out->content[out->use] = 0;
2415 xmlBufPtr out;
2421 out = output->conv;
2426 written = xmlBufAvail(out);
2437 ret = output->encoder->output(xmlBufEnd(out), &c_out,
2440 xmlBufAddLen(out, c_out);
2444 ret = xmlIconvWrapper(output->encoder->iconv_out, xmlBufEnd(out),
2446 xmlBufAddLen(out, c_out);
2451 ret = xmlUconvWrapper(output->encoder->uconv_out, 0, xmlBufEnd(out),
2453 xmlBufAddLen(out, c_out);
2472 xmlBufGrow(out, toconv * 4);
2473 written = xmlBufAvail(out) - 1;
2481 ret = output->encoder->output(xmlBufEnd(out), &c_out,
2485 xmlBufAddLen(out, c_out);
2491 ret = xmlIconvWrapper(output->encoder->iconv_out, xmlBufEnd(out),
2494 xmlBufAddLen(out, c_out);
2510 ret = xmlUconvWrapper(output->encoder->uconv_out, 0, xmlBufEnd(out),
2513 xmlBufAddLen(out, c_out);
2569 xmlBufErase(out, c_out);
2621 * @out: an xmlBuffer for the output.
2637 xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out,
2647 if (out == NULL) return(-1);
2651 written = out->size - out->use;
2662 ret = handler->output(&out->content[out->use], &written,
2665 out->use += written;
2666 out->content[out->use] = 0;
2671 ret = xmlIconvWrapper(handler->iconv_out, &out->content[out->use],
2673 out->use += written;
2674 out->content[out->use] = 0;
2680 &out->content[out->use],
2682 out->use += written;
2683 out->content[out->use] = 0;
2700 xmlBufferGrow(out, toconv * 4);
2701 written = out->size - out->use - 1;
2704 ret = handler->output(&out->content[out->use], &written,
2708 out->use += written;
2711 out->content[out->use] = 0;
2715 ret = xmlIconvWrapper(handler->iconv_out, &out->content[out->use],
2718 out->use += written;
2720 out->content[out->use] = 0;
2736 &out->content[out->use],
2739 out->use += written;
2741 out->content[out->use] = 0;
2796 out->use -= written;
3018 * @out: a pointer to an array of bytes to store the result
3019 * @outlen: the length of @out
3025 * block of chars out.
3033 UTF8ToISO8859x(unsigned char* out, int *outlen,
3036 const unsigned char* outstart = out;
3041 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
3056 *out++ = d;
3059 *outlen = out - outstart;
3066 *outlen = out - outstart;
3073 *outlen = out - outstart;
3082 *outlen = out - outstart;
3086 *out++ = d;
3092 *outlen = out - outstart;
3099 *outlen = out - outstart;
3106 *outlen = out - outstart;
3117 *outlen = out - outstart;
3121 *out++ = d;
3124 *outlen = out - outstart;
3130 *outlen = out - outstart;
3137 * @out: a pointer to an array of bytes to store the result
3138 * @outlen: the length of @out
3143 * block of chars out.
3149 ISO8859xToUTF8(unsigned char* out, int *outlen,
3152 unsigned char* outstart = out;
3159 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
3162 outend = out + *outlen;
3166 while ((in < inend) && (out < outend - 2)) {
3171 *outlen = out - outstart;
3176 *out++ = ((c >> 6) & 0x1F) | 0xC0;
3177 *out++ = (c & 0x3F) | 0x80;
3179 *out++ = ((c >> 12) & 0x0F) | 0xE0;
3180 *out++ = ((c >> 6) & 0x3F) | 0x80;
3181 *out++ = (c & 0x3F) | 0x80;
3185 if (instop - in > outend - out) instop = in + (outend - out);
3187 *out++ = *in++;
3190 if ((in < inend) && (out < outend) && (*in < 0x80)) {
3191 *out++ = *in++;
3193 if ((in < inend) && (out < outend) && (*in < 0x80)) {
3194 *out++ = *in++;
3196 *outlen = out - outstart;
3937 static int ISO8859_2ToUTF8 (unsigned char* out, int *outlen,
3939 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_2);
3941 static int UTF8ToISO8859_2 (unsigned char* out, int *outlen,
3943 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_2);
3946 static int ISO8859_3ToUTF8 (unsigned char* out, int *outlen,
3948 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_3);
3950 static int UTF8ToISO8859_3 (unsigned char* out, int *outlen,
3952 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_3);
3955 static int ISO8859_4ToUTF8 (unsigned char* out, int *outlen,
3957 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_4);
3959 static int UTF8ToISO8859_4 (unsigned char* out, int *outlen,
3961 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_4);
3964 static int ISO8859_5ToUTF8 (unsigned char* out, int *outlen,
3966 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_5);
3968 static int UTF8ToISO8859_5 (unsigned char* out, int *outlen,
3970 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_5);
3973 static int ISO8859_6ToUTF8 (unsigned char* out, int *outlen,
3975 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_6);
3977 static int UTF8ToISO8859_6 (unsigned char* out, int *outlen,
3979 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_6);
3982 static int ISO8859_7ToUTF8 (unsigned char* out, int *outlen,
3984 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_7);
3986 static int UTF8ToISO8859_7 (unsigned char* out, int *outlen,
3988 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_7);
3991 static int ISO8859_8ToUTF8 (unsigned char* out, int *outlen,
3993 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_8);
3995 static int UTF8ToISO8859_8 (unsigned char* out, int *outlen,
3997 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_8);
4000 static int ISO8859_9ToUTF8 (unsigned char* out, int *outlen,
4002 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_9);
4004 static int UTF8ToISO8859_9 (unsigned char* out, int *outlen,
4006 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_9);
4009 static int ISO8859_10ToUTF8 (unsigned char* out, int *outlen,
4011 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_10);
4013 static int UTF8ToISO8859_10 (unsigned char* out, int *outlen,
4015 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_10);
4018 static int ISO8859_11ToUTF8 (unsigned char* out, int *outlen,
4020 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_11);
4022 static int UTF8ToISO8859_11 (unsigned char* out, int *outlen,
4024 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_11);
4027 static int ISO8859_13ToUTF8 (unsigned char* out, int *outlen,
4029 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_13);
4031 static int UTF8ToISO8859_13 (unsigned char* out, int *outlen,
4033 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_13);
4036 static int ISO8859_14ToUTF8 (unsigned char* out, int *outlen,
4038 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_14);
4040 static int UTF8ToISO8859_14 (unsigned char* out, int *outlen,
4042 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_14);
4045 static int ISO8859_15ToUTF8 (unsigned char* out, int *outlen,
4047 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_15);
4049 static int UTF8ToISO8859_15 (unsigned char* out, int *outlen,
4051 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_15);
4054 static int ISO8859_16ToUTF8 (unsigned char* out, int *outlen,
4056 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_16);
4058 static int UTF8ToISO8859_16 (unsigned char* out, int *outlen,
4060 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_16);