libxml2
Loading...
Searching...
No Matches
xmlIO.h File Reference

I/O interfaces used by the parser. More...

Data Structures

struct  _xmlParserInputBuffer
 Parser input buffer. More...
struct  _xmlOutputBuffer
 Output buffer. More...

Typedefs

typedef int(* xmlInputMatchCallback) (const char *filename)
 Callback used in the I/O Input API to detect if the current handler can provide input functionality for this resource.
typedef void *(* xmlInputOpenCallback) (const char *filename)
 Callback used in the I/O Input API to open the resource.
typedef int(* xmlInputReadCallback) (void *context, char *buffer, int len)
 Callback used in the I/O Input API to read the resource.
typedef int(* xmlInputCloseCallback) (void *context)
 Callback used in the I/O Input API to close the resource.
typedef int(* xmlOutputMatchCallback) (const char *filename)
 Callback used in the I/O Output API to detect if the current handler can provide output functionality for this resource.
typedef void *(* xmlOutputOpenCallback) (const char *filename)
 Callback used in the I/O Output API to open the resource.
typedef int(* xmlOutputWriteCallback) (void *context, const char *buffer, int len)
 Callback used in the I/O Output API to write to the resource.
typedef int(* xmlOutputCloseCallback) (void *context)
 Callback used in the I/O Output API to close the resource.
typedef xmlParserInputBuffer *(* xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc)
 Signature for the function doing the lookup for a suitable input method corresponding to an URI.
typedef xmlOutputBuffer *(* xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandler *encoder, int compression)
 Signature for the function doing the lookup for a suitable output method corresponding to an URI.

Functions

void xmlCleanupInputCallbacks (void)
 clears the entire input callback table.
int xmlPopInputCallbacks (void)
 Clear the top input callback from the input stack.
void xmlRegisterDefaultInputCallbacks (void)
 Registers the default compiled-in I/O handlers.
xmlParserInputBufferxmlAllocParserInputBuffer (xmlCharEncoding enc)
 Create a buffered parser input for progressive parsing.
xmlParserInputBufferxmlParserInputBufferCreateFilename (const char *URI, xmlCharEncoding enc)
 Create a buffered parser input for the progressive parsing of a file Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.
xmlParserInputBufferxmlParserInputBufferCreateFile (FILE *file, xmlCharEncoding enc)
 Create a buffered parser input for the progressive parsing of a FILE * buffered C I/O.
xmlParserInputBufferxmlParserInputBufferCreateFd (int fd, xmlCharEncoding enc)
 Create a buffered parser input for the progressive parsing for the input from a file descriptor.
xmlParserInputBufferxmlParserInputBufferCreateMem (const char *mem, int size, xmlCharEncoding enc)
 Create a parser input buffer for parsing from a memory area.
xmlParserInputBufferxmlParserInputBufferCreateStatic (const char *mem, int size, xmlCharEncoding enc)
 Create a parser input buffer for parsing from a memory area.
xmlParserInputBufferxmlParserInputBufferCreateIO (xmlInputReadCallback ioread, xmlInputCloseCallback ioclose, void *ioctx, xmlCharEncoding enc)
 Create a buffered parser input for the progressive parsing for the input from an I/O handler.
int xmlParserInputBufferRead (xmlParserInputBuffer *in, int len)
 Same as xmlParserInputBufferGrow.
int xmlParserInputBufferGrow (xmlParserInputBuffer *in, int len)
 Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode.
int xmlParserInputBufferPush (xmlParserInputBuffer *in, int len, const char *buf)
 Push the content of the arry in the input buffer This routine handle the I18N transcoding to internal UTF-8 This is used when operating the parser in progressive (push) mode.
void xmlFreeParserInputBuffer (xmlParserInputBuffer *in)
 Free up the memory used by a buffered parser input.
char * xmlParserGetDirectory (const char *filename)
 lookup the directory for that file
int xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc, xmlInputOpenCallback openFunc, xmlInputReadCallback readFunc, xmlInputCloseCallback closeFunc)
 Register a new set of I/O callback for handling parser input.
