#ifndef __XML_IO_H__
#define __XML_IO_H__
#include <stdio.h>
#include <libxml/xmlversion.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*xmlInputMatchCallback) (char const *filename);
typedef void * (*xmlInputOpenCallback) (char const *filename);
typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
typedef int (*xmlInputCloseCallback) (void * context);
typedef int (*xmlOutputMatchCallback) (char const *filename);
typedef void * (*xmlOutputOpenCallback) (char const *filename);
typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
int len);
typedef int (*xmlOutputCloseCallback) (void * context);
#ifdef __cplusplus
}
#endif
#include <libxml/globals.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/encoding.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _xmlParserInputBuffer {
void* context;
xmlInputReadCallback readcallback;
xmlInputCloseCallback closecallback;
xmlCharEncodingHandlerPtr encoder;
xmlBufferPtr buffer;
xmlBufferPtr raw;
};
struct _xmlOutputBuffer {
void* context;
xmlOutputWriteCallback writecallback;
xmlOutputCloseCallback closecallback;
xmlCharEncodingHandlerPtr encoder;
xmlBufferPtr buffer;
xmlBufferPtr conv;
int written;
};
void xmlCleanupInputCallbacks (void);
void xmlCleanupOutputCallbacks (void);
void xmlRegisterDefaultInputCallbacks (void);
xmlParserInputBufferPtr
xmlAllocParserInputBuffer (xmlCharEncoding enc);
xmlParserInputBufferPtr
xmlParserInputBufferCreateFilename (const char *URI,
xmlCharEncoding enc);
xmlParserInputBufferPtr
xmlParserInputBufferCreateFile (FILE *file,
xmlCharEncoding enc);
xmlParserInputBufferPtr
xmlParserInputBufferCreateFd (int fd,
xmlCharEncoding enc);
xmlParserInputBufferPtr
xmlParserInputBufferCreateMem (const char *mem, int size,
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 matchFunc,
xmlInputOpenCallback openFunc,
xmlInputReadCallback readFunc,
xmlInputCloseCallback closeFunc);
void xmlRegisterDefaultOutputCallbacks(void);
xmlOutputBufferPtr
xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
xmlOutputBufferPtr
xmlOutputBufferCreateFilename (const char *URI,
xmlCharEncodingHandlerPtr encoder,
int compression);
xmlOutputBufferPtr
xmlOutputBufferCreateFile (FILE *file,
xmlCharEncodingHandlerPtr encoder);
xmlOutputBufferPtr
xmlOutputBufferCreateFd (int fd,
xmlCharEncodingHandlerPtr encoder);
xmlOutputBufferPtr
xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
xmlOutputCloseCallback ioclose,
void *ioctx,
xmlCharEncodingHandlerPtr encoder);
int xmlOutputBufferWrite (xmlOutputBufferPtr out,
int len,
const char *buf);
int xmlOutputBufferWriteString (xmlOutputBufferPtr out,
const char *str);
int xmlOutputBufferFlush (xmlOutputBufferPtr out);
int xmlOutputBufferClose (xmlOutputBufferPtr out);
int xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
xmlOutputOpenCallback openFunc,
xmlOutputWriteCallback writeFunc,
xmlOutputCloseCallback closeFunc);
#ifdef LIBXML_HTTP_ENABLED
void * xmlIOHTTPOpenW (const char * post_uri,
int compression );
void xmlRegisterHTTPPostCallbacks (void );
#endif
xmlParserInputPtr xmlNoNetExternalEntityLoader(const char *URL,
const char *ID,
xmlParserCtxtPtr ctxt);
xmlChar * xmlNormalizeWindowsPath (const xmlChar *path);
int xmlCheckFilename (const char *path);
int xmlFileMatch (const char *filename);
void * xmlFileOpen (const char *filename);
int xmlFileRead (void * context,
char * buffer,
int len);
int xmlFileClose (void * context);
#ifdef LIBXML_HTTP_ENABLED
int xmlIOHTTPMatch (const char *filename);
void * xmlIOHTTPOpen (const char *filename);
int xmlIOHTTPRead (void * context,
char * buffer,
int len);
int xmlIOHTTPClose (void * context);
#endif
#ifdef LIBXML_FTP_ENABLED
int xmlIOFTPMatch (const char *filename);
void * xmlIOFTPOpen (const char *filename);
int xmlIOFTPRead (void * context,
char * buffer,
int len);
int xmlIOFTPClose (void * context);
#endif
#ifdef __cplusplus
}
#endif
#endif