1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/libxml2/libxml2_xmlio.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,344 @@
1.4 +/*
1.5 + * Summary: interface for the I/O interfaces used by the parser
1.6 + * Description: interface for the I/O interfaces used by the parser
1.7 + *
1.8 + * Copy: See Copyright for the status of this software.
1.9 + *
1.10 + * Author: Daniel Veillard
1.11 + * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
1.12 + */
1.13 +
1.14 +/** @file
1.15 +@publishedAll
1.16 +@released
1.17 +*/
1.18 +
1.19 +#ifndef XML_IO_H
1.20 +#define XML_IO_H
1.21 +
1.22 +#include <stdapis/libxml2/libxml2_encoding.h>
1.23 +
1.24 +#ifdef __cplusplus
1.25 +extern "C" {
1.26 +#endif
1.27 +
1.28 +/*
1.29 + * Those are the functions and datatypes for the parser input
1.30 + * I/O structures.
1.31 + */
1.32 +
1.33 +/**
1.34 + * xmlInputMatchCallback:
1.35 + * @param filename the filename or URI
1.36 + *
1.37 + * Callback used in the I/O Input API to detect if the current handler
1.38 + * can provide input fonctionnalities for this resource.
1.39 + *
1.40 + * Returns 1 if yes and 0 if another Input module should be used
1.41 + */
1.42 +typedef int (*xmlInputMatchCallback) (char const *filename);
1.43 +/**
1.44 + * xmlInputOpenCallback:
1.45 + * @param filename the filename or URI
1.46 + *
1.47 + * Callback used in the I/O Input API to open the resource
1.48 + *
1.49 + * Returns an Input context or NULL in case or error
1.50 + */
1.51 +typedef void * (*xmlInputOpenCallback) (char const *filename);
1.52 +/**
1.53 + * xmlInputReadCallback:
1.54 + * @param context an Input context
1.55 + * @param buffer the buffer to store data read
1.56 + * @param len the length of the buffer in bytes
1.57 + *
1.58 + * Callback used in the I/O Input API to read the resource
1.59 + *
1.60 + * Returns the number of bytes read or -1 in case of error
1.61 + */
1.62 +typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
1.63 +/**
1.64 + * xmlInputCloseCallback:
1.65 + * @param context an Input context
1.66 + *
1.67 + * Callback used in the I/O Input API to close the resource
1.68 + *
1.69 + * Returns 0 or -1 in case of error
1.70 + */
1.71 +typedef int (*xmlInputCloseCallback) (void * context);
1.72 +
1.73 +#ifdef LIBXML_OUTPUT_ENABLED
1.74 +/*
1.75 + * Those are the functions and datatypes for the library output
1.76 + * I/O structures.
1.77 + */
1.78 +
1.79 +/**
1.80 + * xmlOutputMatchCallback:
1.81 + * @param filename the filename or URI
1.82 + *
1.83 + * Callback used in the I/O Output API to detect if the current handler
1.84 + * can provide output fonctionnalities for this resource.
1.85 + *
1.86 + * Returns 1 if yes and 0 if another Output module should be used
1.87 + */
1.88 +typedef int (*xmlOutputMatchCallback) (char const *filename);
1.89 +/**
1.90 + * xmlOutputOpenCallback:
1.91 + * @param filename the filename or URI
1.92 + *
1.93 + * Callback used in the I/O Output API to open the resource
1.94 + *
1.95 + * Returns an Output context or NULL in case or error
1.96 + */
1.97 +typedef void * (*xmlOutputOpenCallback) (char const *filename);
1.98 +/**
1.99 + * xmlOutputWriteCallback:
1.100 + * @param context an Output context
1.101 + * @param buffer the buffer of data to write
1.102 + * @param len the length of the buffer in bytes
1.103 + *
1.104 + * Callback used in the I/O Output API to write to the resource
1.105 + *
1.106 + * Returns the number of bytes written or -1 in case of error
1.107 + */
1.108 +typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
1.109 + int len);
1.110 +/**
1.111 + * xmlOutputCloseCallback:
1.112 + * @param context an Output context
1.113 + *
1.114 + * Callback used in the I/O Output API to close the resource
1.115 + *
1.116 + * Returns 0 or -1 in case of error
1.117 + */
1.118 +typedef int (*xmlOutputCloseCallback) (void * context);
1.119 +#endif /* LIBXML_OUTPUT_ENABLED */
1.120 +
1.121 +#ifdef __cplusplus
1.122 +}
1.123 +#endif
1.124 +
1.125 +#include <stdapis/libxml2/libxml2_parser.h>
1.126 +
1.127 +#ifdef __cplusplus
1.128 +extern "C" {
1.129 +#endif
1.130 +struct _xmlParserInputBuffer {
1.131 + void* context;
1.132 + xmlInputReadCallback readcallback;
1.133 + xmlInputCloseCallback closecallback;
1.134 +
1.135 + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
1.136 +
1.137 + xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
1.138 + xmlBufferPtr raw; /* if encoder != NULL buffer for raw input */
1.139 + int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
1.140 + int error;
1.141 + unsigned long rawconsumed;/* amount consumed from raw */
1.142 +};
1.143 +
1.144 +
1.145 +#ifdef LIBXML_OUTPUT_ENABLED
1.146 +struct _xmlOutputBuffer {
1.147 + void* context;
1.148 + xmlOutputWriteCallback writecallback;
1.149 + xmlOutputCloseCallback closecallback;
1.150 +
1.151 + xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
1.152 +
1.153 + xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
1.154 + xmlBufferPtr conv; /* if encoder != NULL buffer for output */
1.155 + int written; /* total number of byte written */
1.156 + int error;
1.157 +};
1.158 +#endif /* LIBXML_OUTPUT_ENABLED */
1.159 +
1.160 +/*
1.161 + * Interfaces for input
1.162 + */
1.163 +XMLPUBFUN void XMLCALL
1.164 + xmlCleanupInputCallbacks (void);
1.165 +
1.166 +XMLPUBFUN int XMLCALL
1.167 + xmlPopInputCallbacks (void);
1.168 +
1.169 +XMLPUBFUN void XMLCALL
1.170 + xmlRegisterDefaultInputCallbacks (void);
1.171 +XMLPUBFUN xmlParserInputBufferPtr XMLCALL
1.172 + xmlAllocParserInputBuffer (xmlCharEncoding enc);
1.173 +
1.174 +XMLPUBFUN xmlParserInputBufferPtr XMLCALL
1.175 + xmlParserInputBufferCreateFilename (const char *URI,
1.176 + xmlCharEncoding enc);
1.177 +
1.178 +#ifndef XMLENGINE_EXCLUDE_FILE_FUNC
1.179 +XMLPUBFUN xmlParserInputBufferPtr XMLCALL
1.180 + xmlParserInputBufferCreateFile (FILE *file,
1.181 + xmlCharEncoding enc);
1.182 +#endif
1.183 +
1.184 +XMLPUBFUN xmlParserInputBufferPtr XMLCALL
1.185 + xmlParserInputBufferCreateFd (int fd,
1.186 + xmlCharEncoding enc);
1.187 +XMLPUBFUN xmlParserInputBufferPtr XMLCALL
1.188 + xmlParserInputBufferCreateMem (const char *mem, int size,
1.189 + xmlCharEncoding enc);
1.190 +XMLPUBFUN xmlParserInputBufferPtr XMLCALL
1.191 + xmlParserInputBufferCreateStatic (const char *mem, int size,
1.192 + xmlCharEncoding enc);
1.193 +XMLPUBFUN xmlParserInputBufferPtr XMLCALL
1.194 + xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
1.195 + xmlInputCloseCallback ioclose,
1.196 + void *ioctx,
1.197 + xmlCharEncoding enc);
1.198 +XMLPUBFUN int XMLCALL
1.199 + xmlParserInputBufferRead (xmlParserInputBufferPtr in,
1.200 + int len);
1.201 +XMLPUBFUN int XMLCALL
1.202 + xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
1.203 + int len);
1.204 +XMLPUBFUN int XMLCALL
1.205 + xmlParserInputBufferPush (xmlParserInputBufferPtr in,
1.206 + int len,
1.207 + const char *buf);
1.208 +XMLPUBFUN void XMLCALL
1.209 + xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
1.210 +XMLPUBFUN char * XMLCALL
1.211 + xmlParserGetDirectory (const char *filename);
1.212 +
1.213 +XMLPUBFUN int XMLCALL
1.214 + xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
1.215 + xmlInputOpenCallback openFunc,
1.216 + xmlInputReadCallback readFunc,
1.217 + xmlInputCloseCallback closeFunc);
1.218 +#ifdef LIBXML_OUTPUT_ENABLED
1.219 +/*
1.220 + * Interfaces for output
1.221 + */
1.222 +XMLPUBFUN void XMLCALL
1.223 + xmlCleanupOutputCallbacks (void);
1.224 +XMLPUBFUN void XMLCALL
1.225 + xmlRegisterDefaultOutputCallbacks(void);
1.226 +XMLPUBFUN xmlOutputBufferPtr XMLCALL
1.227 + xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
1.228 +
1.229 +XMLPUBFUN xmlOutputBufferPtr XMLCALL
1.230 + xmlOutputBufferCreateFilename (const char *URI,
1.231 + xmlCharEncodingHandlerPtr encoder,
1.232 + int compression);
1.233 +//libxslt needs it
1.234 +XMLPUBFUN xmlOutputBufferPtr XMLCALL
1.235 + xmlOutputBufferCreateFile (FILE *file,
1.236 + xmlCharEncodingHandlerPtr encoder);
1.237 +
1.238 +XMLPUBFUN xmlOutputBufferPtr XMLCALL
1.239 + xmlOutputBufferCreateFd (int fd,
1.240 + xmlCharEncodingHandlerPtr encoder);
1.241 +
1.242 +XMLPUBFUN xmlOutputBufferPtr XMLCALL
1.243 + xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
1.244 + xmlOutputCloseCallback ioclose,
1.245 + void *ioctx,
1.246 + xmlCharEncodingHandlerPtr encoder);
1.247 +
1.248 +XMLPUBFUN int XMLCALL
1.249 + xmlOutputBufferWrite (xmlOutputBufferPtr out,
1.250 + int len,
1.251 + const char *buf);
1.252 +XMLPUBFUN int XMLCALL
1.253 + xmlOutputBufferWriteString (xmlOutputBufferPtr out,
1.254 + const char *str);
1.255 +XMLPUBFUN int XMLCALL
1.256 + xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
1.257 + const xmlChar *str,
1.258 + xmlCharEncodingOutputFunc escaping);
1.259 +
1.260 +XMLPUBFUN int XMLCALL
1.261 + xmlOutputBufferFlush (xmlOutputBufferPtr out);
1.262 +XMLPUBFUN int XMLCALL
1.263 + xmlOutputBufferClose (xmlOutputBufferPtr out);
1.264 +
1.265 +XMLPUBFUN int XMLCALL
1.266 + xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
1.267 + xmlOutputOpenCallback openFunc,
1.268 + xmlOutputWriteCallback writeFunc,
1.269 + xmlOutputCloseCallback closeFunc);
1.270 +#endif /* LIBXML_OUTPUT_ENABLED */
1.271 +
1.272 +/* This function only exists if HTTP support built into the library */
1.273 +#ifdef LIBXML_HTTP_ENABLED
1.274 +XMLPUBFUN void * XMLCALL
1.275 + xmlIOHTTPOpenW (const char * post_uri,
1.276 + int compression );
1.277 +XMLPUBFUN void XMLCALL
1.278 + xmlRegisterHTTPPostCallbacks (void );
1.279 +#endif
1.280 +
1.281 +XMLPUBFUN xmlParserInputPtr XMLCALL
1.282 + xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
1.283 + xmlParserInputPtr ret);
1.284 +
1.285 +/*
1.286 + * A predefined entity loader disabling network accesses
1.287 + */
1.288 +XMLPUBFUN xmlParserInputPtr XMLCALL
1.289 + xmlNoNetExternalEntityLoader (const char *URL,
1.290 + const char *ID,
1.291 + xmlParserCtxtPtr ctxt);
1.292 +
1.293 +XMLPUBFUN int XMLCALL
1.294 + xmlCheckFilename (const char *path);
1.295 +/**
1.296 + * Default 'file://' protocol callbacks
1.297 + */
1.298 +XMLPUBFUN int XMLCALL
1.299 + xmlFileMatch (const char *filename);
1.300 +
1.301 +XMLPUBFUN void * XMLCALL
1.302 + xmlFileOpen (const char *filename);
1.303 +XMLPUBFUN int XMLCALL
1.304 + xmlFileRead (void * context,
1.305 + char * buffer,
1.306 + int len);
1.307 +XMLPUBFUN int XMLCALL
1.308 + xmlFileClose (void * context);
1.309 +
1.310 +/**
1.311 + * Default 'http://' protocol callbacks
1.312 + */
1.313 +#ifdef LIBXML_HTTP_ENABLED
1.314 +XMLPUBFUN int XMLCALL
1.315 + xmlIOHTTPMatch (const char *filename);
1.316 +XMLPUBFUN void * XMLCALL
1.317 + xmlIOHTTPOpen (const char *filename);
1.318 +XMLPUBFUN int XMLCALL
1.319 + xmlIOHTTPRead (void * context,
1.320 + char * buffer,
1.321 + int len);
1.322 +XMLPUBFUN int XMLCALL
1.323 + xmlIOHTTPClose (void * context);
1.324 +#endif /* LIBXML_HTTP_ENABLED */
1.325 +
1.326 +/**
1.327 + * Default 'ftp://' protocol callbacks
1.328 + */
1.329 +#ifdef LIBXML_FTP_ENABLED
1.330 +XMLPUBFUN int XMLCALL
1.331 + xmlIOFTPMatch (const char *filename);
1.332 +XMLPUBFUN void * XMLCALL
1.333 + xmlIOFTPOpen (const char *filename);
1.334 +XMLPUBFUN int XMLCALL
1.335 + xmlIOFTPRead (void * context,
1.336 + char * buffer,
1.337 + int len);
1.338 +XMLPUBFUN int XMLCALL
1.339 + xmlIOFTPClose (void * context);
1.340 +#endif /* LIBXML_FTP_ENABLED */
1.341 +
1.342 +#ifdef __cplusplus
1.343 +}
1.344 +#endif
1.345 +
1.346 +#endif /* XML_IO_H */
1.347 +