xmlParserInputBuffer__xmlParserInputBufferCreateFilename (const char *URI, xmlCharEncoding enc)
 Create a buffered parser input for the progressive parsing of a file Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.
void xmlCleanupOutputCallbacks (void)
 clears the entire output callback table.
int xmlPopOutputCallbacks (void)
 Remove the top output callbacks from the output stack.
void xmlRegisterDefaultOutputCallbacks (void)
 Registers the default compiled-in I/O handlers.
xmlOutputBufferxmlAllocOutputBuffer (xmlCharEncodingHandler *encoder)
 Create a buffered parser output.
xmlOutputBufferxmlOutputBufferCreateFilename (const char *URI, xmlCharEncodingHandler *encoder, int compression)
 Create a buffered output for the progressive saving of a file If filename is "-" then we use stdout as the output.
xmlOutputBufferxmlOutputBufferCreateFile (FILE *file, xmlCharEncodingHandler *encoder)
 Create a buffered output for the progressive saving to a FILE * buffered C I/O.
xmlOutputBufferxmlOutputBufferCreateBuffer (xmlBuffer *buffer, xmlCharEncodingHandler *encoder)
 Create a buffered output for the progressive saving to a xmlBuffer.
xmlOutputBufferxmlOutputBufferCreateFd (int fd, xmlCharEncodingHandler *encoder)
 Create a buffered output for the progressive saving to a file descriptor.
xmlOutputBufferxmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite, xmlOutputCloseCallback ioclose, void *ioctx, xmlCharEncodingHandler *encoder)
 Create a buffered output for the progressive saving to an I/O handler.
const xmlCharxmlOutputBufferGetContent (xmlOutputBuffer *out)
 Gives a pointer to the data currently held in the output buffer.
size_t xmlOutputBufferGetSize (xmlOutputBuffer *out)
 Gives the length of the data currently held in the output buffer.
int xmlOutputBufferWrite (xmlOutputBuffer *out, int len, const char *buf)
 Write the content of the array in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e.
int xmlOutputBufferWriteString (xmlOutputBuffer *out, const char *str)
 Write the content of the string in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e.
int xmlOutputBufferWriteEscape (xmlOutputBuffer *out, const xmlChar *str, xmlCharEncodingOutputFunc escaping)
 Write the content of the string in the output I/O buffer This routine escapes the characters and then handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e.
int xmlOutputBufferFlush (xmlOutputBuffer *out)
 flushes the output I/O channel
int xmlOutputBufferClose (xmlOutputBuffer *out)
 flushes and close the output I/O channel and free up all the associated resources
int xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc, xmlOutputOpenCallback openFunc, xmlOutputWriteCallback writeFunc, xmlOutputCloseCallback closeFunc)
 Register a new set of I/O callback for handling output.
xmlOutputBuffer__xmlOutputBufferCreateFilename (const char *URI, xmlCharEncodingHandler *encoder, int compression)
 Create a buffered output for the progressive saving of a file If filename is "-" then we use stdout as the output.
xmlParserInputxmlCheckHTTPInput (xmlParserCtxt *ctxt, xmlParserInput *ret)
xmlParserInputxmlNoNetExternalEntityLoader (const char *URL, const char *ID, xmlParserCtxt *ctxt)
 A specific entity loader disabling network accesses, though still allowing local catalog accesses for resolution.
xmlCharxmlNormalizeWindowsPath (const xmlChar *path)
int xmlCheckFilename (const char *path)
 if stat is not available on the target machine,
int xmlFileMatch (const char *filename)
void * xmlFileOpen (const char *filename)
int xmlFileRead (void *context, char *buffer, int len)
int xmlFileClose (void *context)
xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func)
 Registers a callback for URI input file handling.
xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func)
 Registers a callback for URI output file handling.
xmlOutputBufferCreateFilenameFunc xmlThrDefOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func)
 Set per-thread default value.
