libxml2

Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
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.
xmlParserInputBuffer * | xmlAllocParserInputBuffer (xmlCharEncoding enc)
| Create a buffered parser input for progressive parsing.
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.
xmlParserInputBuffer * | xmlParserInputBufferCreateFile (FILE *file, xmlCharEncoding enc)
| Create a buffered parser input for the progressive parsing of a FILE * buffered C I/O.
xmlParserInputBuffer * | xmlParserInputBufferCreateFd (int fd, xmlCharEncoding enc)
| Create a buffered parser input for the progressive parsing for the input from a file descriptor.
xmlParserInputBuffer * | xmlParserInputBufferCreateMem (const char *mem, int size, xmlCharEncoding enc)
| Create a parser input buffer for parsing from a memory area.
xmlParserInputBuffer * | xmlParserInputBufferCreateStatic (const char *mem, int size, xmlCharEncoding enc)
| Create a parser input buffer for parsing from a memory area.
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.
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.
xmlOutputBuffer * | xmlAllocOutputBuffer (xmlCharEncodingHandler *encoder)
| Create a buffered parser 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.
xmlOutputBuffer * | xmlOutputBufferCreateFile (FILE *file, xmlCharEncodingHandler *encoder)
| Create a buffered output for the progressive saving to a FILE * buffered C I/O.
xmlOutputBuffer * | xmlOutputBufferCreateBuffer (xmlBuffer *buffer, xmlCharEncodingHandler *encoder)
| Create a buffered output for the progressive saving to a xmlBuffer.
xmlOutputBuffer * | xmlOutputBufferCreateFd (int fd, xmlCharEncodingHandler *encoder)
| Create a buffered output for the progressive saving to a file descriptor.
xmlOutputBuffer * | xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite, xmlOutputCloseCallback ioclose, void *ioctx, xmlCharEncodingHandler *encoder)
| Create a buffered output for the progressive saving to an I/O handler.
const xmlChar * | xmlOutputBufferGetContent (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.
xmlParserInput * | xmlCheckHTTPInput (xmlParserCtxt *ctxt, xmlParserInput *ret)
xmlParserInput * | xmlNoNetExternalEntityLoader (const char *URL, const char *ID, xmlParserCtxt *ctxt)
| A specific entity loader disabling network accesses, though still allowing local catalog accesses for resolution.
xmlChar * | xmlNormalizeWindowsPath (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.

Copyright
  See Copyright for the status of this software.

Author
  Daniel Veillard

## Typedef Documentation

## ◆ xmlInputCloseCallback

typedef int(* xmlInputCloseCallback) (void *context)

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

Parameters

  context | an 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

  filename | the 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

  filename | the 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

  context | an Input context
  buffer | the buffer to store data read
  len | the 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

  URI | the URI to write to
  encoder | the requested target encoding
  compression | compression 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

  context | an 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

  filename | the 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

  filename | the 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

  context | an Output context
  buffer | the buffer of data to write
  len | the 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

  URI | the URI to read from
  enc | the 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

  URI | a C string containing the URI or filename
  encoder | the encoding converter or NULL
  compression | the 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

  URI | a C string containing the URI or filename
  enc | the 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

  encoder | the 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

  enc | the 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

  path | the 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

  ctxt | an XML parser context
  ret | an 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

  context | the 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

  filename | the URI for matching

Returns
  1 if matches, 0 otherwise

## ◆ xmlFileOpen()

void * xmlFileOpen | ( | const char * | filename | ) |

Deprecated
  Internal function, don't use.

Parameters

  filename | the 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

  context | the I/O context
  buffer | where to drop data
  len | number 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

  in | a 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

  URL | the URL or system ID for the entity to load
  publicId | the public ID for the entity to load
  ctxt | the 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

  path | the 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

  out | a 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

  buffer | a xmlBuffer
  encoder | the 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

  fd | a file descriptor number
  encoder | the 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

  file | a FILE *
  encoder | the 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

  URI | a C string containing the URI or filename
  encoder | the encoding converter or NULL
  compression | the 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

  func | function 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

  iowrite | an I/O write function
  ioclose | an I/O close function
  ioctx | an I/O handler
  encoder | the charset encoding if known

Returns
  the new parser output or NULL

## ◆ xmlOutputBufferFlush()

int xmlOutputBufferFlush | ( | xmlOutputBuffer * | out | ) |

flushes the output I/O channel

Parameters

  out | a 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

  out | an 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

  out | an 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

  out | a buffered parser output
  len | the size in bytes of the array.
  data | an 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

  out | a buffered parser output
  str | a zero terminated UTF-8 string
  escaping | an 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

  out | a buffered parser output
  str | a 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

  filename | the 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

  fd | a file descriptor number
  enc | the 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

  file | a FILE*
  enc | the 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

  URI | a C string containing the URI or filename
  enc | the 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

  func | function 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

  ioread | an I/O read function
  ioclose | an I/O close function
  ioctx | an I/O handler
  enc | the 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

  mem | the memory input
  size | the length of the memory block
  enc | the 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

  mem | the memory input
  size | the length of the memory block
  enc | the 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

  in | a buffered parser input
  len | indicative 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

  in | a buffered parser input
  len | the size in bytes of the array.
  buf | an 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

  in | a buffered parser input
  len | indicative 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

  matchFunc | the xmlInputMatchCallback
  openFunc | the xmlInputOpenCallback
  readFunc | the xmlInputReadCallback
  closeFunc | the 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

  matchFunc | the xmlOutputMatchCallback
  openFunc | the xmlOutputOpenCallback
  writeFunc | the xmlOutputWriteCallback
  closeFunc | the 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

  func | new value

Returns
  the old value

## ◆ xmlThrDefParserInputBufferCreateFilenameDefault()

xmlParserInputBufferCreateFilenameFunc xmlThrDefParserInputBufferCreateFilenameDefault | ( | xmlParserInputBufferCreateFilenameFunc | func | ) |

Set per-thread default value.

Deprecated
  Call xmlParserInputBufferCreateFilenameDefault in each thread.

Parameters

  func | new value

Returns
  the old value