xmlIO

Name

xmlIO —

Synopsis



int         (*xmlInputMatchCallback)        (char const *filename);
void*       (*xmlInputOpenCallback)         (char const *filename);
int         (*xmlInputReadCallback)         (void *context,
                                             char *buffer,
                                             int len);
void        (*xmlInputCloseCallback)        (void *context);
struct      xmlParserInputBuffer;
typedef     xmlParserInputBufferPtr;
xmlParserInputBufferPtr xmlAllocParserInputBuffer
                                            (xmlCharEncoding enc);
xmlParserInputBufferPtr xmlParserInputBufferCreateFilename
                                            (const char *filename,
                                             xmlCharEncoding enc);
xmlParserInputBufferPtr xmlParserInputBufferCreateFile
                                            (FILE *file,
                                             xmlCharEncoding enc);
xmlParserInputBufferPtr xmlParserInputBufferCreateFd
                                            (int fd,
                                             xmlCharEncoding enc);
xmlParserInputBufferPtr xmlParserInputBufferCreateIO
                                            (xmlInputReadCallback ioread,
                                             xmlInputCloseCallback ioclose,
                                             void *ioctx,
                                             xmlCharEncoding enc);
int         xmlParserInputBufferRead        (xmlParserInputBufferPtr in,
                                             int len);
int         xmlParserInputBufferGrow        (xmlParserInputBufferPtr in,
                                             int len);
int         xmlParserInputBufferPush        (xmlParserInputBufferPtr in,
                                             int len,
                                             const char *buf);
void        xmlFreeParserInputBuffer        (xmlParserInputBufferPtr in);
char*       xmlParserGetDirectory           (const char *filename);
int         xmlRegisterInputCallbacks       (xmlInputMatchCallback match,
                                             xmlInputOpenCallback open,
                                             xmlInputReadCallback read,
                                             xmlInputCloseCallback close);

Description

Details

xmlInputMatchCallback ()

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

filename : 
Returns : 


xmlInputOpenCallback ()

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

filename : 


xmlInputReadCallback ()

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

context : 
buffer : 
len : 
Returns : 


xmlInputCloseCallback ()

void        (*xmlInputCloseCallback)        (void *context);

context : 


struct xmlParserInputBuffer

struct xmlParserInputBuffer {
    void*                  context;
    xmlInputReadCallback   readcallback;
    xmlInputCloseCallback  closecallback;
    
    xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
    
    xmlBufferPtr buffer;    /* Local buffer encoded in  UTF-8 */
};


xmlParserInputBufferPtr

typedef xmlParserInputBuffer *xmlParserInputBufferPtr;


xmlAllocParserInputBuffer ()

xmlParserInputBufferPtr xmlAllocParserInputBuffer
                                            (xmlCharEncoding enc);

Create a buffered parser input for progressive parsing

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


xmlParserInputBufferCreateFilename ()

xmlParserInputBufferPtr xmlParserInputBufferCreateFilename
                                            (const char *filename,
                                             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

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


xmlParserInputBufferCreateFile ()

xmlParserInputBufferPtr xmlParserInputBufferCreateFile
                                            (FILE *file,
                                             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


xmlParserInputBufferCreateFd ()

xmlParserInputBufferPtr xmlParserInputBufferCreateFd
                                            (int fd,
                                             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


xmlParserInputBufferCreateIO ()

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

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

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


xmlParserInputBufferRead ()

int         xmlParserInputBufferRead        (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.


xmlParserInputBufferGrow ()

int         xmlParserInputBufferGrow        (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

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


xmlFreeParserInputBuffer ()

void        xmlFreeParserInputBuffer        (xmlParserInputBufferPtr in);

Free up the memory used by a buffered parser input

in : a buffered parser input


xmlParserGetDirectory ()

char*       xmlParserGetDirectory           (const char *filename);

filename : 
Returns : 


xmlRegisterInputCallbacks ()

int         xmlRegisterInputCallbacks       (xmlInputMatchCallback match,
                                             xmlInputOpenCallback open,
                                             xmlInputReadCallback read,
                                             xmlInputCloseCallback close);

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

match : the xmlInputMatchCallback
open : the xmlInputOpenCallback
read : the xmlInputReadCallback
close : the xmlInputCloseCallback
Returns :the registered handler number or -1 in case of error