xmlParserInputBufferCreateFilenameFunc xmlThrDefParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func)
 Set per-thread default value.

Detailed Description

I/O interfaces used by the parser.

Functions and datatypes for parser input and output.

Author
Daniel Veillard

Typedef Documentation

◆ xmlInputCloseCallback

typedef int(* xmlInputCloseCallback) (void *context)

Callback used in the I/O Input API to close the resource.

Parameters
contextan Input context
Returns
0 or -1 in case of error

◆ xmlInputMatchCallback

typedef int(* xmlInputMatchCallback) (const char *filename)

Callback used in the I/O Input API to detect if the current handler can provide input functionality for this resource.

Parameters
filenamethe filename or URI
Returns
1 if yes and 0 if another Input module should be used

◆ xmlInputOpenCallback

typedef void *(* xmlInputOpenCallback) (const char *filename)

Callback used in the I/O Input API to open the resource.

Parameters
filenamethe filename or URI
Returns
an Input context or NULL in case or error

◆ xmlInputReadCallback

typedef int(* xmlInputReadCallback) (void *context, char *buffer, int len)

Callback used in the I/O Input API to read the resource.

Parameters
contextan Input context
bufferthe buffer to store data read
lenthe length of the buffer in bytes
Returns
the number of bytes read or -1 in case of error

◆ xmlOutputBufferCreateFilenameFunc

typedef xmlOutputBuffer *(* xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandler *encoder, int compression)

Signature for the function doing the lookup for a suitable output method corresponding to an URI.

Parameters
URIthe URI to write to
encoderthe requested target encoding
compressioncompression level
Returns
the new xmlOutputBuffer in case of success or NULL if no method was found.

◆ xmlOutputCloseCallback

typedef int(* xmlOutputCloseCallback) (void *context)

Callback used in the I/O Output API to close the resource.

Parameters
contextan Output context
Returns
0 or -1 in case of error

◆ xmlOutputMatchCallback

typedef int(* xmlOutputMatchCallback) (const char *filename)

Callback used in the I/O Output API to detect if the current handler can provide output functionality for this resource.

Parameters
filenamethe filename or URI
Returns
1 if yes and 0 if another Output module should be used

◆ xmlOutputOpenCallback

typedef void *(* xmlOutputOpenCallback) (const char *filename)

Callback used in the I/O Output API to open the resource.

Parameters
filenamethe filename or URI
Returns
an Output context or NULL in case or error

◆ xmlOutputWriteCallback

typedef int(* xmlOutputWriteCallback) (void *context, const char *buffer, int len)

Callback used in the I/O Output API to write to the resource.

Parameters
contextan Output context
bufferthe buffer of data to write
lenthe length of the buffer in bytes
Returns
the number of bytes written or -1 in case of error

◆ xmlParserInputBufferCreateFilenameFunc

typedef xmlParserInputBuffer *(* xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc)

Signature for the function doing the lookup for a suitable input method corresponding to an URI.

Parameters
URIthe URI to read from
encthe requested source encoding
Returns
the new xmlParserInputBuffer in case of success or NULL if no method was found.

Function Documentation

◆ __xmlOutputBufferCreateFilename()

xmlOutputBuffer * __xmlOutputBufferCreateFilename ( const char * URI,
xmlCharEncodingHandler * encoder,
int compression )

Create a buffered output for the progressive saving of a file If filename is "-" then we use stdout as the output.

Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.

Consumes encoder but not in error case.

Internal implementation, never uses the callback installed with xmlOutputBufferCreateFilenameDefault.

Parameters
URIa C string containing the URI or filename
encoderthe encoding converter or NULL
compressionthe compression ration (0 none, 9 max).
Returns
the new output or NULL

◆ __xmlParserInputBufferCreateFilename()

xmlParserInputBuffer * __xmlParserInputBufferCreateFilename ( const char * URI,
xmlCharEncoding enc )

Create a buffered parser input for the progressive parsing of a file Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.

Do an encoding check if enc == XML_CHAR_ENCODING_NONE

