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 xmlBufGrow(out
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;
2414 xmlBufPtr out;
2420 out = output->conv;
2425 written = xmlBufAvail(out);
2436 ret = output->encoder->output(xmlBufEnd(out), &c_out,
2439 xmlBufAddLen(out, c_out);
2443 ret = xmlIconvWrapper(output->encoder->iconv_out, xmlBufEnd(out),
2445 xmlBufAddLen(out, c_out);
2450 ret = xmlUconvWrapper(output->encoder->uconv_out, 0, xmlBufEnd(out),
2452 xmlBufAddLen(out, c_out);
2471 xmlBufGrow(out, toconv * 4);
2472 written = xmlBufAvail(out) - 1;
2480 ret = output->encoder->output(xmlBufEnd(out), &c_out,
2484 xmlBufAddLen(out, c_out);
2490 ret = xmlIconvWrapper(output->encoder->iconv_out, xmlBufEnd(out),
2493 xmlBufAddLen(out, c_out);
2509 ret = xmlUconvWrapper(output->encoder->uconv_out, 0, xmlBufEnd(out),
2512 xmlBufAddLen(out, c_out);
2568 xmlBufErase(out, c_out);
2619 * @out: an xmlBuffer for the output.
2635 xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out,
2645 if (out == NULL) return(-1);
2649 written = out->size - out->use;
2660 ret = handler->output(&out->content[out->use], &written,
2663 out->use += written;
2664 out->content[out->use] = 0;
2669 ret = xmlIconvWrapper(handler->iconv_out, &out->content[out->use],
2671 out->use += written;
2672 out->content[out->use] = 0;
2678 &out->content[out->use],
2680 out->use += written;
2681 out->content[out->use] = 0;
2698 xmlBufferGrow(out, toconv * 4);
2699 written = out->size - out->use - 1;
2702 ret = handler->output(&out->content[out->use], &written,
2706 out->use += written;
2709 out->content[out->use] = 0;
2713 ret = xmlIconvWrapper(handler->iconv_out, &out->content[out->use],
2716 out->use += written;
2718 out->content[out->use] = 0;
2734 &out->content[out->use],
2737 out->use += written;
2739 out->content[out->use] = 0;
2794 out->use -= written;
3004 * @out: a pointer to an array of bytes to store the result
3005 * @outlen: the length of @out
3011 * block of chars out.
3019 UTF8ToISO8859x(unsigned char* out, int *outlen,
3022 const unsigned char* outstart = out;
3027 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
3042 *out++ = d;
3045 *outlen = out - outstart;
3052 *outlen = out - outstart;
3059 *outlen = out - outstart;
3068 *outlen = out - outstart;
3072 *out++ = d;
3078 *outlen = out - outstart;
3085 *outlen = out - outstart;
3092 *outlen = out - outstart;
3103 *outlen = out - outstart;
3107 *out++ = d;
3110 *outlen = out - outstart;
3116 *outlen = out - outstart;
3123 * @out: a pointer to an array of bytes to store the result
3124 * @outlen: the length of @out
3129 * block of chars out.
3135 ISO8859xToUTF8(unsigned char* out, int *outlen,
3138 unsigned char* outstart = out;
3145 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
3148 outend = out + *outlen;
3152 while ((in < inend) && (out < outend - 2)) {
3157 *outlen = out - outstart;
3162 *out++ = ((c >> 6) & 0x1F) | 0xC0;
3163 *out++ = (c & 0x3F) | 0x80;
3165 *out++ = ((c >> 12) & 0x0F) | 0xE0;
3166 *out++ = ((c >> 6) & 0x3F) | 0x80;
3167 *out++ = (c & 0x3F) | 0x80;
3171 if (instop - in > outend - out) instop = in + (outend - out);
3173 *out++ = *in++;
3176 if ((in < inend) && (out < outend) && (*in < 0x80)) {
3177 *out++ = *in++;
3179 if ((in < inend) && (out < outend) && (*in < 0x80)) {
3180 *out++ = *in++;
3182 *outlen = out - outstart;
3923 static int ISO8859_2ToUTF8 (unsigned char* out, int *outlen,
3925 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_2);
3927 static int UTF8ToISO8859_2 (unsigned char* out, int *outlen,
3929 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_2);
3932 static int ISO8859_3ToUTF8 (unsigned char* out, int *outlen,
3934 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_3);
3936 static int UTF8ToISO8859_3 (unsigned char* out, int *outlen,
3938 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_3);
3941 static int ISO8859_4ToUTF8 (unsigned char* out, int *outlen,
3943 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_4);
3945 static int UTF8ToISO8859_4 (unsigned char* out, int *outlen,
3947 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_4);
3950 static int ISO8859_5ToUTF8 (unsigned char* out, int *outlen,
3952 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_5);
3954 static int UTF8ToISO8859_5 (unsigned char* out, int *outlen,
3956 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_5);
3959 static int ISO8859_6ToUTF8 (unsigned char* out, int *outlen,
3961 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_6);
3963 static int UTF8ToISO8859_6 (unsigned char* out, int *outlen,
3965 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_6);
3968 static int ISO8859_7ToUTF8 (unsigned char* out, int *outlen,
3970 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_7);
3972 static int UTF8ToISO8859_7 (unsigned char* out, int *outlen,
3974 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_7);
3977 static int ISO8859_8ToUTF8 (unsigned char* out, int *outlen,
3979 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_8);
3981 static int UTF8ToISO8859_8 (unsigned char* out, int *outlen,
3983 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_8);
3986 static int ISO8859_9ToUTF8 (unsigned char* out, int *outlen,
3988 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_9);
3990 static int UTF8ToISO8859_9 (unsigned char* out, int *outlen,
3992 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_9);
3995 static int ISO8859_10ToUTF8 (unsigned char* out, int *outlen,
3997 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_10);
3999 static int UTF8ToISO8859_10 (unsigned char* out, int *outlen,
4001 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_10);
4004 static int ISO8859_11ToUTF8 (unsigned char* out, int *outlen,
4006 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_11);
4008 static int UTF8ToISO8859_11 (unsigned char* out, int *outlen,
4010 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_11);
4013 static int ISO8859_13ToUTF8 (unsigned char* out, int *outlen,
4015 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_13);
4017 static int UTF8ToISO8859_13 (unsigned char* out, int *outlen,
4019 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_13);
4022 static int ISO8859_14ToUTF8 (unsigned char* out, int *outlen,
4024 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_14);
4026 static int UTF8ToISO8859_14 (unsigned char* out, int *outlen,
4028 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_14);
4031 static int ISO8859_15ToUTF8 (unsigned char* out, int *outlen,
4033 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_15);
4035 static int UTF8ToISO8859_15 (unsigned char* out, int *outlen,
4037 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_15);
4040 static int ISO8859_16ToUTF8 (unsigned char* out, int *outlen,
4042 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_16);
4044 static int UTF8ToISO8859_16 (unsigned char* out, int *outlen,
4046 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_16);