Go to the source code of this file.
◆ xmlCharEncFirstLineInput()
xmlCharEncFirstLineInput: @input: a parser input buffer @len: number of bytes to convert for the first line, or -1
Front-end for the encoding handler input function, but handle only the very first line. Point is that this is based on autodetection of the encoding and once that first line is converted we may find out that a different decoder is needed to process the input.
Returns the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or
Definition at line 2181 of file encoding.c.
2210 if (toconv > (
unsigned int)
len)
2216 if (toconv * 2 >= written) {
2234 #ifdef DEBUG_ENCODING 2236 "converted %d bytes to %d bytes of input\n",
2241 #ifdef DEBUG_ENCODING 2243 "converted %d bytes to %d bytes of input, %d left\n",
2248 #ifdef DEBUG_ENCODING 2250 "converted %d bytes to %d bytes of input, %d left\n",
2258 snprintf(&
buf[0], 49,
"0x%02X 0x%02X 0x%02X 0x%02X",
2263 "input conversion failed due to input error, bytes %s\n",
2272 return(c_out ? c_out :
ret);
int xmlBufGrow(xmlBufPtr buf, int len)
XMLPUBFUN xmlChar *XMLCALL xmlBufContent(const xmlBuf *buf)
int xmlBufAddLen(xmlBufPtr buf, size_t len)
XMLPUBFUN xmlChar *XMLCALL xmlBufEnd(xmlBufPtr buf)
static int xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out, int *outlen, const unsigned char *in, int *inlen, int flush)
GLenum GLuint GLenum GLsizei const GLchar * buf
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
size_t xmlBufAvail(const xmlBufPtr buf)
GLenum GLenum GLenum input
XMLPUBFUN size_t XMLCALL xmlBufUse(const xmlBufPtr buf)
XMLPUBFUN size_t XMLCALL xmlBufShrink(xmlBufPtr buf, size_t len)
XMLPUBVAR void * xmlGenericErrorContext
Referenced by xmlSwitchInputEncodingInt().
◆ xmlCharEncFirstLineInt()
xmlCharEncFirstLineInt: @handler: char encoding transformation data structure @out: an xmlBuffer for the output. @in: an xmlBuffer for the input @len: number of bytes to convert for the first line, or -1
Front-end for the encoding handler input function, but handle only the very first line, i.e. limit itself to 45 chars.
Returns the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or
Definition at line 2074 of file encoding.c.
2082 if (
in ==
NULL)
return(-1);
2085 written =
out->size -
out->use - 1;
2102 if (toconv * 2 >= written) {
2104 written =
out->size -
out->use - 1;
2108 in->content, &toconv, 0);
2110 out->use += written;
2111 out->content[
out->use] = 0;
2114 #ifdef DEBUG_ENCODING 2118 "converted %d bytes to %d bytes of input\n",
2123 toconv, written,
in->use);
2127 "input conversion failed due to input error\n");
2131 toconv, written,
in->use);
2142 return(written ? written :
ret);
static int xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out, int *outlen, const unsigned char *in, int *inlen, int flush)
XMLPUBFUN int XMLCALL xmlBufferGrow(xmlBufferPtr buf, unsigned int len)
XMLPUBFUN int XMLCALL xmlBufferShrink(xmlBufferPtr buf, unsigned int len)
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
UINT(* handler)(MSIPACKAGE *)
XMLPUBVAR void * xmlGenericErrorContext
Referenced by xmlCharEncFirstLine().
◆ xmlCharEncInput()
xmlCharEncInput: @input: a parser input buffer @flush: try to flush all the raw buffer
Generic front-end for the encoding handler on parser input
Returns the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or
Definition at line 2288 of file encoding.c.
2307 if ((toconv > 64 * 1024) && (
flush == 0))
2310 if (toconv * 2 >= written) {
2314 if ((written > 128 * 1024) && (
flush == 0))
2315 written = 128 * 1024;
2328 #ifdef DEBUG_ENCODING 2330 "converted %d bytes to %d bytes of input\n",
2335 #ifdef DEBUG_ENCODING 2337 "converted %d bytes to %d bytes of input, %d left\n",
2342 #ifdef DEBUG_ENCODING 2344 "converted %d bytes to %d bytes of input, %d left\n",
2352 snprintf(&
buf[0], 49,
"0x%02X 0x%02X 0x%02X 0x%02X",
2357 "input conversion failed due to input error, bytes %s\n",
2366 return (c_out? c_out :
ret);
int xmlBufGrow(xmlBufPtr buf, int len)
XMLPUBFUN xmlChar *XMLCALL xmlBufContent(const xmlBuf *buf)
int xmlBufAddLen(xmlBufPtr buf, size_t len)
XMLPUBFUN xmlChar *XMLCALL xmlBufEnd(xmlBufPtr buf)
static int xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out, int *outlen, const unsigned char *in, int *inlen, int flush)
GLenum GLuint GLenum GLsizei const GLchar * buf
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
size_t xmlBufAvail(const xmlBufPtr buf)
GLenum GLenum GLenum input
XMLPUBFUN size_t XMLCALL xmlBufUse(const xmlBufPtr buf)
XMLPUBFUN size_t XMLCALL xmlBufShrink(xmlBufPtr buf, size_t len)
XMLPUBVAR void * xmlGenericErrorContext
Referenced by xmlSwitchInputEncodingInt().
◆ xmlCharEncOutput()