Internal implementation, never uses the callback installed with xmlParserInputBufferCreateFilenameDefault.

Deprecated
Use xmlNewInputFromUrl.
Parameters
URIa C string containing the URI or filename
encthe charset encoding if known
Returns
the new parser input or NULL

◆ xmlAllocOutputBuffer()

xmlOutputBuffer * xmlAllocOutputBuffer ( xmlCharEncodingHandler * encoder)

Create a buffered parser output.

Consumes encoder but not in error case.

Parameters
encoderthe encoding converter or NULL
Returns
the new parser output or NULL

◆ xmlAllocParserInputBuffer()

xmlParserInputBuffer * xmlAllocParserInputBuffer ( xmlCharEncoding enc)

Create a buffered parser input for progressive parsing.

Deprecated
Use xmlNewInputFrom*.

The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.

Parameters
encthe charset encoding if known (deprecated)
Returns
the new parser input or NULL

◆ xmlCheckFilename()

int xmlCheckFilename ( const char * path)

if stat is not available on the target machine,

Deprecated
Internal function, don't use.
Parameters
paththe path to check
Returns
0 if stat fails, 2 if stat succeeds and the file is a directory, 1 otherwise.

◆ xmlCheckHTTPInput()

xmlParserInput * xmlCheckHTTPInput ( xmlParserCtxt * ctxt,
xmlParserInput * ret )
Deprecated
Internal function, don't use.
Parameters
ctxtan XML parser context
retan XML parser input
Returns
NULL.

◆ xmlCleanupInputCallbacks()

void xmlCleanupInputCallbacks ( void )

clears the entire input callback table.

this includes the compiled-in I/O.

◆ xmlCleanupOutputCallbacks()

void xmlCleanupOutputCallbacks ( void )

clears the entire output callback table.

this includes the compiled-in I/O callbacks.

◆ xmlFileClose()

int xmlFileClose ( void * context)
Deprecated
Internal function, don't use.
Parameters
contextthe I/O context
Returns
0 or -1 an error code case of error

◆ xmlFileMatch()

int xmlFileMatch ( const char * filename)
Deprecated
Internal function, don't use.
Parameters
filenamethe URI for matching
Returns
1 if matches, 0 otherwise

◆ xmlFileOpen()

void * xmlFileOpen ( const char * filename)
Deprecated
Internal function, don't use.
Parameters
filenamethe URI for matching
Returns
an IO context or NULL in case or failure

◆ xmlFileRead()

int xmlFileRead ( void * context,
char * buffer,
int len )
Deprecated
Internal function, don't use.
Parameters
contextthe I/O context
bufferwhere to drop data
lennumber of bytes to write
Returns
the number of bytes read or < 0 in case of failure

◆ xmlFreeParserInputBuffer()

void xmlFreeParserInputBuffer ( xmlParserInputBuffer * in)

Free up the memory used by a buffered parser input.

Parameters
ina buffered parser input

◆ xmlNoNetExternalEntityLoader()

xmlParserInput * xmlNoNetExternalEntityLoader ( const char * URL,
const char * publicId,
xmlParserCtxt * ctxt )

A specific entity loader disabling network accesses, though still allowing local catalog accesses for resolution.

Deprecated
Use XML_PARSE_NONET.
Parameters
URLthe URL or system ID for the entity to load
publicIdthe public ID for the entity to load
ctxtthe context in which the entity is called or NULL
Returns
a new allocated xmlParserInput, or NULL.

◆ xmlNormalizeWindowsPath()

xmlChar * xmlNormalizeWindowsPath ( const xmlChar * path)
Deprecated
This never really worked.
Parameters
paththe input file path
Returns
a copy of path.

◆ xmlOutputBufferClose()

int xmlOutputBufferClose ( xmlOutputBuffer * out)

flushes and close the output I/O channel and free up all the associated resources

Parameters
outa buffered output
Returns
the number of byte written or a negative xmlParserErrors code in case of error.

