xmlIO.c revision d46ee884c41b808b239563b1978468aae12e33a2
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlIO.c : implementation of the I/O interfaces used by the parser
c869993e79c1eafbec61a56bf6cea848fe754c71xy * See Copyright for the status of this software.
c869993e79c1eafbec61a56bf6cea848fe754c71xy * daniel@veillard.com
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * 14 Nov 2000 ht - for VMS, truncated name of long functions to under 32 char
c869993e79c1eafbec61a56bf6cea848fe754c71xy#if defined(_WIN32_WCE)
c869993e79c1eafbec61a56bf6cea848fe754c71xy/* Figure a portable way to know if a file is a directory. */
c869993e79c1eafbec61a56bf6cea848fe754c71xy /* MS C library seems to define stat and _stat. The definition
c869993e79c1eafbec61a56bf6cea848fe754c71xy is identical. Still, mapping them to each other causes a warning. */
c869993e79c1eafbec61a56bf6cea848fe754c71xy# if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
c869993e79c1eafbec61a56bf6cea848fe754c71xy/* #define VERBOSE_FAILURE */
c869993e79c1eafbec61a56bf6cea848fe754c71xy/* #define DEBUG_EXTERNAL_ENTITIES */
c869993e79c1eafbec61a56bf6cea848fe754c71xy/* #define DEBUG_INPUT */
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Input I/O callback sets
c869993e79c1eafbec61a56bf6cea848fe754c71xytypedef struct _xmlInputCallback {
c869993e79c1eafbec61a56bf6cea848fe754c71xystatic xmlInputCallback xmlInputCallbackTable[MAX_INPUT_CALLBACK];
c869993e79c1eafbec61a56bf6cea848fe754c71xystatic int xmlInputCallbackNr = 0;
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Output I/O callback sets
c869993e79c1eafbec61a56bf6cea848fe754c71xytypedef struct _xmlOutputCallback {
c869993e79c1eafbec61a56bf6cea848fe754c71xystatic xmlOutputCallback xmlOutputCallbackTable[MAX_OUTPUT_CALLBACK];
c869993e79c1eafbec61a56bf6cea848fe754c71xystatic int xmlOutputCallbackNr = 0;
c869993e79c1eafbec61a56bf6cea848fe754c71xy#endif /* LIBXML_OUTPUT_ENABLED */
c869993e79c1eafbec61a56bf6cea848fe754c71xy/************************************************************************
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Tree memory error handler *
c869993e79c1eafbec61a56bf6cea848fe754c71xy ************************************************************************/
c869993e79c1eafbec61a56bf6cea848fe754c71xystatic const char *IOerr[] = {
c869993e79c1eafbec61a56bf6cea848fe754c71xy "Attempt to load network entity %s", /* XML_IO_NETWORK_ATTEMPT */
c869993e79c1eafbec61a56bf6cea848fe754c71xy "flush error",
c869993e79c1eafbec61a56bf6cea848fe754c71xy "write error",
c869993e79c1eafbec61a56bf6cea848fe754c71xy "no input",
c869993e79c1eafbec61a56bf6cea848fe754c71xy "buffer full",
c869993e79c1eafbec61a56bf6cea848fe754c71xy "loading error",
c869993e79c1eafbec61a56bf6cea848fe754c71xy#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
c869993e79c1eafbec61a56bf6cea848fe754c71xy * __xmlIOWin32UTF8ToWChar:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @u8String: uft-8 string
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Convert a string from utf-8 to wchar (WINDOWS ONLY!)
c869993e79c1eafbec61a56bf6cea848fe754c71xy MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, u8String,
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlIOErrMemory:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @extra: extra informations
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Handle an out of memory condition
c869993e79c1eafbec61a56bf6cea848fe754c71xystatic void
c869993e79c1eafbec61a56bf6cea848fe754c71xy __xmlSimpleError(XML_FROM_IO, XML_ERR_NO_MEMORY, NULL, NULL, extra);
c869993e79c1eafbec61a56bf6cea848fe754c71xy * __xmlIOErr:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @code: the error number
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @extra: extra informations
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Handle an I/O error
c869993e79c1eafbec61a56bf6cea848fe754c71xy unsigned int idx;
c869993e79c1eafbec61a56bf6cea848fe754c71xy if (code == 0) {
c869993e79c1eafbec61a56bf6cea848fe754c71xy else if (errno == EINPROGRESS) code = XML_IO_EINPROGRESS;
c869993e79c1eafbec61a56bf6cea848fe754c71xy else if (errno == ENAMETOOLONG) code = XML_IO_ENAMETOOLONG;
c869993e79c1eafbec61a56bf6cea848fe754c71xy else if (errno == ECONNREFUSED) code = XML_IO_ECONNREFUSED;
c869993e79c1eafbec61a56bf6cea848fe754c71xy else if (errno == ENETUNREACH) code = XML_IO_ENETUNREACH;
c869993e79c1eafbec61a56bf6cea848fe754c71xy else if (errno == EINPROGRESS) code = XML_IO_EINPROGRESS;
c869993e79c1eafbec61a56bf6cea848fe754c71xy else if (errno == EAFNOSUPPORT) code = XML_IO_EAFNOSUPPORT;
c869993e79c1eafbec61a56bf6cea848fe754c71xy#endif /* HAVE_ERRNO_H */
8bb4b220fdb894543e41a5f9037898cf3c3f312bgl * xmlIOErr:
8bb4b220fdb894543e41a5f9037898cf3c3f312bgl * @code: the error number
8bb4b220fdb894543e41a5f9037898cf3c3f312bgl * @extra: extra informations
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Handle an I/O error
c869993e79c1eafbec61a56bf6cea848fe754c71xystatic void
c869993e79c1eafbec61a56bf6cea848fe754c71xy * __xmlLoaderErr:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @ctx: the parser context
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @extra: extra informations
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Handle a resource access error
c869993e79c1eafbec61a56bf6cea848fe754c71xy__xmlLoaderErr(void *ctx, const char *msg, const char *filename)
c869993e79c1eafbec61a56bf6cea848fe754c71xy __xmlRaiseError(schannel, channel, data, ctxt, NULL, XML_FROM_IO,
c869993e79c1eafbec61a56bf6cea848fe754c71xy/************************************************************************
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Tree memory error handler *
c869993e79c1eafbec61a56bf6cea848fe754c71xy ************************************************************************/
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlNormalizeWindowsPath:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @path: the input file path
c869993e79c1eafbec61a56bf6cea848fe754c71xy * This function is obsolete. Please see xmlURIFromPath in uri.c for
c869993e79c1eafbec61a56bf6cea848fe754c71xy * a better solution.
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Returns a canonicalized version of the path
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlCleanupInputCallbacks:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * clears the entire input callback table. this includes the
c869993e79c1eafbec61a56bf6cea848fe754c71xy * compiled-in I/O.
8bb4b220fdb894543e41a5f9037898cf3c3f312bgl * xmlPopInputCallbacks:
8bb4b220fdb894543e41a5f9037898cf3c3f312bgl * Clear the top input callback from the input stack. this includes the
c869993e79c1eafbec61a56bf6cea848fe754c71xy * compiled-in I/O.
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Returns the number of input callback registered or -1 in case of error.
c869993e79c1eafbec61a56bf6cea848fe754c71xy return(-1);
c869993e79c1eafbec61a56bf6cea848fe754c71xy return(-1);
c869993e79c1eafbec61a56bf6cea848fe754c71xy xmlInputCallbackTable[xmlInputCallbackNr].matchcallback = NULL;
c869993e79c1eafbec61a56bf6cea848fe754c71xy xmlInputCallbackTable[xmlInputCallbackNr].opencallback = NULL;
c869993e79c1eafbec61a56bf6cea848fe754c71xy xmlInputCallbackTable[xmlInputCallbackNr].readcallback = NULL;
c869993e79c1eafbec61a56bf6cea848fe754c71xy xmlInputCallbackTable[xmlInputCallbackNr].closecallback = NULL;
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlCleanupOutputCallbacks:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * clears the entire output callback table. this includes the
c869993e79c1eafbec61a56bf6cea848fe754c71xy * compiled-in I/O callbacks.
c869993e79c1eafbec61a56bf6cea848fe754c71xy#endif /* LIBXML_OUTPUT_ENABLED */
c869993e79c1eafbec61a56bf6cea848fe754c71xy/************************************************************************
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Standard I/O for file accesses *
c869993e79c1eafbec61a56bf6cea848fe754c71xy ************************************************************************/
c869993e79c1eafbec61a56bf6cea848fe754c71xy#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlWrapOpenUtf8:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @path: the path in utf-8 encoding
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @mode: type of access (0 - read, 1 - write)
c869993e79c1eafbec61a56bf6cea848fe754c71xy * function opens the file specified by @path
c869993e79c1eafbec61a56bf6cea848fe754c71xy /* maybe path in native encoding */
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlWrapStatUtf8:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @path: the path in utf-8 encoding
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @info: structure that stores results
c869993e79c1eafbec61a56bf6cea848fe754c71xy * function obtains information about the file or directory
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng /* maybe path in native encoding */
c869993e79c1eafbec61a56bf6cea848fe754c71xy return -1;
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlWrapOpenNative:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @path: the path
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @mode: type of access (0 - read, 1 - write)
c869993e79c1eafbec61a56bf6cea848fe754c71xy * function opens the file specified by @path
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * xmlWrapStatNative:
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * @path: the path
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * @info: structure that stores results
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * function obtains information about the file or directory
da14cebe459d3275048785f25bd869cb09b5307fEric ChengxmlWrapStatNative(const char *path,struct stat *info)
da14cebe459d3275048785f25bd869cb09b5307fEric Chengtypedef int (* xmlWrapStatFunc) (const char *f, struct stat *s);
da14cebe459d3275048785f25bd869cb09b5307fEric Chengtypedef FILE* (* xmlWrapOpenFunc)(const char *f,int mode);
da14cebe459d3275048785f25bd869cb09b5307fEric Chengstatic xmlWrapOpenFunc xmlWrapOpen = xmlWrapOpenNative;
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * xmlInitPlatformSpecificIo:
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * Initialize platform specific features.
fa25784ca4b51c206177d891a654f1d36a25d41fxystatic void
c869993e79c1eafbec61a56bf6cea848fe754c71xy static int xmlPlatformIoInitialized = 0;
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng if(GetVersionEx(&osvi) && (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)) {
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlCheckFilename:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @path: the path to check
fa25784ca4b51c206177d891a654f1d36a25d41fxy * function checks to see if @path is a valid source
c869993e79c1eafbec61a56bf6cea848fe754c71xy * (file, socket...) for XML.
fa25784ca4b51c206177d891a654f1d36a25d41fxy * if stat is not available on the target machine,
c869993e79c1eafbec61a56bf6cea848fe754c71xy * returns 1. if stat fails, returns 0 (if calling
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * stat on the filename fails, it can't be right).
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * if stat succeeds and the file is a directory,
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * returns 2. otherwise returns 1.
c869993e79c1eafbec61a56bf6cea848fe754c71xy return(0);
c869993e79c1eafbec61a56bf6cea848fe754c71xy#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#endif /* HAVE_STAT */
c869993e79c1eafbec61a56bf6cea848fe754c71xy return(0);
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * xmlFdRead:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @context: the I/O context
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * @buffer: where to drop data
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * @len: number of bytes to read
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * Read @len bytes to @buffer from the I/O channel.
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * Returns the number of bytes written
da14cebe459d3275048785f25bd869cb09b5307fEric ChengxmlFdRead (void * context, char * buffer, int len) {
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng ret = read((int) (long) context, &buffer[0], len);
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * xmlFdWrite:
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * @context: the I/O context
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * @buffer: where to get data
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * @len: number of bytes to write
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Write @len bytes from @buffer to the I/O channel.
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * Returns the number of bytes written
da14cebe459d3275048785f25bd869cb09b5307fEric ChengxmlFdWrite (void * context, const char * buffer, int len) {
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng ret = write((int) (long) context, &buffer[0], len);
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#endif /* LIBXML_OUTPUT_ENABLED */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * xmlFdClose:
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * @context: the I/O context
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * Close an I/O channel
fa25784ca4b51c206177d891a654f1d36a25d41fxy * Returns 0 in case of success and error code otherwise
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * xmlFileMatch:
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * @filename: the URI for matching
c869993e79c1eafbec61a56bf6cea848fe754c71xy * input from FILE *
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * Returns 1 if matches, 0 otherwise
da14cebe459d3275048785f25bd869cb09b5307fEric ChengxmlFileMatch (const char *filename ATTRIBUTE_UNUSED) {
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * xmlFileOpen_real:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @filename: the URI for matching
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * input from FILE *, supports compressed input
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * if @filename is " " then the standard input is used
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Returns an I/O context or NULL in case of error
da14cebe459d3275048785f25bd869cb09b5307fEric Chengstatic void *
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng return((void *) fd);
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17)) {
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__)
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng } else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) {
c869993e79c1eafbec61a56bf6cea848fe754c71xy#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__)
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng } else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:/", 6)) {
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng /* lots of generators seems to lazy to read RFC 1738 */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__)
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#endif /* WIN32 */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng return((void *) fd);
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * xmlFileOpen:
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * @filename: the URI for matching
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * Wrapper around xmlFileOpen_real that try it with an unescaped
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * version of @filename, if this fails fallback to @filename
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * Returns a handler or NULL in case or failure
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng unescaped = xmlURIUnescapeString(filename, 0, NULL);
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlFileOpenW:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @filename: the URI for matching
c869993e79c1eafbec61a56bf6cea848fe754c71xy * output to from FILE *,
c869993e79c1eafbec61a56bf6cea848fe754c71xy * if @filename is "-" then the standard output is used
c869993e79c1eafbec61a56bf6cea848fe754c71xy * Returns an I/O context or NULL in case of error
c869993e79c1eafbec61a56bf6cea848fe754c71xystatic void *
c869993e79c1eafbec61a56bf6cea848fe754c71xy return((void *) fd);
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file://localhost/", 17))
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__)
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng else if (!xmlStrncasecmp(BAD_CAST filename, BAD_CAST "file:///", 8)) {
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#if defined (_WIN32) || defined (__DJGPP__) && !defined(__CYGWIN__)
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#endif /* WIN32 */
c869993e79c1eafbec61a56bf6cea848fe754c71xy return((void *) fd);
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#endif /* LIBXML_OUTPUT_ENABLED */
c869993e79c1eafbec61a56bf6cea848fe754c71xy * xmlFileRead:
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @context: the I/O context
c869993e79c1eafbec61a56bf6cea848fe754c71xy * @buffer: where to drop data
int ret;
return(ret);
#ifdef LIBXML_OUTPUT_ENABLED
int items;
int ret;
if (ret < 0)
if (ret < 0)
return(ret);
int ret;
if (ret < 0)
return(ret);
#ifdef LIBXML_OUTPUT_ENABLED
int ret;
if (ret != 0)
return(len);
#ifdef HAVE_ZLIB_H
return((void *) fd);
return(NULL);
return(NULL);
return((void *) fd);
char *unescaped;
void *retval;
return retval;
#ifdef LIBXML_OUTPUT_ENABLED
return((void *) fd);
return(NULL);
return((void *) fd);
int ret;
return(ret);
#ifdef LIBXML_OUTPUT_ENABLED
int ret;
return(ret);
int ret;
return(ret);
#ifdef LIBXML_HTTP_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
typedef struct xmlIOHTTPWriteCtxt_
int compression;
char * uri;
void * doc_buff;
#ifdef HAVE_ZLIB_H
typedef struct xmlZMemBuff_
unsigned long size;
unsigned long crc;
unsigned char * zbuff;
int idx;
** This is plagiarized from putLong in gzio.c (zlib source) where
#ifdef DEBUG_HTTP
int z_err;
#ifdef DEBUG_HTTP
z_err );
int z_err;
int hdr_lgth;
return ( NULL );
return ( NULL );
return ( NULL );
z_err );
return ( NULL );
0, 0, 0, 0, 0, 0, LXML_ZLIB_OS_CODE );
return ( buff );
else if ( ext_amt == 0 )
#ifdef DEBUG_HTTP
rc = 0;
new_size );
return ( rc );
int z_err;
return ( len );
int z_err;
return ( zlgth );
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_OUTPUT_ENABLED
return (NULL);
return (NULL);
return (NULL);
#ifdef HAVE_ZLIB_H
return (ctxt);
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
if ( len > 0 ) {
#ifdef HAVE_ZLIB_H
if ( len < 0 ) {
return ( len );
#ifdef LIBXML_OUTPUT_ENABLED
int http_rtn = 0;
int content_lgth = 0;
#ifdef HAVE_ZLIB_H
content_lgth );
#ifdef DEBUG_HTTP
int avail;
close_rc = 0;
return ( close_rc );
#ifdef LIBXML_FTP_ENABLED
return(xmlInputCallbackNr++);
#ifdef LIBXML_OUTPUT_ENABLED
return(xmlOutputCallbackNr++);
xmlRegisterDefaultInputCallbacks(void) {
#ifdef HAVE_ZLIB_H
#ifdef LIBXML_HTTP_ENABLED
#ifdef LIBXML_FTP_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
xmlRegisterDefaultOutputCallbacks (void) {
#ifdef LIBXML_HTTP_ENABLED
#ifdef LIBXML_HTTP_ENABLED
xmlRegisterHTTPPostCallbacks( void ) {
if ( xmlOutputCallbackInitialized == 0 )
return(NULL);
return(NULL);
return(ret);
#ifdef LIBXML_OUTPUT_ENABLED
return(NULL);
return(NULL);
return(ret);
#ifdef LIBXML_OUTPUT_ENABLED
int written;
int err_rc = 0;
if (xmlInputCallbackInitialized == 0)
return(NULL);
#ifdef HAVE_ZLIB_H
return(ret);
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_ZLIB_H
if (xmlOutputCallbackInitialized == 0)
#ifdef HAVE_ZLIB_H
is_file_uri = 0;
#ifdef HAVE_ZLIB_H
return(ret);
#ifdef HAVE_ZLIB_H
return(ret);
return(NULL);
return(ret);
if ((xmlOutputBufferCreateFilenameValue)) {
if (xmlInputCallbackInitialized == 0)
return(ret);
#ifdef LIBXML_OUTPUT_ENABLED
if (xmlOutputCallbackInitialized == 0)
return(ret);
return(ret);
return(ret);
int errcode;
if (errcode != 0) {
return(NULL);
return(ret);
return(NULL);
return(NULL);
return(ret);
#ifdef LIBXML_OUTPUT_ENABLED
return(ret);
return(ret);
#ifdef LIBXML_OUTPUT_ENABLED
return(ret);
return(old);
#ifdef LIBXML_OUTPUT_ENABLED
return(old);
int nbchars = 0;
int ret;
if (len < 0) return(0);
unsigned int use;
if (ret != 0)
if (nbchars < 0) {
if (ret != 0)
#ifdef DEBUG_INPUT
return(nbchars);
int res = 0;
int nbchars = 0;
int buffree;
unsigned int needSize;
if (buffree <= 0) {
if (res <= 0)
if (res < 0) {
unsigned int use;
if (res != 0)
if (nbchars < 0) {
#ifdef DEBUG_INPUT
return(nbchars);
#ifdef LIBXML_OUTPUT_ENABLED
if (len < 0) return(0);
if (ret != 0)
goto done;
if (ret != 0)
goto done;
if (ret >= 0)
if (ret >= 0)
if (ret < 0) {
return(ret);
} while (len > 0);
done:
#ifdef DEBUG_INPUT
return(written);
const unsigned char* inend;
++in;
if (len < 0) return(0);
goto done;
goto done;
if (ret >= 0)
if (ret >= 0)
if (ret < 0) {
return(ret);
done:
#ifdef DEBUG_INPUT
return(written);
int len;
if (len > 0)
return(len);
if (nbchars < 0) {
if (ret >= 0)
if (ret >= 0)
if (ret < 0) {
return(ret);
#ifdef DEBUG_INPUT
return(ret);
char *cur;
return NULL;
if (xmlInputCallbackInitialized == 0)
cur --;
else *cur = 0;
return(ret);
#ifdef LIBXML_HTTP_ENABLED
const char *encoding;
const char *redir;
const char *mime;
int code;
return(ret);
const char *path;
#ifdef LIBXML_CATALOG_ENABLED
static xmlChar *
return resource;
static xmlParserInputPtr
#ifdef DEBUG_EXTERNAL_ENTITIES
return(ret);
#ifdef LIBXML_CATALOG_ENABLED
return (NULL);
return (ret);
xmlGetExternalEntityLoader(void) {
return(xmlCurrentExternalEntityLoader);
char *canonicFilename;
return(NULL);
return(ret);
#ifdef LIBXML_CATALOG_ENABLED
return(NULL);
return(input);
#define bottom_xmlIO
#include "elfgcchack.h"