xmlIO

xmlIO —

Synopsis




int         (*xmlInputMatchCallback)        (char const *filename);
void*       (*xmlInputOpenCallback)         (char const *filename);
int         (*xmlInputReadCallback)         (void *context,
                                             char *buffer,
                                             int len);
int         (*xmlInputCloseCallback)        (void *context);
int         (*xmlOutputMatchCallback)       (char const *filename);
void*       (*xmlOutputOpenCallback)        (char const *filename);
int         (*xmlOutputWriteCallback)       (void *context,
                                             const char *buffer,
                                             int len);
int         (*xmlOutputCloseCallback)       (void *context);
struct      xmlParserInputBuffer;
struct      xmlOutputBuffer;

Description

Details

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

xmlInputOpenCallback ()

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

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

filename: the filename or URI

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

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

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

xmlOutputOpenCallback ()

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

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

filename: the filename or URI

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

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

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 */
    xmlBufferPtr raw;       /* if encoder != NULL buffer for raw input */
    int	compressed;	    /* -1=unknown, 0=not compressed, 1=compressed */
    int error;
};


struct xmlOutputBuffer

struct xmlOutputBuffer {

    void*                   context;
    xmlOutputWriteCallback  writecallback;
    xmlOutputCloseCallback  closecallback;
    
    xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
    
    xmlBufferPtr buffer;    /* Local buffer encoded in UTF-8 or ISOLatin */
    xmlBufferPtr conv;      /* if encoder != NULL buffer for output */
    int written;            /* total number of byte written */
    int error;
};