◆ xmlOutputBufferCreateBuffer()

xmlOutputBuffer * xmlOutputBufferCreateBuffer ( xmlBuffer * buffer,
xmlCharEncodingHandler * encoder )

Create a buffered output for the progressive saving to a xmlBuffer.

Consumes encoder but not in error case.

Parameters
buffera xmlBuffer
encoderthe encoding converter or NULL
Returns
the new parser output or NULL

◆ xmlOutputBufferCreateFd()

xmlOutputBuffer * xmlOutputBufferCreateFd ( int fd,
xmlCharEncodingHandler * encoder )

Create a buffered output for the progressive saving to a file descriptor.

Consumes encoder but not in error case.

Parameters
fda file descriptor number
encoderthe encoding converter or NULL
Returns
the new parser output or NULL

◆ xmlOutputBufferCreateFile()

xmlOutputBuffer * xmlOutputBufferCreateFile ( FILE * file,
xmlCharEncodingHandler * encoder )

Create a buffered output for the progressive saving to a FILE * buffered C I/O.

Consumes encoder but not in error case.

Parameters
filea FILE *
encoderthe encoding converter or NULL
Returns
the new parser output or NULL

◆ xmlOutputBufferCreateFilename()

xmlOutputBuffer * xmlOutputBufferCreateFilename ( const char * URI,
xmlCharEncodingHandler * encoder,
int compression )

Create a buffered output for the progressive saving of a file If filename is "-" then we use stdout as the output.

Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.

Consumes encoder but not in error case.

Allows the actual function to be overridden with xmlOutputBufferCreateFilenameDefault.

Parameters
URIa C string containing the URI or filename
encoderthe encoding converter or NULL
compressionthe compression ration (0 none, 9 max).
Returns
the new output or NULL

◆ xmlOutputBufferCreateFilenameDefault()

xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameDefault ( xmlOutputBufferCreateFilenameFunc func)

Registers a callback for URI output file handling.

Parameters
funcfunction pointer to the new OutputBufferCreateFilenameFunc
Returns
the old value of the registration function

◆ xmlOutputBufferCreateIO()

xmlOutputBuffer * xmlOutputBufferCreateIO ( xmlOutputWriteCallback iowrite,
xmlOutputCloseCallback ioclose,
void * ioctx,
xmlCharEncodingHandler * encoder )

Create a buffered output for the progressive saving to an I/O handler.

Consumes encoder but not in error case.

Parameters
iowritean I/O write function
ioclosean I/O close function
ioctxan I/O handler
encoderthe charset encoding if known
Returns
the new parser output or NULL

◆ xmlOutputBufferFlush()

int xmlOutputBufferFlush ( xmlOutputBuffer * out)

flushes the output I/O channel

Parameters
outa buffered output
Returns
the number of byte written or -1 in case of error.

◆ xmlOutputBufferGetContent()

const xmlChar * xmlOutputBufferGetContent ( xmlOutputBuffer * out)

Gives a pointer to the data currently held in the output buffer.

Parameters
outan xmlOutputBuffer
Returns
a pointer to the data or NULL in case of error

◆ xmlOutputBufferGetSize()

size_t xmlOutputBufferGetSize ( xmlOutputBuffer * out)

Gives the length of the data currently held in the output buffer.

Parameters
outan xmlOutputBuffer
Returns
0 in case or error or no data is held, the size otherwise

◆ xmlOutputBufferWrite()

int xmlOutputBufferWrite ( xmlOutputBuffer * out,
int len,
const char * data )

Write the content of the array in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e.

will store in case of partial or delayed writes.

Parameters
outa buffered parser output
lenthe size in bytes of the array.
dataan char array
Returns
the number of chars immediately written, or -1 in case of error.

◆ xmlOutputBufferWriteEscape()

int xmlOutputBufferWriteEscape ( xmlOutputBuffer * out,
const xmlChar * str,
xmlCharEncodingOutputFunc escaping )

Write the content of the string in the output I/O buffer This routine escapes the characters and then handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e.

