xmlIO.h revision 38ae7e4efe803ea78b6499cd05a394db32623e41
/*
* Summary: interface for the I/O interfaces used by the parser
* Description: interface for the I/O interfaces used by the parser
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/
#ifndef __XML_IO_H__
#define __XML_IO_H__
#include <stdio.h>
#include <libxml/xmlversion.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Those are the functions and datatypes for the parser input
* I/O structures.
*/
/**
* xmlInputMatchCallback:
* @filename: the filename or URI
*
* Callback used in the I/O Input API to detect if the current handler
* can provide input fonctionnalities for this resource.
*
* Returns 1 if yes and 0 if another Input module should be used
*/
/**
* xmlInputOpenCallback:
* @filename: the filename or URI
*
* Callback used in the I/O Input API to open the resource
*
* Returns an Input context or NULL in case or error
*/
/**
* xmlInputReadCallback:
* @context: an Input context
* @buffer: the buffer to store data read
* @len: the length of the buffer in bytes
*
* Callback used in the I/O Input API to read the resource
*
* Returns the number of bytes read or -1 in case of error
*/
/**
* xmlInputCloseCallback:
* @context: an Input context
*
* Callback used in the I/O Input API to close the resource
*
* Returns 0 or -1 in case of error
*/
#ifdef LIBXML_OUTPUT_ENABLED
/*
* Those are the functions and datatypes for the library output
* I/O structures.
*/
/**
* xmlOutputMatchCallback:
* @filename: the filename or URI
*
* Callback used in the I/O Output API to detect if the current handler
* can provide output fonctionnalities for this resource.
*
* Returns 1 if yes and 0 if another Output module should be used
*/
/**
* xmlOutputOpenCallback:
* @filename: the filename or URI
*
* Callback used in the I/O Output API to open the resource
*
* Returns an Output context or NULL in case or error
*/
/**
* xmlOutputWriteCallback:
* @context: an Output context
* @buffer: the buffer of data to write
* @len: the length of the buffer in bytes
*
* Callback used in the I/O Output API to write to the resource
*
* Returns the number of bytes written or -1 in case of error
*/
int len);
/**
* xmlOutputCloseCallback:
* @context: an Output context
*
* Callback used in the I/O Output API to close the resource
*
* Returns 0 or -1 in case of error
*/
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef __cplusplus
}
#endif
#include <libxml/encoding.h>
#ifdef __cplusplus
extern "C" {
#endif
struct _xmlParserInputBuffer {
void* context;
int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
int error;
unsigned long rawconsumed;/* amount consumed from raw */
};
#ifdef LIBXML_OUTPUT_ENABLED
struct _xmlOutputBuffer {
void* context;
int written; /* total number of byte written */
int error;
};
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for input
*/
xmlCleanupInputCallbacks (void);
xmlPopInputCallbacks (void);
xmlRegisterDefaultInputCallbacks (void);
xmlParserInputBufferCreateFilename (const char *URI,
void *ioctx,
int len);
int len);
int len,
const char *buf);
xmlParserGetDirectory (const char *filename);
__xmlParserInputBufferCreateFilename(const char *URI,
#ifdef LIBXML_OUTPUT_ENABLED
/*
* Interfaces for output
*/
xmlCleanupOutputCallbacks (void);
xmlOutputBufferCreateFilename (const char *URI,
int compression);
xmlOutputBufferCreateFd (int fd,
void *ioctx,
int len,
const char *buf);
const char *str);
__xmlOutputBufferCreateFilename(const char *URI,
int compression);
#ifdef LIBXML_HTTP_ENABLED
/* This function only exists if HTTP support built into the library */
xmlRegisterHTTPPostCallbacks (void );
#endif /* LIBXML_HTTP_ENABLED */
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* A predefined entity loader disabling network accesses
*/
xmlNoNetExternalEntityLoader (const char *URL,
const char *ID,
/*
* xmlNormalizeWindowsPath is obsolete, don't use it.
* Check xmlCanonicPath in uri.h for a better alternative.
*/
xmlCheckFilename (const char *path);
/**
* Default 'file://' protocol callbacks
*/
xmlFileMatch (const char *filename);
xmlFileOpen (const char *filename);
xmlFileRead (void * context,
char * buffer,
int len);
xmlFileClose (void * context);
/**
* Default 'http://' protocol callbacks
*/
#ifdef LIBXML_HTTP_ENABLED
xmlIOHTTPMatch (const char *filename);
xmlIOHTTPOpen (const char *filename);
#ifdef LIBXML_OUTPUT_ENABLED
xmlIOHTTPOpenW (const char * post_uri,
int compression );
#endif /* LIBXML_OUTPUT_ENABLED */
xmlIOHTTPRead (void * context,
char * buffer,
int len);
xmlIOHTTPClose (void * context);
#endif /* LIBXML_HTTP_ENABLED */
/**
* Default 'ftp://' protocol callbacks
*/
#ifdef LIBXML_FTP_ENABLED
xmlIOFTPMatch (const char *filename);
xmlIOFTPOpen (const char *filename);
xmlIOFTPRead (void * context,
char * buffer,
int len);
xmlIOFTPClose (void * context);
#endif /* LIBXML_FTP_ENABLED */
#ifdef __cplusplus
}
#endif
#endif /* __XML_IO_H__ */