Back to Turicreate

xmlIO: interface for the I/O interfaces used by the parser

deps/src/libxml2-2.9.1/doc/devhelp/libxml2-xmlIO.html

6.4.130.3 KB
Original Source

| | | | | libxml2 Reference Manual |

xmlIO

xmlIO - interface for the I/O interfaces used by the parser

interface for the I/O interfaces used by the parser

Author(s): Daniel Veillard

Synopsis

int[xmlIOHTTPRead](#xmlIOHTTPRead)(void * context,
char * buffer,
int len);
typedef int[xmlInputMatchCallback](#xmlInputMatchCallback)(char const * filename);
void[xmlRegisterDefaultOutputCallbacks](#xmlRegisterDefaultOutputCallbacks)(void);
int[xmlFileClose](#xmlFileClose)(void * context);
typedef int[xmlOutputMatchCallback](#xmlOutputMatchCallback)(char const * filename);
int[xmlParserInputBufferPush](#xmlParserInputBufferPush)([xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)in,
int len,
const char * buf);
int[xmlIOFTPRead](#xmlIOFTPRead)(void * context,
char * buffer,
int len);
void[xmlRegisterHTTPPostCallbacks](#xmlRegisterHTTPPostCallbacks)(void);
void *[xmlIOFTPOpen](#xmlIOFTPOpen)(const char * filename);
int[xmlIOFTPClose](#xmlIOFTPClose)(void * context);
void *[xmlFileOpen](#xmlFileOpen)(const char * filename);[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)[xmlOutputBufferCreateFile](#xmlOutputBufferCreateFile)(FILE * file,
[xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder);
int[xmlCheckFilename](#xmlCheckFilename)(const char * path);
typedef void *[xmlOutputOpenCallback](#xmlOutputOpenCallback)(char const * filename);[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)[xmlParserInputBufferCreateFilename](#xmlParserInputBufferCreateFilename)(const char * URI,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc);
int[xmlOutputBufferClose](#xmlOutputBufferClose)([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out);[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)[xmlAllocParserInputBuffer](#xmlAllocParserInputBuffer)([xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc);[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)[xmlOutputBufferCreateIO](#xmlOutputBufferCreateIO)([xmlOutputWriteCallback](libxml2-xmlIO.html#xmlOutputWriteCallback)iowrite,
[xmlOutputCloseCallback](libxml2-xmlIO.html#xmlOutputCloseCallback)ioclose,
void * ioctx,
[xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder);
typedef int[xmlOutputWriteCallback](#xmlOutputWriteCallback)(void * context,
const char * buffer,
int len);
int[xmlOutputBufferFlush](#xmlOutputBufferFlush)([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out);[xmlParserInputPtr](libxml2-tree.html#xmlParserInputPtr)[xmlCheckHTTPInput](#xmlCheckHTTPInput)([xmlParserCtxtPtr](libxml2-tree.html#xmlParserCtxtPtr)ctxt,
[xmlParserInputPtr](libxml2-tree.html#xmlParserInputPtr)ret);
int[xmlRegisterOutputCallbacks](#xmlRegisterOutputCallbacks)([xmlOutputMatchCallback](libxml2-xmlIO.html#xmlOutputMatchCallback)matchFunc,
[xmlOutputOpenCallback](libxml2-xmlIO.html#xmlOutputOpenCallback)openFunc,
[xmlOutputWriteCallback](libxml2-xmlIO.html#xmlOutputWriteCallback)writeFunc,
[xmlOutputCloseCallback](libxml2-xmlIO.html#xmlOutputCloseCallback)closeFunc);[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)[xmlParserInputBufferCreateMem](#xmlParserInputBufferCreateMem)(const char * mem,
int size,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc);
int[xmlIOFTPMatch](#xmlIOFTPMatch)(const char * filename);
int[xmlRegisterInputCallbacks](#xmlRegisterInputCallbacks)([xmlInputMatchCallback](libxml2-xmlIO.html#xmlInputMatchCallback)matchFunc,
[xmlInputOpenCallback](libxml2-xmlIO.html#xmlInputOpenCallback)openFunc,
[xmlInputReadCallback](libxml2-xmlIO.html#xmlInputReadCallback)readFunc,
[xmlInputCloseCallback](libxml2-xmlIO.html#xmlInputCloseCallback)closeFunc);
void[xmlFreeParserInputBuffer](#xmlFreeParserInputBuffer)([xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)in);
void[xmlRegisterDefaultInputCallbacks](#xmlRegisterDefaultInputCallbacks)(void);
int[xmlParserInputBufferGrow](#xmlParserInputBufferGrow)([xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)in,
int len);
typedef int[xmlOutputCloseCallback](#xmlOutputCloseCallback)(void * context);[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)[xmlAllocOutputBuffer](#xmlAllocOutputBuffer)([xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder);[xmlParserInputPtr](libxml2-tree.html#xmlParserInputPtr)[xmlNoNetExternalEntityLoader](#xmlNoNetExternalEntityLoader)(const char * URL,
const char * ID,
[xmlParserCtxtPtr](libxml2-tree.html#xmlParserCtxtPtr)ctxt);[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)[xmlOutputBufferCreateBuffer](#xmlOutputBufferCreateBuffer)([xmlBufferPtr](libxml2-tree.html#xmlBufferPtr)buffer,
[xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder);
int[xmlIOHTTPMatch](#xmlIOHTTPMatch)(const char * filename);
void *[xmlIOHTTPOpen](#xmlIOHTTPOpen)(const char * filename);[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)[xmlParserInputBufferCreateIO](#xmlParserInputBufferCreateIO)([xmlInputReadCallback](libxml2-xmlIO.html#xmlInputReadCallback)ioread,
[xmlInputCloseCallback](libxml2-xmlIO.html#xmlInputCloseCallback)ioclose,
void * ioctx,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc);[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)[xmlOutputBufferCreateFd](#xmlOutputBufferCreateFd)(int fd,
[xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder);[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlNormalizeWindowsPath](#xmlNormalizeWindowsPath)(const[xmlChar](libxml2-xmlstring.html#xmlChar)* path);
typedef int[xmlInputReadCallback](#xmlInputReadCallback)(void * context,
char * buffer,
int len);[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)[xmlParserInputBufferCreateStatic](#xmlParserInputBufferCreateStatic)(const char * mem,
int size,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc);
const[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlOutputBufferGetContent](#xmlOutputBufferGetContent)([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out);
int[xmlIOHTTPClose](#xmlIOHTTPClose)(void * context);
int[xmlOutputBufferWriteEscape](#xmlOutputBufferWriteEscape)([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* str,
[xmlCharEncodingOutputFunc](libxml2-encoding.html#xmlCharEncodingOutputFunc)escaping);[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)[xmlOutputBufferCreateFilename](#xmlOutputBufferCreateFilename)(const char * URI,
[xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder,
int compression);
size_t[xmlOutputBufferGetSize](#xmlOutputBufferGetSize)([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out);
void[xmlCleanupOutputCallbacks](#xmlCleanupOutputCallbacks)(void);
typedef void *[xmlInputOpenCallback](#xmlInputOpenCallback)(char const * filename);
int[xmlParserInputBufferRead](#xmlParserInputBufferRead)([xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)in,
int len);
int[xmlOutputBufferWriteString](#xmlOutputBufferWriteString)([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out,
const char * str);
int[xmlFileMatch](#xmlFileMatch)(const char * filename);
int[xmlPopInputCallbacks](#xmlPopInputCallbacks)(void);
int[xmlFileRead](#xmlFileRead)(void * context,
char * buffer,
int len);[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)[xmlParserInputBufferCreateFile](#xmlParserInputBufferCreateFile)(FILE * file,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc);
char *[xmlParserGetDirectory](#xmlParserGetDirectory)(const char * filename);
int[xmlOutputBufferWrite](#xmlOutputBufferWrite)([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out,
int len,
const char * buf);
void[xmlCleanupInputCallbacks](#xmlCleanupInputCallbacks)(void);
typedef int[xmlInputCloseCallback](#xmlInputCloseCallback)(void * context);
void *[xmlIOHTTPOpenW](#xmlIOHTTPOpenW)(const char * post_uri,
int compression);[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)[xmlParserInputBufferCreateFd](#xmlParserInputBufferCreateFd)(int fd,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc);

Description

Details

Function type xmlInputCloseCallback

int	xmlInputCloseCallback (void * context)

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

| context: | an Input context | | Returns: | 0 or -1 in case of error |


Function type xmlInputMatchCallback

int	xmlInputMatchCallback (char const * filename)

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

| filename: | the filename or URI | | Returns: | 1 if yes and 0 if another Input module should be used |


Function type xmlInputOpenCallback

void *	xmlInputOpenCallback (char const * filename)

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

| filename: | the filename or URI | | Returns: | an Input context or NULL in case or error |


Function type xmlInputReadCallback

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

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

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


Function type xmlOutputCloseCallback

int	xmlOutputCloseCallback (void * context)

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

| context: | an Output context | | Returns: | 0 or -1 in case of error |


Function type xmlOutputMatchCallback

int	xmlOutputMatchCallback (char const * filename)

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

| filename: | the filename or URI | | Returns: | 1 if yes and 0 if another Output module should be used |


Function type xmlOutputOpenCallback

void *	xmlOutputOpenCallback (char const * filename)

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

| filename: | the filename or URI | | Returns: | an Output context or NULL in case or error |


Function type xmlOutputWriteCallback

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

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

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


xmlAllocOutputBuffer ()

[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)xmlAllocOutputBuffer	([xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder)

Create a buffered parser output

| encoder: | the encoding converter or NULL | | Returns: | the new parser output or NULL |


xmlAllocParserInputBuffer ()

[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)xmlAllocParserInputBuffer	([xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc)

Create a buffered parser input for progressive parsing

| enc: | the charset encoding if known | | Returns: | the new parser input or NULL |


xmlCheckFilename ()

int	xmlCheckFilename (const char * path)

function checks to see if @path is a valid source (file, socket...) for XML. if stat is not available on the target machine,

| path: | the path to check | | Returns: | 1. if stat fails, returns 0 (if calling stat on the filename fails, it can't be right). if stat succeeds and the file is a directory, returns 2. otherwise returns 1. |


xmlCheckHTTPInput ()

[xmlParserInputPtr](libxml2-tree.html#xmlParserInputPtr)xmlCheckHTTPInput	([xmlParserCtxtPtr](libxml2-tree.html#xmlParserCtxtPtr)ctxt,
[xmlParserInputPtr](libxml2-tree.html#xmlParserInputPtr)ret)

Check an input in case it was created from an HTTP stream, in that case it will handle encoding and update of the base URL in case of redirection. It also checks for HTTP errors in which case the input is cleanly freed up and an appropriate error is raised in context

| ctxt: | an XML parser context | | ret: | an XML parser input | | Returns: | the input or NULL in case of HTTP error. |


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)

Close an I/O channel

| context: | the I/O context | | Returns: | 0 or -1 in case of error |


xmlFileMatch ()

int	xmlFileMatch (const char * filename)

input from FILE *

| filename: | the URI for matching | | Returns: | 1 if matches, 0 otherwise |


xmlFileOpen ()

void *	xmlFileOpen (const char * filename)

Wrapper around xmlFileOpen_real that try it with an unescaped version of @filename, if this fails fallback to @filename

| filename: | the URI for matching | | Returns: | a handler or NULL in case or failure |


xmlFileRead ()

int	xmlFileRead (void * context,
char * buffer,
int len)

Read @len bytes to @buffer from the I/O channel.

| context: | the I/O context | | buffer: | where to drop data | | len: | number of bytes to write | | Returns: | the number of bytes written or < 0 in case of failure |


xmlFreeParserInputBuffer ()

void	xmlFreeParserInputBuffer	([xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)in)

Free up the memory used by a buffered parser input

| in: | a buffered parser input |


xmlIOFTPClose ()

int	xmlIOFTPClose (void * context)

Close an FTP I/O channel

| context: | the I/O context | | Returns: | 0 |


xmlIOFTPMatch ()

int	xmlIOFTPMatch (const char * filename)

check if the URI matches an FTP one

| filename: | the URI for matching | | Returns: | 1 if matches, 0 otherwise |


xmlIOFTPOpen ()

void *	xmlIOFTPOpen (const char * filename)

open an FTP I/O channel

| filename: | the URI for matching | | Returns: | an I/O context or NULL in case of error |


xmlIOFTPRead ()

int	xmlIOFTPRead (void * context,
char * buffer,
int len)

Read @len bytes to @buffer from the I/O channel.

| context: | the I/O context | | buffer: | where to drop data | | len: | number of bytes to write | | Returns: | the number of bytes written |


xmlIOHTTPClose ()

int	xmlIOHTTPClose (void * context)

Close an HTTP I/O channel

| context: | the I/O context | | Returns: | 0 |


xmlIOHTTPMatch ()

int	xmlIOHTTPMatch (const char * filename)

check if the URI matches an HTTP one

| filename: | the URI for matching | | Returns: | 1 if matches, 0 otherwise |


xmlIOHTTPOpen ()

void *	xmlIOHTTPOpen (const char * filename)

open an HTTP I/O channel

| filename: | the URI for matching | | Returns: | an I/O context or NULL in case of error |


xmlIOHTTPOpenW ()

void *	xmlIOHTTPOpenW (const char * post_uri,
int compression)

Open a temporary buffer to collect the document for a subsequent HTTP POST request. Non-static as is called from the output buffer creation routine.

| post_uri: | The destination URI for the document | | compression: | The compression desired for the document. | | Returns: | an I/O context or NULL in case of error. |


xmlIOHTTPRead ()

int	xmlIOHTTPRead (void * context,
char * buffer,
int len)

Read @len bytes to @buffer from the I/O channel.

| context: | the I/O context | | buffer: | where to drop data | | len: | number of bytes to write | | Returns: | the number of bytes written |


xmlNoNetExternalEntityLoader ()

[xmlParserInputPtr](libxml2-tree.html#xmlParserInputPtr)xmlNoNetExternalEntityLoader	(const char * URL,
const char * ID,
[xmlParserCtxtPtr](libxml2-tree.html#xmlParserCtxtPtr)ctxt)

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

| URL: | the URL for the entity to load | | ID: | the System ID for the entity to load | | ctxt: | the context in which the entity is called or NULL | | Returns: | a new allocated xmlParserInputPtr, or NULL. |


xmlNormalizeWindowsPath ()

[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlNormalizeWindowsPath	(const[xmlChar](libxml2-xmlstring.html#xmlChar)* path)

This function is obsolete. Please see xmlURIFromPath in uri.c for a better solution.

| path: | the input file path | | Returns: | a canonicalized version of the path |


xmlOutputBufferClose ()

int	xmlOutputBufferClose ([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out)

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

| out: | a buffered output | | Returns: | the number of byte written or -1 in case of error. |


xmlOutputBufferCreateBuffer ()

[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)xmlOutputBufferCreateBuffer	([xmlBufferPtr](libxml2-tree.html#xmlBufferPtr)buffer,
[xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder)

Create a buffered output for the progressive saving to a xmlBuffer

| buffer: | a xmlBufferPtr | | encoder: | the encoding converter or NULL | | Returns: | the new parser output or NULL |


xmlOutputBufferCreateFd ()

[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)xmlOutputBufferCreateFd	(int fd,
[xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder)

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

| fd: | a file descriptor number | | encoder: | the encoding converter or NULL | | Returns: | the new parser output or NULL |


xmlOutputBufferCreateFile ()

[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)xmlOutputBufferCreateFile	(FILE * file,
[xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder)

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

| file: | a FILE* | | encoder: | the encoding converter or NULL | | Returns: | the new parser output or NULL |


xmlOutputBufferCreateFilename ()

[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)xmlOutputBufferCreateFilename	(const char * URI,
[xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)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. TODO: currently if compression is set, the library only support writing to a local file.

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


xmlOutputBufferCreateIO ()

[xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)xmlOutputBufferCreateIO	([xmlOutputWriteCallback](libxml2-xmlIO.html#xmlOutputWriteCallback)iowrite,
[xmlOutputCloseCallback](libxml2-xmlIO.html#xmlOutputCloseCallback)ioclose,
void * ioctx,
[xmlCharEncodingHandlerPtr](libxml2-encoding.html#xmlCharEncodingHandlerPtr)encoder)

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

| 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 ([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out)

flushes the output I/O channel

| out: | a buffered output | | Returns: | the number of byte written or -1 in case of error. |


xmlOutputBufferGetContent ()

const[xmlChar](libxml2-xmlstring.html#xmlChar)*	xmlOutputBufferGetContent	([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out)

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

| out: | an xmlOutputBufferPtr | | Returns: | a pointer to the data or NULL in case of error |


xmlOutputBufferGetSize ()

size_t	xmlOutputBufferGetSize ([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out)

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

| out: | an xmlOutputBufferPtr | | Returns: | 0 in case or error or no data is held, the size otherwise |


xmlOutputBufferWrite ()

int	xmlOutputBufferWrite ([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)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. will store in case of partial or delayed writes.

| out: | a buffered parser output | | len: | the size in bytes of the array. | | buf: | an char array | | Returns: | the number of chars immediately written, or -1 in case of error. |


xmlOutputBufferWriteEscape ()

int	xmlOutputBufferWriteEscape	([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)out,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* str,
[xmlCharEncodingOutputFunc](libxml2-encoding.html#xmlCharEncodingOutputFunc)escaping)

Write the content of the string in the output I/O buffer This routine escapes the caracters 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.

| 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	([xmlOutputBufferPtr](libxml2-tree.html#xmlOutputBufferPtr)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.

| 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

| filename: | the path to a file | | Returns: | a new allocated string containing the directory, or NULL. |


xmlParserInputBufferCreateFd ()

[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)xmlParserInputBufferCreateFd	(int fd,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc)

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

| fd: | a file descriptor number | | enc: | the charset encoding if known | | Returns: | the new parser input or NULL |


xmlParserInputBufferCreateFile ()

[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)xmlParserInputBufferCreateFile	(FILE * file,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc)

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

| file: | a FILE* | | enc: | the charset encoding if known | | Returns: | the new parser input or NULL |


xmlParserInputBufferCreateFilename ()

[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)xmlParserInputBufferCreateFilename	(const char * URI,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc)

Create a buffered parser input for the progressive parsing of a file If filename is "-' then we use stdin as the input. 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

| URI: | a C string containing the URI or filename | | enc: | the charset encoding if known | | Returns: | the new parser input or NULL |


xmlParserInputBufferCreateIO ()

[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)xmlParserInputBufferCreateIO	([xmlInputReadCallback](libxml2-xmlIO.html#xmlInputReadCallback)ioread,
[xmlInputCloseCallback](libxml2-xmlIO.html#xmlInputCloseCallback)ioclose,
void * ioctx,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc)

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

| ioread: | an I/O read function | | ioclose: | an I/O close function | | ioctx: | an I/O handler | | enc: | the charset encoding if known | | Returns: | the new parser input or NULL |


xmlParserInputBufferCreateMem ()

[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)xmlParserInputBufferCreateMem	(const char * mem,
int size,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc)

Create a buffered parser input for the progressive parsing for the input from a memory area.

| mem: | the memory input | | size: | the length of the memory block | | enc: | the charset encoding if known | | Returns: | the new parser input or NULL |


xmlParserInputBufferCreateStatic ()

[xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)xmlParserInputBufferCreateStatic	(const char * mem,
int size,
[xmlCharEncoding](libxml2-encoding.html#xmlCharEncoding)enc)

Create a buffered parser input for the progressive parsing for the input from an immutable memory area. This will not copy the memory area to the buffer, but the memory is expected to be available until the end of the parsing, this is useful for example when using mmap'ed file.

| mem: | the memory input | | size: | the length of the memory block | | enc: | the charset encoding if known | | Returns: | the new parser input or NULL |


xmlParserInputBufferGrow ()

int	xmlParserInputBufferGrow	([xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)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 TODO: one should be able to remove one extra copy by copying directly onto in->buffer or in->raw

| 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	([xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)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.

| 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	([xmlParserInputBufferPtr](libxml2-tree.html#xmlParserInputBufferPtr)in,
int len)

Refresh the content of the input buffer, the old data are considered consumed This routine handle the I18N transcoding to internal UTF-8

| 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. |


xmlRegisterDefaultInputCallbacks ()

void	xmlRegisterDefaultInputCallbacks	(void)

Registers the default compiled-in I/O handlers.


xmlRegisterDefaultOutputCallbacks ()

void	xmlRegisterDefaultOutputCallbacks	(void)

Registers the default compiled-in I/O handlers.


xmlRegisterHTTPPostCallbacks ()

void	xmlRegisterHTTPPostCallbacks	(void)

By default, libxml submits HTTP output requests using the "PUT" method. Calling this method changes the HTTP output method to use the "POST" method instead.


xmlRegisterInputCallbacks ()

int	xmlRegisterInputCallbacks	([xmlInputMatchCallback](libxml2-xmlIO.html#xmlInputMatchCallback)matchFunc,
[xmlInputOpenCallback](libxml2-xmlIO.html#xmlInputOpenCallback)openFunc,
[xmlInputReadCallback](libxml2-xmlIO.html#xmlInputReadCallback)readFunc,
[xmlInputCloseCallback](libxml2-xmlIO.html#xmlInputCloseCallback)closeFunc)

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

| 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](libxml2-xmlIO.html#xmlOutputMatchCallback)matchFunc,
[xmlOutputOpenCallback](libxml2-xmlIO.html#xmlOutputOpenCallback)openFunc,
[xmlOutputWriteCallback](libxml2-xmlIO.html#xmlOutputWriteCallback)writeFunc,
[xmlOutputCloseCallback](libxml2-xmlIO.html#xmlOutputCloseCallback)closeFunc)

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

| matchFunc: | the xmlOutputMatchCallback | | openFunc: | the xmlOutputOpenCallback | | writeFunc: | the xmlOutputWriteCallback | | closeFunc: | the xmlOutputCloseCallback | | Returns: | the registered handler number or -1 in case of error |