will store in case of partial or delayed writes.

Parameters
outa buffered parser output
stra zero terminated UTF-8 string
escapingan optional escaping function (or NULL)
Returns
the number of chars immediately written, or -1 in case of error.

◆ xmlOutputBufferWriteString()

int xmlOutputBufferWriteString ( xmlOutputBuffer * out,
const char * str )

Write the content of the string in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e.

will store in case of partial or delayed writes.

Parameters
outa buffered parser output
stra zero terminated C string
Returns
the number of chars immediately written, or -1 in case of error.

◆ xmlParserGetDirectory()

char * xmlParserGetDirectory ( const char * filename)

lookup the directory for that file

Parameters
filenamethe path to a file
Returns
a new allocated string containing the directory, or NULL.

◆ xmlParserInputBufferCreateFd()

xmlParserInputBuffer * xmlParserInputBufferCreateFd ( int fd,
xmlCharEncoding enc )

Create a buffered parser input for the progressive parsing for the input from a file descriptor.

Deprecated
Use xmlNewInputFromFd.

The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.

Parameters
fda file descriptor number
encthe charset encoding if known (deprecated)
Returns
the new parser input or NULL

◆ xmlParserInputBufferCreateFile()

xmlParserInputBuffer * xmlParserInputBufferCreateFile ( FILE * file,
xmlCharEncoding enc )

Create a buffered parser input for the progressive parsing of a FILE * buffered C I/O.

Deprecated
Don't use.

The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.

Parameters
filea FILE*
encthe charset encoding if known (deprecated)
Returns
the new parser input or NULL

◆ xmlParserInputBufferCreateFilename()

xmlParserInputBuffer * xmlParserInputBufferCreateFilename ( const char * URI,
xmlCharEncoding enc )

Create a buffered parser input for the progressive parsing of a file Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.

Do an encoding check if enc == XML_CHAR_ENCODING_NONE

Allows the actual function to be overridden with xmlParserInputBufferCreateFilenameDefault.

Deprecated
Use xmlNewInputFromUrl.
Parameters
URIa C string containing the URI or filename
encthe charset encoding if known
Returns
the new parser input or NULL

◆ xmlParserInputBufferCreateFilenameDefault()

xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameDefault ( xmlParserInputBufferCreateFilenameFunc func)

Registers a callback for URI input file handling.

Deprecated
Use xmlCtxtSetResourceLoader or similar functions.
Parameters
funcfunction pointer to the new ParserInputBufferCreateFilenameFunc
Returns
the old value of the registration function

◆ xmlParserInputBufferCreateIO()

xmlParserInputBuffer * xmlParserInputBufferCreateIO ( xmlInputReadCallback ioread,
xmlInputCloseCallback ioclose,
void * ioctx,
xmlCharEncoding enc )

Create a buffered parser input for the progressive parsing for the input from an I/O handler.

Deprecated
Use xmlNewInputFromIO.

The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.

Parameters
ioreadan I/O read function
ioclosean I/O close function
ioctxan I/O handler
encthe charset encoding if known (deprecated)
Returns
the new parser input or NULL

◆ xmlParserInputBufferCreateMem()

xmlParserInputBuffer * xmlParserInputBufferCreateMem ( const char * mem,
int size,
xmlCharEncoding enc )

Create a parser input buffer for parsing from a memory area.

Deprecated
Use xmlNewInputFromMemory.

This function makes a copy of the whole input buffer. If you are sure that the contents of the buffer will remain valid until the document was parsed, you can avoid the copy by using xmlParserInputBufferCreateStatic.

The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.

Parameters
memthe memory input
sizethe length of the memory block
encthe charset encoding if known (deprecated)
Returns
the new parser input or NULL in case of error.

◆ xmlParserInputBufferCreateStatic()

xmlParserInputBuffer * xmlParserInputBufferCreateStatic ( const char * mem,
int size,
xmlCharEncoding enc )

Create a parser input buffer for parsing from a memory area.

Deprecated
Use xmlNewInputFromMemory.

This functions assumes that the contents of the input buffer remain valid until the document was parsed. Use xmlParserInputBufferCreateMem otherwise.

The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.

Parameters
memthe memory input
sizethe length of the memory block
encthe charset encoding if known
Returns
the new parser input or NULL in case of error.

◆ xmlParserInputBufferGrow()

int xmlParserInputBufferGrow ( xmlParserInputBuffer * in,
int len )

Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode.

Deprecated
Internal function, don't use.
Parameters
ina buffered parser input
lenindicative value of the amount of chars to read
Returns
the number of chars read and stored in the buffer, or -1 in case of error.

◆ xmlParserInputBufferPush()

int xmlParserInputBufferPush ( xmlParserInputBuffer * in,
int len,
const char * buf )

Push the content of the arry in the input buffer This routine handle the I18N transcoding to internal UTF-8 This is used when operating the parser in progressive (push) mode.

Deprecated
Internal function, don't use.
Parameters
ina buffered parser input
lenthe size in bytes of the array.
bufan char array
Returns
the number of chars read and stored in the buffer, or -1 in case of error.

◆ xmlParserInputBufferRead()

int xmlParserInputBufferRead ( xmlParserInputBuffer * in,
int len )

Same as xmlParserInputBufferGrow.

Deprecated
Internal function, don't use.
Parameters
ina buffered parser input
lenindicative value of the amount of chars to read
Returns
the number of chars read and stored in the buffer, or -1 in case of error.

◆ xmlPopInputCallbacks()

int xmlPopInputCallbacks ( void )

Clear the top input callback from the input stack.

this includes the compiled-in I/O.

Returns
the number of input callback registered or -1 in case of error.

◆ xmlPopOutputCallbacks()

int xmlPopOutputCallbacks ( void )

Remove the top output callbacks from the output stack.

This includes the compiled-in I/O.

Returns
the number of output callback registered or -1 in case of error.

◆ xmlRegisterInputCallbacks()

int xmlRegisterInputCallbacks ( xmlInputMatchCallback matchFunc,
xmlInputOpenCallback openFunc,
xmlInputReadCallback readFunc,
xmlInputCloseCallback closeFunc )

Register a new set of I/O callback for handling parser input.

Deprecated
Use xmlCtxtSetResourceLoader or similar functions.
Parameters
matchFuncthe xmlInputMatchCallback
openFuncthe xmlInputOpenCallback
readFuncthe xmlInputReadCallback
closeFuncthe xmlInputCloseCallback
Returns
the registered handler number or -1 in case of error

◆ xmlRegisterOutputCallbacks()

int xmlRegisterOutputCallbacks ( xmlOutputMatchCallback matchFunc,
xmlOutputOpenCallback openFunc,
xmlOutputWriteCallback writeFunc,
xmlOutputCloseCallback closeFunc )

Register a new set of I/O callback for handling output.

Parameters
matchFuncthe xmlOutputMatchCallback
openFuncthe xmlOutputOpenCallback
writeFuncthe xmlOutputWriteCallback
closeFuncthe xmlOutputCloseCallback
Returns
the registered handler number or -1 in case of error

◆ xmlThrDefOutputBufferCreateFilenameDefault()

xmlOutputBufferCreateFilenameFunc xmlThrDefOutputBufferCreateFilenameDefault ( xmlOutputBufferCreateFilenameFunc func)

Set per-thread default value.

Deprecated
Call xmlOutputBufferCreateFilenameDefault in each thread.
Parameters
funcnew value
Returns
the old value

◆ xmlThrDefParserInputBufferCreateFilenameDefault()

xmlParserInputBufferCreateFilenameFunc xmlThrDefParserInputBufferCreateFilenameDefault ( xmlParserInputBufferCreateFilenameFunc func)

Set per-thread default value.

Deprecated
Call xmlParserInputBufferCreateFilenameDefault in each thread.
Parameters
funcnew value
Returns
the old value